aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt7
-rw-r--r--MAINTAINERS4
-rw-r--r--arch/blackfin/include/asm/bfin-global.h2
-rw-r--r--arch/blackfin/include/asm/dma-mapping.h6
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c2
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c9
-rw-r--r--arch/blackfin/kernel/process.c7
-rw-r--r--arch/blackfin/kernel/setup.c12
-rw-r--r--arch/blackfin/kernel/traps.c11
-rw-r--r--arch/blackfin/mach-common/cache.S8
-rw-r--r--arch/blackfin/mach-common/cpufreq.c14
-rw-r--r--arch/blackfin/mach-common/entry.S2
-rw-r--r--arch/blackfin/mm/sram-alloc.c8
-rw-r--r--arch/parisc/kernel/ptrace.c10
-rw-r--r--arch/sparc/include/asm/unistd_32.h3
-rw-r--r--arch/sparc/include/asm/unistd_64.h3
-rw-r--r--arch/sparc/kernel/systbls.S2
-rw-r--r--arch/sparc64/kernel/sys32.S13
-rw-r--r--arch/sparc64/kernel/systbls.S4
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/include/asm/mmzone_32.h4
-rw-r--r--arch/x86/include/asm/unistd_64.h4
-rw-r--r--arch/x86/mm/numa_32.c35
-rw-r--r--arch/x86/power/hibernate_32.c4
-rw-r--r--block/blk-map.c6
-rw-r--r--block/genhd.c2
-rw-r--r--block/ioctl.c7
-rw-r--r--drivers/block/cciss.c9
-rw-r--r--drivers/block/xen-blkfront.c8
-rw-r--r--drivers/gpio/gpiolib.c2
-rw-r--r--drivers/hwmon/applesmc.c13
-rw-r--r--drivers/misc/sgi-gru/Makefile4
-rw-r--r--drivers/parport/Kconfig2
-rw-r--r--drivers/pci/pci.c4
-rw-r--r--drivers/spi/pxa2xx_spi.c24
-rw-r--r--drivers/spi/spi_imx.c45
-rw-r--r--drivers/video/atmel_lcdfb.c2
-rw-r--r--drivers/video/backlight/da903x.c2
-rw-r--r--drivers/video/backlight/lcd.c11
-rw-r--r--drivers/video/cirrusfb.c3
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/tmiofb.c10
-rw-r--r--drivers/video/via/viafbdev.c17
-rw-r--r--drivers/w1/masters/omap_hdq.c10
-rw-r--r--fs/ecryptfs/keystore.c31
-rw-r--r--fs/hostfs/hostfs.h2
-rw-r--r--fs/hostfs/hostfs_kern.c4
-rw-r--r--fs/hostfs/hostfs_user.c2
-rw-r--r--fs/namei.c2
-rw-r--r--fs/partitions/check.c31
-rw-r--r--include/linux/cpuset.h4
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/net.h6
-rw-r--r--include/linux/ring_buffer.h3
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--init/Kconfig2
-rw-r--r--ipc/util.c14
-rw-r--r--kernel/cgroup.c21
-rw-r--r--kernel/cpuset.c31
-rw-r--r--kernel/kallsyms.c17
-rw-r--r--kernel/posix-cpu-timers.c7
-rw-r--r--kernel/power/main.c2
-rw-r--r--kernel/profile.c2
-rw-r--r--kernel/relay.c9
-rw-r--r--kernel/sched.c13
-rw-r--r--kernel/sched_debug.c5
-rw-r--r--kernel/sched_stats.h15
-rw-r--r--kernel/sys_ni.c2
-rw-r--r--kernel/trace/ftrace.c34
-rw-r--r--kernel/trace/ring_buffer.c115
-rw-r--r--lib/scatterlist.c2
-rw-r--r--lib/swiotlb.c10
-rw-r--r--mm/memory_hotplug.c3
-rw-r--r--mm/migrate.c5
-rw-r--r--mm/vmalloc.c21
-rw-r--r--mm/vmscan.c9
-rw-r--r--net/compat.c50
-rw-r--r--net/socket.c80
-rw-r--r--sound/pci/hda/hda_beep.c8
-rw-r--r--sound/pci/hda/hda_beep.h1
-rw-r--r--sound/pci/hda/patch_sigmatel.c99
-rw-r--r--sound/pci/pcxhr/pcxhr.c5
82 files changed, 645 insertions, 388 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index f2e1e7fc0ffd..e0f346d201ed 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1195,8 +1195,8 @@ and is between 256 and 4096 characters. It is defined in the file
1195 it is equivalent to "nosmp", which also disables 1195 it is equivalent to "nosmp", which also disables
1196 the IO APIC. 1196 the IO APIC.
1197 1197
1198 max_addr=[KMG] [KNL,BOOT,ia64] All physical memory greater than or 1198 max_addr=nn[KMG] [KNL,BOOT,ia64] All physical memory greater than
1199 equal to this physical address is ignored. 1199 or equal to this physical address is ignored.
1200 1200
1201 max_luns= [SCSI] Maximum number of LUNs to probe. 1201 max_luns= [SCSI] Maximum number of LUNs to probe.
1202 Should be between 1 and 2^32-1. 1202 Should be between 1 and 2^32-1.
@@ -1296,6 +1296,9 @@ and is between 256 and 4096 characters. It is defined in the file
1296 1296
1297 mga= [HW,DRM] 1297 mga= [HW,DRM]
1298 1298
1299 min_addr=nn[KMG] [KNL,BOOT,ia64] All physical memory below this
1300 physical address is ignored.
1301
1299 mminit_loglevel= 1302 mminit_loglevel=
1300 [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this 1303 [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
1301 parameter allows control of the logging verbosity for 1304 parameter allows control of the logging verbosity for
diff --git a/MAINTAINERS b/MAINTAINERS
index 8e0777fae3ce..618c1ef4a397 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1809,7 +1809,7 @@ S: Maintained
1809 1809
1810FTRACE 1810FTRACE
1811P: Steven Rostedt 1811P: Steven Rostedt
1812M: srostedt@redhat.com 1812M: rostedt@goodmis.org
1813S: Maintained 1813S: Maintained
1814 1814
1815FUJITSU FR-V (FRV) PORT 1815FUJITSU FR-V (FRV) PORT
@@ -3928,8 +3928,6 @@ M: bootc@bootc.net
3928S: Maintained 3928S: Maintained
3929 3929
3930SOFTWARE RAID (Multiple Disks) SUPPORT 3930SOFTWARE RAID (Multiple Disks) SUPPORT
3931P: Ingo Molnar
3932M: mingo@redhat.com
3933P: Neil Brown 3931P: Neil Brown
3934M: neilb@suse.de 3932M: neilb@suse.de
3935L: linux-raid@vger.kernel.org 3933L: linux-raid@vger.kernel.org
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h
index 56dcb0a2d244..77295666c34b 100644
--- a/arch/blackfin/include/asm/bfin-global.h
+++ b/arch/blackfin/include/asm/bfin-global.h
@@ -101,7 +101,7 @@ extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
101extern unsigned long _ramstart, _ramend, _rambase; 101extern unsigned long _ramstart, _ramend, _rambase;
102extern unsigned long memory_start, memory_end, physical_mem_end; 102extern unsigned long memory_start, memory_end, physical_mem_end;
103extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], 103extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
104 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[], 104 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
105 _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], 105 _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
106 _ebss_l2[], _l2_lma_start[]; 106 _ebss_l2[], _l2_lma_start[];
107 107
diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index ede748d67efd..d7d9148e433c 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -15,7 +15,11 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
17 17
18#define dma_mapping_error 18static inline
19int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
20{
21 return 0;
22}
19 23
20/* 24/*
21 * Map a single buffer of the indicated size for DMA in streaming mode. 25 * Map a single buffer of the indicated size for DMA in streaming mode.
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 6e08f425bb44..5c0800adb4dd 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -218,7 +218,7 @@ inline int check_gpio(unsigned gpio)
218 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 218 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
219 || gpio == GPIO_PH14 || gpio == GPIO_PH15 219 || gpio == GPIO_PH14 || gpio == GPIO_PH15
220 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 220 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15
221 || gpio > MAX_BLACKFIN_GPIOS) 221 || gpio >= MAX_BLACKFIN_GPIOS)
222 return -EINVAL; 222 return -EINVAL;
223 return 0; 223 return 0;
224} 224}
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 512f8c92ead5..2debc900e246 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -188,10 +188,11 @@ static struct cplb_desc cplb_data[] = {
188 188
189static u16 __init lock_kernel_check(u32 start, u32 end) 189static u16 __init lock_kernel_check(u32 start, u32 end)
190{ 190{
191 if ((end <= (u32) _end && end >= (u32)_stext) || 191 if (start >= (u32)_end || end <= (u32)_stext)
192 (start <= (u32) _end && start >= (u32)_stext)) 192 return 0;
193 return IN_KERNEL; 193
194 return 0; 194 /* This cplb block overlapped with kernel area. */
195 return IN_KERNEL;
195} 196}
196 197
197static unsigned short __init 198static unsigned short __init
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 77800dd83e57..0c3ea118b657 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -351,10 +351,15 @@ int _access_ok(unsigned long addr, unsigned long size)
351 return 1; 351 return 1;
352#endif 352#endif
353#if L1_DATA_B_LENGTH != 0 353#if L1_DATA_B_LENGTH != 0
354 if (addr >= L1_DATA_B_START 354 if (addr >= L1_DATA_B_START + (_ebss_b_l1 - _sdata_b_l1)
355 && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH) 355 && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH)
356 return 1; 356 return 1;
357#endif 357#endif
358#if L2_LENGTH != 0
359 if (addr >= L2_START + (_ebss_l2 - _stext_l2)
360 && addr + size <= L2_START + L2_LENGTH)
361 return 1;
362#endif
358 return 0; 363 return 0;
359} 364}
360EXPORT_SYMBOL(_access_ok); 365EXPORT_SYMBOL(_access_ok);
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 7f35d1046cd8..71a9a8c53cea 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -119,23 +119,23 @@ void __init bfin_relocate_l1_mem(void)
119 /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ 119 /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */
120 dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); 120 dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length);
121 121
122 l1_data_a_length = _ebss_l1 - _sdata_l1; 122 l1_data_a_length = _sbss_l1 - _sdata_l1;
123 if (l1_data_a_length > L1_DATA_A_LENGTH) 123 if (l1_data_a_length > L1_DATA_A_LENGTH)
124 panic("L1 Data SRAM Bank A Overflow\n"); 124 panic("L1 Data SRAM Bank A Overflow\n");
125 125
126 /* Copy _sdata_l1 to _ebss_l1 to L1 data bank A SRAM */ 126 /* Copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */
127 dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); 127 dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length);
128 128
129 l1_data_b_length = _ebss_b_l1 - _sdata_b_l1; 129 l1_data_b_length = _sbss_b_l1 - _sdata_b_l1;
130 if (l1_data_b_length > L1_DATA_B_LENGTH) 130 if (l1_data_b_length > L1_DATA_B_LENGTH)
131 panic("L1 Data SRAM Bank B Overflow\n"); 131 panic("L1 Data SRAM Bank B Overflow\n");
132 132
133 /* Copy _sdata_b_l1 to _ebss_b_l1 to L1 data bank B SRAM */ 133 /* Copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */
134 dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + 134 dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length +
135 l1_data_a_length, l1_data_b_length); 135 l1_data_a_length, l1_data_b_length);
136 136
137 if (L2_LENGTH != 0) { 137 if (L2_LENGTH != 0) {
138 l2_length = _ebss_l2 - _stext_l2; 138 l2_length = _sbss_l2 - _stext_l2;
139 if (l2_length > L2_LENGTH) 139 if (l2_length > L2_LENGTH)
140 panic("L2 SRAM Overflow\n"); 140 panic("L2 SRAM Overflow\n");
141 141
@@ -827,7 +827,7 @@ void __init setup_arch(char **cmdline_p)
827 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", 827 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n",
828 bfin_compiled_revid(), bfin_revid()); 828 bfin_compiled_revid(), bfin_revid());
829 } 829 }
830 if (bfin_revid() <= CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) 830 if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
831 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n", 831 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n",
832 CPU, bfin_revid()); 832 CPU, bfin_revid());
833 } 833 }
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 1aa2c788e228..bef025b07443 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -59,7 +59,7 @@
59#endif 59#endif
60 60
61 61
62#ifdef CONFIG_VERBOSE_DEBUG 62#ifdef CONFIG_DEBUG_VERBOSE
63#define verbose_printk(fmt, arg...) \ 63#define verbose_printk(fmt, arg...) \
64 printk(fmt, ##arg) 64 printk(fmt, ##arg)
65#else 65#else
@@ -147,9 +147,12 @@ static void decode_address(char *buf, unsigned long address)
147 char *name = p->comm; 147 char *name = p->comm;
148 struct file *file = vma->vm_file; 148 struct file *file = vma->vm_file;
149 149
150 if (file) 150 if (file) {
151 name = d_path(&file->f_path, _tmpbuf, 151 char *d_name = d_path(&file->f_path, _tmpbuf,
152 sizeof(_tmpbuf)); 152 sizeof(_tmpbuf));
153 if (!IS_ERR(d_name))
154 name = d_name;
155 }
153 156
154 /* FLAT does not have its text aligned to the start of 157 /* FLAT does not have its text aligned to the start of
155 * the map while FDPIC ELF does ... 158 * the map while FDPIC ELF does ...
@@ -571,7 +574,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
571#endif 574#endif
572 panic("Kernel exception"); 575 panic("Kernel exception");
573 } else { 576 } else {
574#ifdef CONFIG_VERBOSE_DEBUG 577#ifdef CONFIG_DEBUG_VERBOSE
575 unsigned long *stack; 578 unsigned long *stack;
576 /* Dump the user space stack */ 579 /* Dump the user space stack */
577 stack = (unsigned long *)rdusp(); 580 stack = (unsigned long *)rdusp();
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S
index db532181fbde..a028e9450419 100644
--- a/arch/blackfin/mach-common/cache.S
+++ b/arch/blackfin/mach-common/cache.S
@@ -25,9 +25,13 @@
25 */ 25 */
26.macro do_flush flushins:req optflushins optnopins label 26.macro do_flush flushins:req optflushins optnopins label
27 27
28 R2 = -L1_CACHE_BYTES;
29
30 /* start = (start & -L1_CACHE_BYTES) */
31 R0 = R0 & R2;
32
28 /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */ 33 /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */
29 R1 += -1; 34 R1 += -1;
30 R2 = -L1_CACHE_BYTES;
31 R1 = R1 & R2; 35 R1 = R1 & R2;
32 R1 += L1_CACHE_BYTES; 36 R1 += L1_CACHE_BYTES;
33 37
@@ -63,7 +67,7 @@ ENDPROC(_blackfin_icache_flush_range)
63 67
64/* Flush all cache lines assocoiated with this area of memory. */ 68/* Flush all cache lines assocoiated with this area of memory. */
65ENTRY(_blackfin_icache_dcache_flush_range) 69ENTRY(_blackfin_icache_dcache_flush_range)
66 do_flush IFLUSH, FLUSH 70 do_flush FLUSH, IFLUSH
67ENDPROC(_blackfin_icache_dcache_flush_range) 71ENDPROC(_blackfin_icache_dcache_flush_range)
68 72
69/* Throw away all D-cached data in specified region without any obligation to 73/* Throw away all D-cached data in specified region without any obligation to
diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c
index c22c47b60127..dda5443b37ed 100644
--- a/arch/blackfin/mach-common/cpufreq.c
+++ b/arch/blackfin/mach-common/cpufreq.c
@@ -72,13 +72,13 @@ unsigned int __bfin_cycles_mod;
72 72
73/**************************************************************************/ 73/**************************************************************************/
74 74
75static unsigned int bfin_getfreq(unsigned int cpu) 75static unsigned int bfin_getfreq_khz(unsigned int cpu)
76{ 76{
77 /* The driver only support single cpu */ 77 /* The driver only support single cpu */
78 if (cpu != 0) 78 if (cpu != 0)
79 return -1; 79 return -1;
80 80
81 return get_cclk(); 81 return get_cclk() / 1000;
82} 82}
83 83
84 84
@@ -96,7 +96,7 @@ static int bfin_target(struct cpufreq_policy *policy,
96 96
97 cclk_hz = bfin_freq_table[index].frequency; 97 cclk_hz = bfin_freq_table[index].frequency;
98 98
99 freqs.old = bfin_getfreq(0); 99 freqs.old = bfin_getfreq_khz(0);
100 freqs.new = cclk_hz; 100 freqs.new = cclk_hz;
101 freqs.cpu = 0; 101 freqs.cpu = 0;
102 102
@@ -137,8 +137,8 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy)
137 if (policy->cpu != 0) 137 if (policy->cpu != 0)
138 return -EINVAL; 138 return -EINVAL;
139 139
140 cclk = get_cclk(); 140 cclk = get_cclk() / 1000;
141 sclk = get_sclk(); 141 sclk = get_sclk() / 1000;
142 142
143#if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE)) 143#if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE))
144 min_cclk = sclk * 2; 144 min_cclk = sclk * 2;
@@ -152,7 +152,7 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy)
152 dpm_state_table[index].csel = csel << 4; /* Shift now into PLL_DIV bitpos */ 152 dpm_state_table[index].csel = csel << 4; /* Shift now into PLL_DIV bitpos */
153 dpm_state_table[index].tscale = (TIME_SCALE / (1 << csel)) - 1; 153 dpm_state_table[index].tscale = (TIME_SCALE / (1 << csel)) - 1;
154 154
155 pr_debug("cpufreq: freq:%d csel:%d tscale:%d\n", 155 pr_debug("cpufreq: freq:%d csel:0x%x tscale:%d\n",
156 bfin_freq_table[index].frequency, 156 bfin_freq_table[index].frequency,
157 dpm_state_table[index].csel, 157 dpm_state_table[index].csel,
158 dpm_state_table[index].tscale); 158 dpm_state_table[index].tscale);
@@ -173,7 +173,7 @@ static struct freq_attr *bfin_freq_attr[] = {
173static struct cpufreq_driver bfin_driver = { 173static struct cpufreq_driver bfin_driver = {
174 .verify = bfin_verify_speed, 174 .verify = bfin_verify_speed,
175 .target = bfin_target, 175 .target = bfin_target,
176 .get = bfin_getfreq, 176 .get = bfin_getfreq_khz,
177 .init = __bfin_cpu_init, 177 .init = __bfin_cpu_init,
178 .name = "bfin cpufreq", 178 .name = "bfin cpufreq",
179 .owner = THIS_MODULE, 179 .owner = THIS_MODULE,
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index c13fa8da28c7..bde6dc4e2614 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -277,7 +277,7 @@ ENTRY(_bfin_return_from_exception)
277 p5.h = hi(ILAT); 277 p5.h = hi(ILAT);
278 r6 = [p5]; 278 r6 = [p5];
279 r7 = 0x20; /* Did I just cause anther HW error? */ 279 r7 = 0x20; /* Did I just cause anther HW error? */
280 r7 = r7 & r1; 280 r6 = r7 & r6;
281 CC = R7 == R6; 281 CC = R7 == R6;
282 if CC JUMP _double_fault; 282 if CC JUMP _double_fault;
283#endif 283#endif
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 0f1ca6930c16..cc6f336e7313 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -183,10 +183,10 @@ static void __init l2_sram_init(void)
183 return; 183 return;
184 } 184 }
185 185
186 free_l2_sram_head.next->paddr = (void *)L2_START + 186 free_l2_sram_head.next->paddr =
187 (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); 187 (void *)L2_START + (_ebss_l2 - _stext_l2);
188 free_l2_sram_head.next->size = L2_LENGTH - 188 free_l2_sram_head.next->size =
189 (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); 189 L2_LENGTH - (_ebss_l2 - _stext_l2);
190 free_l2_sram_head.next->pid = 0; 190 free_l2_sram_head.next->pid = 0;
191 free_l2_sram_head.next->next = NULL; 191 free_l2_sram_head.next->next = NULL;
192 192
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 90904f9dfc50..927db3668b6f 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -183,10 +183,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
183 * being 64 bit in both cases. 183 * being 64 bit in both cases.
184 */ 184 */
185 185
186static long translate_usr_offset(long offset) 186static compat_ulong_t translate_usr_offset(compat_ulong_t offset)
187{ 187{
188 if (offset < 0) 188 if (offset < 0)
189 return -1; 189 return sizeof(struct pt_regs);
190 else if (offset <= 32*4) /* gr[0..31] */ 190 else if (offset <= 32*4) /* gr[0..31] */
191 return offset * 2 + 4; 191 return offset * 2 + 4;
192 else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */ 192 else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */
@@ -194,7 +194,7 @@ static long translate_usr_offset(long offset)
194 else if (offset < sizeof(struct pt_regs)/2 + 32*4) 194 else if (offset < sizeof(struct pt_regs)/2 + 32*4)
195 return offset * 2 + 4 - 32*8; 195 return offset * 2 + 4 - 32*8;
196 else 196 else
197 return -1; 197 return sizeof(struct pt_regs);
198} 198}
199 199
200long compat_arch_ptrace(struct task_struct *child, compat_long_t request, 200long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
@@ -209,7 +209,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
209 if (addr & (sizeof(compat_uint_t)-1)) 209 if (addr & (sizeof(compat_uint_t)-1))
210 break; 210 break;
211 addr = translate_usr_offset(addr); 211 addr = translate_usr_offset(addr);
212 if (addr < 0) 212 if (addr >= sizeof(struct pt_regs))
213 break; 213 break;
214 214
215 tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr); 215 tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr);
@@ -236,7 +236,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
236 if (addr & (sizeof(compat_uint_t)-1)) 236 if (addr & (sizeof(compat_uint_t)-1))
237 break; 237 break;
238 addr = translate_usr_offset(addr); 238 addr = translate_usr_offset(addr);
239 if (addr < 0) 239 if (addr >= sizeof(struct pt_regs))
240 break; 240 break;
241 if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { 241 if (addr >= PT_FR0 && addr <= PT_FR31 + 4) {
242 /* Special case, fp regs are 64 bits anyway */ 242 /* Special case, fp regs are 64 bits anyway */
diff --git a/arch/sparc/include/asm/unistd_32.h b/arch/sparc/include/asm/unistd_32.h
index 648643a9f139..0d13d2a4c76f 100644
--- a/arch/sparc/include/asm/unistd_32.h
+++ b/arch/sparc/include/asm/unistd_32.h
@@ -338,8 +338,9 @@
338#define __NR_dup3 320 338#define __NR_dup3 320
339#define __NR_pipe2 321 339#define __NR_pipe2 321
340#define __NR_inotify_init1 322 340#define __NR_inotify_init1 322
341#define __NR_accept4 323
341 342
342#define NR_SYSCALLS 323 343#define NR_SYSCALLS 324
343 344
344/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, 345/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
345 * it never had the plain ones and there is no value to adding those 346 * it never had the plain ones and there is no value to adding those
diff --git a/arch/sparc/include/asm/unistd_64.h b/arch/sparc/include/asm/unistd_64.h
index c5cc0e052321..fa5d3c0343c7 100644
--- a/arch/sparc/include/asm/unistd_64.h
+++ b/arch/sparc/include/asm/unistd_64.h
@@ -340,8 +340,9 @@
340#define __NR_dup3 320 340#define __NR_dup3 320
341#define __NR_pipe2 321 341#define __NR_pipe2 321
342#define __NR_inotify_init1 322 342#define __NR_inotify_init1 322
343#define __NR_accept4 323
343 344
344#define NR_SYSCALLS 323 345#define NR_SYSCALLS 324
345 346
346#ifdef __KERNEL__ 347#ifdef __KERNEL__
347#define __ARCH_WANT_IPC_PARSE_VERSION 348#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index e1b9233b90ab..7d0807586442 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -81,4 +81,4 @@ sys_call_table:
81/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 81/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1 84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index ade18ba0c686..f061c4dda9ef 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -150,7 +150,7 @@ sys32_mmap2:
150sys32_socketcall: /* %o0=call, %o1=args */ 150sys32_socketcall: /* %o0=call, %o1=args */
151 cmp %o0, 1 151 cmp %o0, 1
152 bl,pn %xcc, do_einval 152 bl,pn %xcc, do_einval
153 cmp %o0, 17 153 cmp %o0, 18
154 bg,pn %xcc, do_einval 154 bg,pn %xcc, do_einval
155 sub %o0, 1, %o0 155 sub %o0, 1, %o0
156 sllx %o0, 5, %o0 156 sllx %o0, 5, %o0
@@ -319,6 +319,15 @@ do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int)
319 nop 319 nop
320 nop 320 nop
321 nop 321 nop
322do_sys_accept4: /* sys_accept4(int, struct sockaddr *, int *, int) */
32363: ldswa [%o1 + 0x0] %asi, %o0
324 sethi %hi(sys_accept4), %g1
32564: lduwa [%o1 + 0x8] %asi, %o2
32665: ldswa [%o1 + 0xc] %asi, %o3
327 jmpl %g1 + %lo(sys_accept4), %g0
32866: lduwa [%o1 + 0x4] %asi, %o1
329 nop
330 nop
322 331
323 .section __ex_table,"a" 332 .section __ex_table,"a"
324 .align 4 333 .align 4
@@ -353,4 +362,6 @@ do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int)
353 .word 57b, __retl_efault, 58b, __retl_efault 362 .word 57b, __retl_efault, 58b, __retl_efault
354 .word 59b, __retl_efault, 60b, __retl_efault 363 .word 59b, __retl_efault, 60b, __retl_efault
355 .word 61b, __retl_efault, 62b, __retl_efault 364 .word 61b, __retl_efault, 62b, __retl_efault
365 .word 63b, __retl_efault, 64b, __retl_efault
366 .word 65b, __retl_efault, 66b, __retl_efault
356 .previous 367 .previous
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index b2fa4c163638..9fc78cf354bd 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -82,7 +82,7 @@ sys_call_table32:
82 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait 82 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate 83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate
84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1
85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1 85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4
86 86
87#endif /* CONFIG_COMPAT */ 87#endif /* CONFIG_COMPAT */
88 88
@@ -156,4 +156,4 @@ sys_call_table:
156 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 156 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
157/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 157/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
158 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 158 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
159/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1 159/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index fd2de7019537..ac22bb7719f7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -960,7 +960,7 @@ config ARCH_PHYS_ADDR_T_64BIT
960config NUMA 960config NUMA
961 bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" 961 bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)"
962 depends on SMP 962 depends on SMP
963 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && BROKEN) 963 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL)
964 default n if X86_PC 964 default n if X86_PC
965 default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) 965 default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP)
966 help 966 help
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h
index 485bdf059ffb..07f1af494ca5 100644
--- a/arch/x86/include/asm/mmzone_32.h
+++ b/arch/x86/include/asm/mmzone_32.h
@@ -34,10 +34,14 @@ static inline void get_memcfg_numa(void)
34 34
35extern int early_pfn_to_nid(unsigned long pfn); 35extern int early_pfn_to_nid(unsigned long pfn);
36 36
37extern void resume_map_numa_kva(pgd_t *pgd);
38
37#else /* !CONFIG_NUMA */ 39#else /* !CONFIG_NUMA */
38 40
39#define get_memcfg_numa get_memcfg_numa_flat 41#define get_memcfg_numa get_memcfg_numa_flat
40 42
43static inline void resume_map_numa_kva(pgd_t *pgd) {}
44
41#endif /* CONFIG_NUMA */ 45#endif /* CONFIG_NUMA */
42 46
43#ifdef CONFIG_DISCONTIGMEM 47#ifdef CONFIG_DISCONTIGMEM
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h
index 834b2c1d89fb..d2e415e6666f 100644
--- a/arch/x86/include/asm/unistd_64.h
+++ b/arch/x86/include/asm/unistd_64.h
@@ -639,8 +639,8 @@ __SYSCALL(__NR_fallocate, sys_fallocate)
639__SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) 639__SYSCALL(__NR_timerfd_settime, sys_timerfd_settime)
640#define __NR_timerfd_gettime 287 640#define __NR_timerfd_gettime 287
641__SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) 641__SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime)
642#define __NR_paccept 288 642#define __NR_accept4 288
643__SYSCALL(__NR_paccept, sys_paccept) 643__SYSCALL(__NR_accept4, sys_accept4)
644#define __NR_signalfd4 289 644#define __NR_signalfd4 289
645__SYSCALL(__NR_signalfd4, sys_signalfd4) 645__SYSCALL(__NR_signalfd4, sys_signalfd4)
646#define __NR_eventfd2 290 646#define __NR_eventfd2 290
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 847c164725f4..8518c678d83f 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -222,6 +222,41 @@ static void __init remap_numa_kva(void)
222 } 222 }
223} 223}
224 224
225#ifdef CONFIG_HIBERNATION
226/**
227 * resume_map_numa_kva - add KVA mapping to the temporary page tables created
228 * during resume from hibernation
229 * @pgd_base - temporary resume page directory
230 */
231void resume_map_numa_kva(pgd_t *pgd_base)
232{
233 int node;
234
235 for_each_online_node(node) {
236 unsigned long start_va, start_pfn, size, pfn;
237
238 start_va = (unsigned long)node_remap_start_vaddr[node];
239 start_pfn = node_remap_start_pfn[node];
240 size = node_remap_size[node];
241
242 printk(KERN_DEBUG "%s: node %d\n", __FUNCTION__, node);
243
244 for (pfn = 0; pfn < size; pfn += PTRS_PER_PTE) {
245 unsigned long vaddr = start_va + (pfn << PAGE_SHIFT);
246 pgd_t *pgd = pgd_base + pgd_index(vaddr);
247 pud_t *pud = pud_offset(pgd, vaddr);
248 pmd_t *pmd = pmd_offset(pud, vaddr);
249
250 set_pmd(pmd, pfn_pmd(start_pfn + pfn,
251 PAGE_KERNEL_LARGE_EXEC));
252
253 printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n",
254 __FUNCTION__, vaddr, start_pfn + pfn);
255 }
256 }
257}
258#endif
259
225static unsigned long calculate_numa_remap_pages(void) 260static unsigned long calculate_numa_remap_pages(void)
226{ 261{
227 int nid; 262 int nid;
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index f2b6e3f11bfc..81197c62d5b3 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -12,6 +12,7 @@
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/mmzone.h>
15 16
16/* Defined in hibernate_asm_32.S */ 17/* Defined in hibernate_asm_32.S */
17extern int restore_image(void); 18extern int restore_image(void);
@@ -127,6 +128,9 @@ static int resume_physical_mapping_init(pgd_t *pgd_base)
127 } 128 }
128 } 129 }
129 } 130 }
131
132 resume_map_numa_kva(pgd_base);
133
130 return 0; 134 return 0;
131} 135}
132 136
diff --git a/block/blk-map.c b/block/blk-map.c
index 4849fa36161e..0f4b4b881811 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -217,6 +217,12 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
217 return PTR_ERR(bio); 217 return PTR_ERR(bio);
218 218
219 if (bio->bi_size != len) { 219 if (bio->bi_size != len) {
220 /*
221 * Grab an extra reference to this bio, as bio_unmap_user()
222 * expects to be able to drop it twice as it happens on the
223 * normal IO completion path
224 */
225 bio_get(bio);
220 bio_endio(bio, 0); 226 bio_endio(bio, 0);
221 bio_unmap_user(bio); 227 bio_unmap_user(bio);
222 return -EINVAL; 228 return -EINVAL;
diff --git a/block/genhd.c b/block/genhd.c
index 4e5e7493f676..27549e470da5 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -768,6 +768,8 @@ static int __init genhd_device_init(void)
768 bdev_map = kobj_map_init(base_probe, &block_class_lock); 768 bdev_map = kobj_map_init(base_probe, &block_class_lock);
769 blk_dev_init(); 769 blk_dev_init();
770 770
771 register_blkdev(BLOCK_EXT_MAJOR, "blkext");
772
771#ifndef CONFIG_SYSFS_DEPRECATED 773#ifndef CONFIG_SYSFS_DEPRECATED
772 /* create top-level block dir */ 774 /* create top-level block dir */
773 block_depr = kobject_create_and_add("block", NULL); 775 block_depr = kobject_create_and_add("block", NULL);
diff --git a/block/ioctl.c b/block/ioctl.c
index c832d639b6e2..d03985b04d67 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -18,7 +18,6 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
18 struct disk_part_iter piter; 18 struct disk_part_iter piter;
19 long long start, length; 19 long long start, length;
20 int partno; 20 int partno;
21 int err;
22 21
23 if (!capable(CAP_SYS_ADMIN)) 22 if (!capable(CAP_SYS_ADMIN))
24 return -EACCES; 23 return -EACCES;
@@ -61,10 +60,10 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
61 disk_part_iter_exit(&piter); 60 disk_part_iter_exit(&piter);
62 61
63 /* all seems OK */ 62 /* all seems OK */
64 err = add_partition(disk, partno, start, length, 63 part = add_partition(disk, partno, start, length,
65 ADDPART_FLAG_NONE); 64 ADDPART_FLAG_NONE);
66 mutex_unlock(&bdev->bd_mutex); 65 mutex_unlock(&bdev->bd_mutex);
67 return err; 66 return IS_ERR(part) ? PTR_ERR(part) : 0;
68 case BLKPG_DEL_PARTITION: 67 case BLKPG_DEL_PARTITION:
69 part = disk_get_part(disk, partno); 68 part = disk_get_part(disk, partno);
70 if (!part) 69 if (!part)
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 12de1fdaa6c6..9364dc554257 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -2847,7 +2847,7 @@ static void do_cciss_request(struct request_queue *q)
2847 h->maxSG = seg; 2847 h->maxSG = seg;
2848 2848
2849#ifdef CCISS_DEBUG 2849#ifdef CCISS_DEBUG
2850 printk(KERN_DEBUG "cciss: Submitting %d sectors in %d segments\n", 2850 printk(KERN_DEBUG "cciss: Submitting %lu sectors in %d segments\n",
2851 creq->nr_sectors, seg); 2851 creq->nr_sectors, seg);
2852#endif /* CCISS_DEBUG */ 2852#endif /* CCISS_DEBUG */
2853 2853
@@ -3197,7 +3197,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
3197 3197
3198 c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */ 3198 c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
3199#ifdef CCISS_DEBUG 3199#ifdef CCISS_DEBUG
3200 printk("address 0 = %x\n", c->paddr); 3200 printk("address 0 = %lx\n", c->paddr);
3201#endif /* CCISS_DEBUG */ 3201#endif /* CCISS_DEBUG */
3202 c->vaddr = remap_pci_mem(c->paddr, 0x250); 3202 c->vaddr = remap_pci_mem(c->paddr, 0x250);
3203 3203
@@ -3224,7 +3224,8 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
3224#endif /* CCISS_DEBUG */ 3224#endif /* CCISS_DEBUG */
3225 cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); 3225 cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr);
3226#ifdef CCISS_DEBUG 3226#ifdef CCISS_DEBUG
3227 printk("cfg base address index = %x\n", cfg_base_addr_index); 3227 printk("cfg base address index = %llx\n",
3228 (unsigned long long)cfg_base_addr_index);
3228#endif /* CCISS_DEBUG */ 3229#endif /* CCISS_DEBUG */
3229 if (cfg_base_addr_index == -1) { 3230 if (cfg_base_addr_index == -1) {
3230 printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n"); 3231 printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n");
@@ -3234,7 +3235,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
3234 3235
3235 cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); 3236 cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
3236#ifdef CCISS_DEBUG 3237#ifdef CCISS_DEBUG
3237 printk("cfg offset = %x\n", cfg_offset); 3238 printk("cfg offset = %llx\n", (unsigned long long)cfg_offset);
3238#endif /* CCISS_DEBUG */ 3239#endif /* CCISS_DEBUG */
3239 c->cfgtable = remap_pci_mem(pci_resource_start(pdev, 3240 c->cfgtable = remap_pci_mem(pci_resource_start(pdev,
3240 cfg_base_addr_index) + 3241 cfg_base_addr_index) +
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b220c686089d..2d19f0cc47f2 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -338,12 +338,18 @@ wait:
338static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size) 338static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)
339{ 339{
340 struct request_queue *rq; 340 struct request_queue *rq;
341 elevator_t *old_e;
341 342
342 rq = blk_init_queue(do_blkif_request, &blkif_io_lock); 343 rq = blk_init_queue(do_blkif_request, &blkif_io_lock);
343 if (rq == NULL) 344 if (rq == NULL)
344 return -1; 345 return -1;
345 346
346 elevator_init(rq, "noop"); 347 old_e = rq->elevator;
348 if (IS_ERR_VALUE(elevator_init(rq, "noop")))
349 printk(KERN_WARNING
350 "blkfront: Switch elevator failed, use default\n");
351 else
352 elevator_exit(old_e);
347 353
348 /* Hard sector size and max sectors impersonate the equiv. hardware. */ 354 /* Hard sector size and max sectors impersonate the equiv. hardware. */
349 blk_queue_hardsect_size(rq, sector_size); 355 blk_queue_hardsect_size(rq, sector_size);
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index faa1cc66e9cf..82020abc329e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1134,7 +1134,7 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
1134 continue; 1134 continue;
1135 1135
1136 is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); 1136 is_out = test_bit(FLAG_IS_OUT, &gdesc->flags);
1137 seq_printf(s, " gpio-%-3d (%-12s) %s %s", 1137 seq_printf(s, " gpio-%-3d (%-20.20s) %s %s",
1138 gpio, gdesc->label, 1138 gpio, gdesc->label,
1139 is_out ? "out" : "in ", 1139 is_out ? "out" : "in ",
1140 chip->get 1140 chip->get
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 488e45cd43d7..f7dce8b9f64b 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -128,6 +128,9 @@ static const char* temperature_sensors_sets[][36] = {
128/* Set 13: iMac 8,1 */ 128/* Set 13: iMac 8,1 */
129 { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P", 129 { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P",
130 "TL0P", "TO0P", "TW0P", "Tm0P", "Tp0P", NULL }, 130 "TL0P", "TO0P", "TW0P", "Tm0P", "Tp0P", NULL },
131/* Set 14: iMac 6,1 */
132 { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TG0P", "TH0P",
133 "TO0P", "Tp0P", NULL },
131}; 134};
132 135
133/* List of keys used to read/write fan speeds */ 136/* List of keys used to read/write fan speeds */
@@ -1296,6 +1299,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = {
1296 { .accelerometer = 1, .light = 1, .temperature_set = 12 }, 1299 { .accelerometer = 1, .light = 1, .temperature_set = 12 },
1297/* iMac 8: light sensor only, temperature set 13 */ 1300/* iMac 8: light sensor only, temperature set 13 */
1298 { .accelerometer = 0, .light = 0, .temperature_set = 13 }, 1301 { .accelerometer = 0, .light = 0, .temperature_set = 13 },
1302/* iMac 6: light sensor only, temperature set 14 */
1303 { .accelerometer = 0, .light = 0, .temperature_set = 14 },
1299}; 1304};
1300 1305
1301/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". 1306/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
@@ -1349,10 +1354,18 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
1349 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1354 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
1350 DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, 1355 DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") },
1351 &applesmc_dmi_data[4]}, 1356 &applesmc_dmi_data[4]},
1357 { applesmc_dmi_match, "Apple MacPro", {
1358 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1359 DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
1360 &applesmc_dmi_data[4]},
1352 { applesmc_dmi_match, "Apple iMac 8", { 1361 { applesmc_dmi_match, "Apple iMac 8", {
1353 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 1362 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1354 DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, 1363 DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") },
1355 &applesmc_dmi_data[13]}, 1364 &applesmc_dmi_data[13]},
1365 { applesmc_dmi_match, "Apple iMac 6", {
1366 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1367 DMI_MATCH(DMI_PRODUCT_NAME, "iMac6") },
1368 &applesmc_dmi_data[14]},
1356 { applesmc_dmi_match, "Apple iMac 5", { 1369 { applesmc_dmi_match, "Apple iMac 5", {
1357 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 1370 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1358 DMI_MATCH(DMI_PRODUCT_NAME, "iMac5") }, 1371 DMI_MATCH(DMI_PRODUCT_NAME, "iMac5") },
diff --git a/drivers/misc/sgi-gru/Makefile b/drivers/misc/sgi-gru/Makefile
index d03597a521b0..9e9170b3599a 100644
--- a/drivers/misc/sgi-gru/Makefile
+++ b/drivers/misc/sgi-gru/Makefile
@@ -1,3 +1,7 @@
1ifdef CONFIG_SGI_GRU_DEBUG
2 EXTRA_CFLAGS += -DDEBUG
3endif
4
1obj-$(CONFIG_SGI_GRU) := gru.o 5obj-$(CONFIG_SGI_GRU) := gru.o
2gru-y := grufile.o grumain.o grufault.o grutlbpurge.o gruprocfs.o grukservices.o 6gru-y := grufile.o grumain.o grufault.o grutlbpurge.o gruprocfs.o grukservices.o
3 7
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
index 209b4a464bcf..855f389eea40 100644
--- a/drivers/parport/Kconfig
+++ b/drivers/parport/Kconfig
@@ -36,7 +36,7 @@ if PARPORT
36config PARPORT_PC 36config PARPORT_PC
37 tristate "PC-style hardware" 37 tristate "PC-style hardware"
38 depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \ 38 depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \
39 (!M68K || ISA) && !MN10300 && !AVR32 39 (!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN
40 ---help--- 40 ---help---
41 You should say Y here if you have a PC-style parallel port. All 41 You should say Y here if you have a PC-style parallel port. All
42 IBM PC compatible computers and some Alphas have PC-style 42 IBM PC compatible computers and some Alphas have PC-style
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 21f2ac639cab..28af496b441e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1832,7 +1832,7 @@ int pci_reset_function(struct pci_dev *dev)
1832 if (!(cap & PCI_EXP_DEVCAP_FLR)) 1832 if (!(cap & PCI_EXP_DEVCAP_FLR))
1833 return -ENOTTY; 1833 return -ENOTTY;
1834 1834
1835 if (!dev->msi_enabled && !dev->msix_enabled) 1835 if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0)
1836 disable_irq(dev->irq); 1836 disable_irq(dev->irq);
1837 pci_save_state(dev); 1837 pci_save_state(dev);
1838 1838
@@ -1841,7 +1841,7 @@ int pci_reset_function(struct pci_dev *dev)
1841 r = pci_execute_reset_function(dev); 1841 r = pci_execute_reset_function(dev);
1842 1842
1843 pci_restore_state(dev); 1843 pci_restore_state(dev);
1844 if (!dev->msi_enabled && !dev->msix_enabled) 1844 if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0)
1845 enable_irq(dev->irq); 1845 enable_irq(dev->irq);
1846 1846
1847 return r; 1847 return r;
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index dae87b1a4c6e..cf12f2d84be2 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -352,21 +352,21 @@ static int map_dma_buffers(struct driver_data *drv_data)
352 } else 352 } else
353 drv_data->tx_map_len = drv_data->len; 353 drv_data->tx_map_len = drv_data->len;
354 354
355 /* Stream map the rx buffer */ 355 /* Stream map the tx buffer. Always do DMA_TO_DEVICE first
356 drv_data->rx_dma = dma_map_single(dev, drv_data->rx, 356 * so we flush the cache *before* invalidating it, in case
357 drv_data->rx_map_len, 357 * the tx and rx buffers overlap.
358 DMA_FROM_DEVICE); 358 */
359 if (dma_mapping_error(dev, drv_data->rx_dma))
360 return 0;
361
362 /* Stream map the tx buffer */
363 drv_data->tx_dma = dma_map_single(dev, drv_data->tx, 359 drv_data->tx_dma = dma_map_single(dev, drv_data->tx,
364 drv_data->tx_map_len, 360 drv_data->tx_map_len, DMA_TO_DEVICE);
365 DMA_TO_DEVICE); 361 if (dma_mapping_error(dev, drv_data->tx_dma))
362 return 0;
366 363
367 if (dma_mapping_error(dev, drv_data->tx_dma)) { 364 /* Stream map the rx buffer */
368 dma_unmap_single(dev, drv_data->rx_dma, 365 drv_data->rx_dma = dma_map_single(dev, drv_data->rx,
369 drv_data->rx_map_len, DMA_FROM_DEVICE); 366 drv_data->rx_map_len, DMA_FROM_DEVICE);
367 if (dma_mapping_error(dev, drv_data->rx_dma)) {
368 dma_unmap_single(dev, drv_data->tx_dma,
369 drv_data->tx_map_len, DMA_TO_DEVICE);
370 return 0; 370 return 0;
371 } 371 }
372 372
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 61ba147e384d..0b4db0ce78d6 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -506,20 +506,6 @@ static int map_dma_buffers(struct driver_data *drv_data)
506 if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx)) 506 if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx))
507 return -1; 507 return -1;
508 508
509 /* NULL rx means write-only transfer and no map needed
510 since rx DMA will not be used */
511 if (drv_data->rx) {
512 buf = drv_data->rx;
513 drv_data->rx_dma = dma_map_single(
514 dev,
515 buf,
516 drv_data->len,
517 DMA_FROM_DEVICE);
518 if (dma_mapping_error(dev, drv_data->rx_dma))
519 return -1;
520 drv_data->rx_dma_needs_unmap = 1;
521 }
522
523 if (drv_data->tx == NULL) { 509 if (drv_data->tx == NULL) {
524 /* Read only message --> use drv_data->dummy_dma_buf for dummy 510 /* Read only message --> use drv_data->dummy_dma_buf for dummy
525 writes to achive reads */ 511 writes to achive reads */
@@ -533,18 +519,31 @@ static int map_dma_buffers(struct driver_data *drv_data)
533 buf, 519 buf,
534 drv_data->tx_map_len, 520 drv_data->tx_map_len,
535 DMA_TO_DEVICE); 521 DMA_TO_DEVICE);
536 if (dma_mapping_error(dev, drv_data->tx_dma)) { 522 if (dma_mapping_error(dev, drv_data->tx_dma))
537 if (drv_data->rx_dma) {
538 dma_unmap_single(dev,
539 drv_data->rx_dma,
540 drv_data->len,
541 DMA_FROM_DEVICE);
542 drv_data->rx_dma_needs_unmap = 0;
543 }
544 return -1; 523 return -1;
545 }
546 drv_data->tx_dma_needs_unmap = 1; 524 drv_data->tx_dma_needs_unmap = 1;
547 525
526 /* NULL rx means write-only transfer and no map needed
527 * since rx DMA will not be used */
528 if (drv_data->rx) {
529 buf = drv_data->rx;
530 drv_data->rx_dma = dma_map_single(dev,
531 buf,
532 drv_data->len,
533 DMA_FROM_DEVICE);
534 if (dma_mapping_error(dev, drv_data->rx_dma)) {
535 if (drv_data->tx_dma) {
536 dma_unmap_single(dev,
537 drv_data->tx_dma,
538 drv_data->tx_map_len,
539 DMA_TO_DEVICE);
540 drv_data->tx_dma_needs_unmap = 0;
541 }
542 return -1;
543 }
544 drv_data->rx_dma_needs_unmap = 1;
545 }
546
548 return 0; 547 return 0;
549} 548}
550 549
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index f8d0a57a07cb..9a577a800db5 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -132,7 +132,7 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
132 132
133 bl = backlight_device_register("backlight", &sinfo->pdev->dev, 133 bl = backlight_device_register("backlight", &sinfo->pdev->dev,
134 sinfo, &atmel_lcdc_bl_ops); 134 sinfo, &atmel_lcdc_bl_ops);
135 if (IS_ERR(sinfo->backlight)) { 135 if (IS_ERR(bl)) {
136 dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", 136 dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n",
137 PTR_ERR(bl)); 137 PTR_ERR(bl));
138 return; 138 return;
diff --git a/drivers/video/backlight/da903x.c b/drivers/video/backlight/da903x.c
index 242c38250166..93bb4340cc64 100644
--- a/drivers/video/backlight/da903x.c
+++ b/drivers/video/backlight/da903x.c
@@ -119,6 +119,7 @@ static int da903x_backlight_probe(struct platform_device *pdev)
119 default: 119 default:
120 dev_err(&pdev->dev, "invalid backlight device ID(%d)\n", 120 dev_err(&pdev->dev, "invalid backlight device ID(%d)\n",
121 pdev->id); 121 pdev->id);
122 kfree(data);
122 return -EINVAL; 123 return -EINVAL;
123 } 124 }
124 125
@@ -130,6 +131,7 @@ static int da903x_backlight_probe(struct platform_device *pdev)
130 data, &da903x_backlight_ops); 131 data, &da903x_backlight_ops);
131 if (IS_ERR(bl)) { 132 if (IS_ERR(bl)) {
132 dev_err(&pdev->dev, "failed to register backlight\n"); 133 dev_err(&pdev->dev, "failed to register backlight\n");
134 kfree(data);
133 return PTR_ERR(bl); 135 return PTR_ERR(bl);
134 } 136 }
135 137
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 8e1731d3b228..680e57b616cd 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -42,10 +42,13 @@ static int fb_notifier_callback(struct notifier_block *self,
42 42
43 mutex_lock(&ld->ops_lock); 43 mutex_lock(&ld->ops_lock);
44 if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { 44 if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) {
45 if (event == FB_EVENT_BLANK) 45 if (event == FB_EVENT_BLANK) {
46 ld->ops->set_power(ld, *(int *)evdata->data); 46 if (ld->ops->set_power)
47 else 47 ld->ops->set_power(ld, *(int *)evdata->data);
48 ld->ops->set_mode(ld, evdata->data); 48 } else {
49 if (ld->ops->set_mode)
50 ld->ops->set_mode(ld, evdata->data);
51 }
49 } 52 }
50 mutex_unlock(&ld->ops_lock); 53 mutex_unlock(&ld->ops_lock);
51 return 0; 54 return 0;
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 8a8760230bc7..a2aa6ddffbe2 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -2462,8 +2462,7 @@ static int __init cirrusfb_init(void)
2462 2462
2463#ifndef MODULE 2463#ifndef MODULE
2464static int __init cirrusfb_setup(char *options) { 2464static int __init cirrusfb_setup(char *options) {
2465 char *this_opt, s[32]; 2465 char *this_opt;
2466 int i;
2467 2466
2468 DPRINTK("ENTER\n"); 2467 DPRINTK("ENTER\n");
2469 2468
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 1d5ae39cb271..3c65b0d67617 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -230,7 +230,7 @@ static void fb_set_logo_directpalette(struct fb_info *info,
230 greenshift = info->var.green.offset; 230 greenshift = info->var.green.offset;
231 blueshift = info->var.blue.offset; 231 blueshift = info->var.blue.offset;
232 232
233 for (i = 32; i < logo->clutsize; i++) 233 for (i = 32; i < 32 + logo->clutsize; i++)
234 palette[i] = i << redshift | i << greenshift | i << blueshift; 234 palette[i] = i << redshift | i << greenshift | i << blueshift;
235} 235}
236 236
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
index 2a380011e9ba..7baf2dd12d50 100644
--- a/drivers/video/tmiofb.c
+++ b/drivers/video/tmiofb.c
@@ -222,6 +222,9 @@ static irqreturn_t tmiofb_irq(int irq, void *__info)
222 unsigned int bbisc = tmio_ioread16(par->lcr + LCR_BBISC); 222 unsigned int bbisc = tmio_ioread16(par->lcr + LCR_BBISC);
223 223
224 224
225 tmio_iowrite16(bbisc, par->lcr + LCR_BBISC);
226
227#ifdef CONFIG_FB_TMIO_ACCELL
225 /* 228 /*
226 * We were in polling mode and now we got correct irq. 229 * We were in polling mode and now we got correct irq.
227 * Switch back to IRQ-based sync of command FIFO 230 * Switch back to IRQ-based sync of command FIFO
@@ -231,9 +234,6 @@ static irqreturn_t tmiofb_irq(int irq, void *__info)
231 par->use_polling = false; 234 par->use_polling = false;
232 } 235 }
233 236
234 tmio_iowrite16(bbisc, par->lcr + LCR_BBISC);
235
236#ifdef CONFIG_FB_TMIO_ACCELL
237 if (bbisc & 1) 237 if (bbisc & 1)
238 wake_up(&par->wait_acc); 238 wake_up(&par->wait_acc);
239#endif 239#endif
@@ -938,7 +938,9 @@ static void tmiofb_dump_regs(struct platform_device *dev)
938static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) 938static int tmiofb_suspend(struct platform_device *dev, pm_message_t state)
939{ 939{
940 struct fb_info *info = platform_get_drvdata(dev); 940 struct fb_info *info = platform_get_drvdata(dev);
941#ifdef CONFIG_FB_TMIO_ACCELL
941 struct tmiofb_par *par = info->par; 942 struct tmiofb_par *par = info->par;
943#endif
942 struct mfd_cell *cell = dev->dev.platform_data; 944 struct mfd_cell *cell = dev->dev.platform_data;
943 int retval = 0; 945 int retval = 0;
944 946
@@ -950,12 +952,14 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state)
950 info->fbops->fb_sync(info); 952 info->fbops->fb_sync(info);
951 953
952 954
955#ifdef CONFIG_FB_TMIO_ACCELL
953 /* 956 /*
954 * The fb should be usable even if interrupts are disabled (and they are 957 * The fb should be usable even if interrupts are disabled (and they are
955 * during suspend/resume). Switch temporary to forced polling. 958 * during suspend/resume). Switch temporary to forced polling.
956 */ 959 */
957 printk(KERN_INFO "tmiofb: switching to polling\n"); 960 printk(KERN_INFO "tmiofb: switching to polling\n");
958 par->use_polling = true; 961 par->use_polling = true;
962#endif
959 tmiofb_hw_stop(dev); 963 tmiofb_hw_stop(dev);
960 964
961 if (cell->suspend) 965 if (cell->suspend)
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 0132eae06f55..73ac754ad801 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -2036,30 +2036,30 @@ static int viafb_vt1636_proc_write(struct file *file,
2036 return count; 2036 return count;
2037} 2037}
2038 2038
2039static void viafb_init_proc(struct proc_dir_entry *viafb_entry) 2039static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
2040{ 2040{
2041 struct proc_dir_entry *entry; 2041 struct proc_dir_entry *entry;
2042 viafb_entry = proc_mkdir("viafb", NULL); 2042 *viafb_entry = proc_mkdir("viafb", NULL);
2043 if (viafb_entry) { 2043 if (viafb_entry) {
2044 entry = create_proc_entry("dvp0", 0, viafb_entry); 2044 entry = create_proc_entry("dvp0", 0, *viafb_entry);
2045 if (entry) { 2045 if (entry) {
2046 entry->owner = THIS_MODULE; 2046 entry->owner = THIS_MODULE;
2047 entry->read_proc = viafb_dvp0_proc_read; 2047 entry->read_proc = viafb_dvp0_proc_read;
2048 entry->write_proc = viafb_dvp0_proc_write; 2048 entry->write_proc = viafb_dvp0_proc_write;
2049 } 2049 }
2050 entry = create_proc_entry("dvp1", 0, viafb_entry); 2050 entry = create_proc_entry("dvp1", 0, *viafb_entry);
2051 if (entry) { 2051 if (entry) {
2052 entry->owner = THIS_MODULE; 2052 entry->owner = THIS_MODULE;
2053 entry->read_proc = viafb_dvp1_proc_read; 2053 entry->read_proc = viafb_dvp1_proc_read;
2054 entry->write_proc = viafb_dvp1_proc_write; 2054 entry->write_proc = viafb_dvp1_proc_write;
2055 } 2055 }
2056 entry = create_proc_entry("dfph", 0, viafb_entry); 2056 entry = create_proc_entry("dfph", 0, *viafb_entry);
2057 if (entry) { 2057 if (entry) {
2058 entry->owner = THIS_MODULE; 2058 entry->owner = THIS_MODULE;
2059 entry->read_proc = viafb_dfph_proc_read; 2059 entry->read_proc = viafb_dfph_proc_read;
2060 entry->write_proc = viafb_dfph_proc_write; 2060 entry->write_proc = viafb_dfph_proc_write;
2061 } 2061 }
2062 entry = create_proc_entry("dfpl", 0, viafb_entry); 2062 entry = create_proc_entry("dfpl", 0, *viafb_entry);
2063 if (entry) { 2063 if (entry) {
2064 entry->owner = THIS_MODULE; 2064 entry->owner = THIS_MODULE;
2065 entry->read_proc = viafb_dfpl_proc_read; 2065 entry->read_proc = viafb_dfpl_proc_read;
@@ -2068,7 +2068,7 @@ static void viafb_init_proc(struct proc_dir_entry *viafb_entry)
2068 if (VT1636_LVDS == viaparinfo->chip_info->lvds_chip_info. 2068 if (VT1636_LVDS == viaparinfo->chip_info->lvds_chip_info.
2069 lvds_chip_name || VT1636_LVDS == 2069 lvds_chip_name || VT1636_LVDS ==
2070 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) { 2070 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) {
2071 entry = create_proc_entry("vt1636", 0, viafb_entry); 2071 entry = create_proc_entry("vt1636", 0, *viafb_entry);
2072 if (entry) { 2072 if (entry) {
2073 entry->owner = THIS_MODULE; 2073 entry->owner = THIS_MODULE;
2074 entry->read_proc = viafb_vt1636_proc_read; 2074 entry->read_proc = viafb_vt1636_proc_read;
@@ -2087,6 +2087,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
2087 remove_proc_entry("dfpl", viafb_entry); 2087 remove_proc_entry("dfpl", viafb_entry);
2088 remove_proc_entry("vt1636", viafb_entry); 2088 remove_proc_entry("vt1636", viafb_entry);
2089 remove_proc_entry("vt1625", viafb_entry); 2089 remove_proc_entry("vt1625", viafb_entry);
2090 remove_proc_entry("viafb", NULL);
2090} 2091}
2091 2092
2092static int __devinit via_pci_probe(void) 2093static int __devinit via_pci_probe(void)
@@ -2348,7 +2349,7 @@ static int __devinit via_pci_probe(void)
2348 viafbinfo->node, viafbinfo->fix.id, default_var.xres, 2349 viafbinfo->node, viafbinfo->fix.id, default_var.xres,
2349 default_var.yres, default_var.bits_per_pixel); 2350 default_var.yres, default_var.bits_per_pixel);
2350 2351
2351 viafb_init_proc(viaparinfo->proc_entry); 2352 viafb_init_proc(&viaparinfo->proc_entry);
2352 viafb_init_dac(IGA2); 2353 viafb_init_dac(IGA2);
2353 return 0; 2354 return 0;
2354} 2355}
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 1295625c4825..c973889110c8 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -86,8 +86,8 @@ static struct platform_driver omap_hdq_driver = {
86static u8 omap_w1_read_byte(void *_hdq); 86static u8 omap_w1_read_byte(void *_hdq);
87static void omap_w1_write_byte(void *_hdq, u8 byte); 87static void omap_w1_write_byte(void *_hdq, u8 byte);
88static u8 omap_w1_reset_bus(void *_hdq); 88static u8 omap_w1_reset_bus(void *_hdq);
89static void omap_w1_search_bus(void *_hdq, u8 search_type, 89static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev,
90 w1_slave_found_callback slave_found); 90 u8 search_type, w1_slave_found_callback slave_found);
91 91
92 92
93static struct w1_bus_master omap_w1_master = { 93static struct w1_bus_master omap_w1_master = {
@@ -231,8 +231,8 @@ static u8 omap_w1_reset_bus(void *_hdq)
231} 231}
232 232
233/* W1 search callback function */ 233/* W1 search callback function */
234static void omap_w1_search_bus(void *_hdq, u8 search_type, 234static void omap_w1_search_bus(void *_hdq, struct w1_master *master_dev,
235 w1_slave_found_callback slave_found) 235 u8 search_type, w1_slave_found_callback slave_found)
236{ 236{
237 u64 module_id, rn_le, cs, id; 237 u64 module_id, rn_le, cs, id;
238 238
@@ -249,7 +249,7 @@ static void omap_w1_search_bus(void *_hdq, u8 search_type,
249 cs = w1_calc_crc8((u8 *)&rn_le, 7); 249 cs = w1_calc_crc8((u8 *)&rn_le, 7);
250 id = (cs << 56) | module_id; 250 id = (cs << 56) | module_id;
251 251
252 slave_found(_hdq, id); 252 slave_found(master_dev, id);
253} 253}
254 254
255static int _omap_hdq_reset(struct hdq_data *hdq_data) 255static int _omap_hdq_reset(struct hdq_data *hdq_data)
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index e22bc3961345..0d713b691941 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1037,17 +1037,14 @@ static int
1037decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, 1037decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
1038 struct ecryptfs_crypt_stat *crypt_stat) 1038 struct ecryptfs_crypt_stat *crypt_stat)
1039{ 1039{
1040 struct scatterlist dst_sg; 1040 struct scatterlist dst_sg[2];
1041 struct scatterlist src_sg; 1041 struct scatterlist src_sg[2];
1042 struct mutex *tfm_mutex; 1042 struct mutex *tfm_mutex;
1043 struct blkcipher_desc desc = { 1043 struct blkcipher_desc desc = {
1044 .flags = CRYPTO_TFM_REQ_MAY_SLEEP 1044 .flags = CRYPTO_TFM_REQ_MAY_SLEEP
1045 }; 1045 };
1046 int rc = 0; 1046 int rc = 0;
1047 1047
1048 sg_init_table(&dst_sg, 1);
1049 sg_init_table(&src_sg, 1);
1050
1051 if (unlikely(ecryptfs_verbosity > 0)) { 1048 if (unlikely(ecryptfs_verbosity > 0)) {
1052 ecryptfs_printk( 1049 ecryptfs_printk(
1053 KERN_DEBUG, "Session key encryption key (size [%d]):\n", 1050 KERN_DEBUG, "Session key encryption key (size [%d]):\n",
@@ -1066,8 +1063,8 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
1066 } 1063 }
1067 rc = virt_to_scatterlist(auth_tok->session_key.encrypted_key, 1064 rc = virt_to_scatterlist(auth_tok->session_key.encrypted_key,
1068 auth_tok->session_key.encrypted_key_size, 1065 auth_tok->session_key.encrypted_key_size,
1069 &src_sg, 1); 1066 src_sg, 2);
1070 if (rc != 1) { 1067 if (rc < 1 || rc > 2) {
1071 printk(KERN_ERR "Internal error whilst attempting to convert " 1068 printk(KERN_ERR "Internal error whilst attempting to convert "
1072 "auth_tok->session_key.encrypted_key to scatterlist; " 1069 "auth_tok->session_key.encrypted_key to scatterlist; "
1073 "expected rc = 1; got rc = [%d]. " 1070 "expected rc = 1; got rc = [%d]. "
@@ -1079,8 +1076,8 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
1079 auth_tok->session_key.encrypted_key_size; 1076 auth_tok->session_key.encrypted_key_size;
1080 rc = virt_to_scatterlist(auth_tok->session_key.decrypted_key, 1077 rc = virt_to_scatterlist(auth_tok->session_key.decrypted_key,
1081 auth_tok->session_key.decrypted_key_size, 1078 auth_tok->session_key.decrypted_key_size,
1082 &dst_sg, 1); 1079 dst_sg, 2);
1083 if (rc != 1) { 1080 if (rc < 1 || rc > 2) {
1084 printk(KERN_ERR "Internal error whilst attempting to convert " 1081 printk(KERN_ERR "Internal error whilst attempting to convert "
1085 "auth_tok->session_key.decrypted_key to scatterlist; " 1082 "auth_tok->session_key.decrypted_key to scatterlist; "
1086 "expected rc = 1; got rc = [%d]\n", rc); 1083 "expected rc = 1; got rc = [%d]\n", rc);
@@ -1096,7 +1093,7 @@ decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
1096 rc = -EINVAL; 1093 rc = -EINVAL;
1097 goto out; 1094 goto out;
1098 } 1095 }
1099 rc = crypto_blkcipher_decrypt(&desc, &dst_sg, &src_sg, 1096 rc = crypto_blkcipher_decrypt(&desc, dst_sg, src_sg,
1100 auth_tok->session_key.encrypted_key_size); 1097 auth_tok->session_key.encrypted_key_size);
1101 mutex_unlock(tfm_mutex); 1098 mutex_unlock(tfm_mutex);
1102 if (unlikely(rc)) { 1099 if (unlikely(rc)) {
@@ -1539,8 +1536,8 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes,
1539 size_t i; 1536 size_t i;
1540 size_t encrypted_session_key_valid = 0; 1537 size_t encrypted_session_key_valid = 0;
1541 char session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES]; 1538 char session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES];
1542 struct scatterlist dst_sg; 1539 struct scatterlist dst_sg[2];
1543 struct scatterlist src_sg; 1540 struct scatterlist src_sg[2];
1544 struct mutex *tfm_mutex = NULL; 1541 struct mutex *tfm_mutex = NULL;
1545 u8 cipher_code; 1542 u8 cipher_code;
1546 size_t packet_size_length; 1543 size_t packet_size_length;
@@ -1619,8 +1616,8 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes,
1619 ecryptfs_dump_hex(session_key_encryption_key, 16); 1616 ecryptfs_dump_hex(session_key_encryption_key, 16);
1620 } 1617 }
1621 rc = virt_to_scatterlist(crypt_stat->key, key_rec->enc_key_size, 1618 rc = virt_to_scatterlist(crypt_stat->key, key_rec->enc_key_size,
1622 &src_sg, 1); 1619 src_sg, 2);
1623 if (rc != 1) { 1620 if (rc < 1 || rc > 2) {
1624 ecryptfs_printk(KERN_ERR, "Error generating scatterlist " 1621 ecryptfs_printk(KERN_ERR, "Error generating scatterlist "
1625 "for crypt_stat session key; expected rc = 1; " 1622 "for crypt_stat session key; expected rc = 1; "
1626 "got rc = [%d]. key_rec->enc_key_size = [%d]\n", 1623 "got rc = [%d]. key_rec->enc_key_size = [%d]\n",
@@ -1629,8 +1626,8 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes,
1629 goto out; 1626 goto out;
1630 } 1627 }
1631 rc = virt_to_scatterlist(key_rec->enc_key, key_rec->enc_key_size, 1628 rc = virt_to_scatterlist(key_rec->enc_key, key_rec->enc_key_size,
1632 &dst_sg, 1); 1629 dst_sg, 2);
1633 if (rc != 1) { 1630 if (rc < 1 || rc > 2) {
1634 ecryptfs_printk(KERN_ERR, "Error generating scatterlist " 1631 ecryptfs_printk(KERN_ERR, "Error generating scatterlist "
1635 "for crypt_stat encrypted session key; " 1632 "for crypt_stat encrypted session key; "
1636 "expected rc = 1; got rc = [%d]. " 1633 "expected rc = 1; got rc = [%d]. "
@@ -1651,7 +1648,7 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes,
1651 rc = 0; 1648 rc = 0;
1652 ecryptfs_printk(KERN_DEBUG, "Encrypting [%d] bytes of the key\n", 1649 ecryptfs_printk(KERN_DEBUG, "Encrypting [%d] bytes of the key\n",
1653 crypt_stat->key_size); 1650 crypt_stat->key_size);
1654 rc = crypto_blkcipher_encrypt(&desc, &dst_sg, &src_sg, 1651 rc = crypto_blkcipher_encrypt(&desc, dst_sg, src_sg,
1655 (*key_rec).enc_key_size); 1652 (*key_rec).enc_key_size);
1656 mutex_unlock(tfm_mutex); 1653 mutex_unlock(tfm_mutex);
1657 if (rc) { 1654 if (rc) {
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
index 6ae9011b95eb..2f34f8f2134b 100644
--- a/fs/hostfs/hostfs.h
+++ b/fs/hostfs/hostfs.h
@@ -81,7 +81,7 @@ extern int do_rmdir(const char *file);
81extern int do_mknod(const char *file, int mode, unsigned int major, 81extern int do_mknod(const char *file, int mode, unsigned int major,
82 unsigned int minor); 82 unsigned int minor);
83extern int link_file(const char *from, const char *to); 83extern int link_file(const char *from, const char *to);
84extern int do_readlink(char *file, char *buf, int size); 84extern int hostfs_do_readlink(char *file, char *buf, int size);
85extern int rename_file(char *from, char *to); 85extern int rename_file(char *from, char *to);
86extern int do_statfs(char *root, long *bsize_out, long long *blocks_out, 86extern int do_statfs(char *root, long *bsize_out, long long *blocks_out,
87 long long *bfree_out, long long *bavail_out, 87 long long *bfree_out, long long *bavail_out,
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 7f34f4385de0..3a31451ac170 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -168,7 +168,7 @@ static char *follow_link(char *link)
168 if (name == NULL) 168 if (name == NULL)
169 goto out; 169 goto out;
170 170
171 n = do_readlink(link, name, len); 171 n = hostfs_do_readlink(link, name, len);
172 if (n < len) 172 if (n < len)
173 break; 173 break;
174 len *= 2; 174 len *= 2;
@@ -943,7 +943,7 @@ int hostfs_link_readpage(struct file *file, struct page *page)
943 name = inode_name(page->mapping->host, 0); 943 name = inode_name(page->mapping->host, 0);
944 if (name == NULL) 944 if (name == NULL)
945 return -ENOMEM; 945 return -ENOMEM;
946 err = do_readlink(name, buffer, PAGE_CACHE_SIZE); 946 err = hostfs_do_readlink(name, buffer, PAGE_CACHE_SIZE);
947 kfree(name); 947 kfree(name);
948 if (err == PAGE_CACHE_SIZE) 948 if (err == PAGE_CACHE_SIZE)
949 err = -E2BIG; 949 err = -E2BIG;
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c
index 53fd0a67c11a..b79424f93282 100644
--- a/fs/hostfs/hostfs_user.c
+++ b/fs/hostfs/hostfs_user.c
@@ -377,7 +377,7 @@ int link_file(const char *to, const char *from)
377 return 0; 377 return 0;
378} 378}
379 379
380int do_readlink(char *file, char *buf, int size) 380int hostfs_do_readlink(char *file, char *buf, int size)
381{ 381{
382 int n; 382 int n;
383 383
diff --git a/fs/namei.c b/fs/namei.c
index 09ce58e49e72..d34e0f9681c6 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1378,7 +1378,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
1378 if (IS_APPEND(dir)) 1378 if (IS_APPEND(dir))
1379 return -EPERM; 1379 return -EPERM;
1380 if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)|| 1380 if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)||
1381 IS_IMMUTABLE(victim->d_inode)) 1381 IS_IMMUTABLE(victim->d_inode) || IS_SWAPFILE(victim->d_inode))
1382 return -EPERM; 1382 return -EPERM;
1383 if (isdir) { 1383 if (isdir) {
1384 if (!S_ISDIR(victim->d_inode->i_mode)) 1384 if (!S_ISDIR(victim->d_inode->i_mode))
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 633f7a0ebb2c..6d5b213b8a9b 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -348,8 +348,8 @@ static ssize_t whole_disk_show(struct device *dev,
348static DEVICE_ATTR(whole_disk, S_IRUSR | S_IRGRP | S_IROTH, 348static DEVICE_ATTR(whole_disk, S_IRUSR | S_IRGRP | S_IROTH,
349 whole_disk_show, NULL); 349 whole_disk_show, NULL);
350 350
351int add_partition(struct gendisk *disk, int partno, 351struct hd_struct *add_partition(struct gendisk *disk, int partno,
352 sector_t start, sector_t len, int flags) 352 sector_t start, sector_t len, int flags)
353{ 353{
354 struct hd_struct *p; 354 struct hd_struct *p;
355 dev_t devt = MKDEV(0, 0); 355 dev_t devt = MKDEV(0, 0);
@@ -361,15 +361,15 @@ int add_partition(struct gendisk *disk, int partno,
361 361
362 err = disk_expand_part_tbl(disk, partno); 362 err = disk_expand_part_tbl(disk, partno);
363 if (err) 363 if (err)
364 return err; 364 return ERR_PTR(err);
365 ptbl = disk->part_tbl; 365 ptbl = disk->part_tbl;
366 366
367 if (ptbl->part[partno]) 367 if (ptbl->part[partno])
368 return -EBUSY; 368 return ERR_PTR(-EBUSY);
369 369
370 p = kzalloc(sizeof(*p), GFP_KERNEL); 370 p = kzalloc(sizeof(*p), GFP_KERNEL);
371 if (!p) 371 if (!p)
372 return -ENOMEM; 372 return ERR_PTR(-EBUSY);
373 373
374 if (!init_part_stats(p)) { 374 if (!init_part_stats(p)) {
375 err = -ENOMEM; 375 err = -ENOMEM;
@@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk, int partno,
395 395
396 err = blk_alloc_devt(p, &devt); 396 err = blk_alloc_devt(p, &devt);
397 if (err) 397 if (err)
398 goto out_free; 398 goto out_free_stats;
399 pdev->devt = devt; 399 pdev->devt = devt;
400 400
401 /* delay uevent until 'holders' subdir is created */ 401 /* delay uevent until 'holders' subdir is created */
@@ -424,18 +424,20 @@ int add_partition(struct gendisk *disk, int partno,
424 if (!ddev->uevent_suppress) 424 if (!ddev->uevent_suppress)
425 kobject_uevent(&pdev->kobj, KOBJ_ADD); 425 kobject_uevent(&pdev->kobj, KOBJ_ADD);
426 426
427 return 0; 427 return p;
428 428
429out_free_stats:
430 free_part_stats(p);
429out_free: 431out_free:
430 kfree(p); 432 kfree(p);
431 return err; 433 return ERR_PTR(err);
432out_del: 434out_del:
433 kobject_put(p->holder_dir); 435 kobject_put(p->holder_dir);
434 device_del(pdev); 436 device_del(pdev);
435out_put: 437out_put:
436 put_device(pdev); 438 put_device(pdev);
437 blk_free_devt(devt); 439 blk_free_devt(devt);
438 return err; 440 return ERR_PTR(err);
439} 441}
440 442
441/* Not exported, helper to add_disk(). */ 443/* Not exported, helper to add_disk(). */
@@ -566,15 +568,16 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
566 disk->disk_name, p, (unsigned long long) size); 568 disk->disk_name, p, (unsigned long long) size);
567 size = get_capacity(disk) - from; 569 size = get_capacity(disk) - from;
568 } 570 }
569 res = add_partition(disk, p, from, size, state->parts[p].flags); 571 part = add_partition(disk, p, from, size,
570 if (res) { 572 state->parts[p].flags);
571 printk(KERN_ERR " %s: p%d could not be added: %d\n", 573 if (IS_ERR(part)) {
572 disk->disk_name, p, -res); 574 printk(KERN_ERR " %s: p%d could not be added: %ld\n",
575 disk->disk_name, p, -PTR_ERR(part));
573 continue; 576 continue;
574 } 577 }
575#ifdef CONFIG_BLK_DEV_MD 578#ifdef CONFIG_BLK_DEV_MD
576 if (state->parts[p].flags & ADDPART_FLAG_RAID) 579 if (state->parts[p].flags & ADDPART_FLAG_RAID)
577 md_autodetect_dev(bdev->bd_dev+p); 580 md_autodetect_dev(part_to_dev(part)->devt);
578#endif 581#endif
579 } 582 }
580 kfree(state); 583 kfree(state);
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 2691926fb506..8e540d32c9fe 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -74,8 +74,6 @@ static inline int cpuset_do_slab_mem_spread(void)
74 return current->flags & PF_SPREAD_SLAB; 74 return current->flags & PF_SPREAD_SLAB;
75} 75}
76 76
77extern void cpuset_track_online_nodes(void);
78
79extern int current_cpuset_is_being_rebound(void); 77extern int current_cpuset_is_being_rebound(void);
80 78
81extern void rebuild_sched_domains(void); 79extern void rebuild_sched_domains(void);
@@ -151,8 +149,6 @@ static inline int cpuset_do_slab_mem_spread(void)
151 return 0; 149 return 0;
152} 150}
153 151
154static inline void cpuset_track_online_nodes(void) {}
155
156static inline int current_cpuset_is_being_rebound(void) 152static inline int current_cpuset_is_being_rebound(void)
157{ 153{
158 return 0; 154 return 0;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index e439e6aed832..3df7742ce246 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -522,7 +522,9 @@ extern char *disk_name (struct gendisk *hd, int partno, char *buf);
522 522
523extern int disk_expand_part_tbl(struct gendisk *disk, int target); 523extern int disk_expand_part_tbl(struct gendisk *disk, int target);
524extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); 524extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
525extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); 525extern struct hd_struct * __must_check add_partition(struct gendisk *disk,
526 int partno, sector_t start,
527 sector_t len, int flags);
526extern void delete_partition(struct gendisk *, int); 528extern void delete_partition(struct gendisk *, int);
527extern void printk_all_partitions(void); 529extern void printk_all_partitions(void);
528 530
diff --git a/include/linux/net.h b/include/linux/net.h
index 6dc14a240042..4515efae4c39 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -40,7 +40,7 @@
40#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ 40#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */ 41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */ 42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
43#define SYS_PACCEPT 18 /* sys_paccept(2) */ 43#define SYS_ACCEPT4 18 /* sys_accept4(2) */
44 44
45typedef enum { 45typedef enum {
46 SS_FREE = 0, /* not allocated */ 46 SS_FREE = 0, /* not allocated */
@@ -100,7 +100,7 @@ enum sock_type {
100 * remaining bits are used as flags. */ 100 * remaining bits are used as flags. */
101#define SOCK_TYPE_MASK 0xf 101#define SOCK_TYPE_MASK 0xf
102 102
103/* Flags for socket, socketpair, paccept */ 103/* Flags for socket, socketpair, accept4 */
104#define SOCK_CLOEXEC O_CLOEXEC 104#define SOCK_CLOEXEC O_CLOEXEC
105#ifndef SOCK_NONBLOCK 105#ifndef SOCK_NONBLOCK
106#define SOCK_NONBLOCK O_NONBLOCK 106#define SOCK_NONBLOCK O_NONBLOCK
@@ -223,8 +223,6 @@ extern int sock_map_fd(struct socket *sock, int flags);
223extern struct socket *sockfd_lookup(int fd, int *err); 223extern struct socket *sockfd_lookup(int fd, int *err);
224#define sockfd_put(sock) fput(sock->file) 224#define sockfd_put(sock) fput(sock->file)
225extern int net_ratelimit(void); 225extern int net_ratelimit(void);
226extern long do_accept(int fd, struct sockaddr __user *upeer_sockaddr,
227 int __user *upeer_addrlen, int flags);
228 226
229#define net_random() random32() 227#define net_random() random32()
230#define net_srandom(seed) srandom32((__force u32)seed) 228#define net_srandom(seed) srandom32((__force u32)seed)
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 536b0ca46a03..e097c2e6b6dc 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -120,6 +120,9 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
120u64 ring_buffer_time_stamp(int cpu); 120u64 ring_buffer_time_stamp(int cpu);
121void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); 121void ring_buffer_normalize_time_stamp(int cpu, u64 *ts);
122 122
123void tracing_on(void);
124void tracing_off(void);
125
123enum ring_buffer_flags { 126enum ring_buffer_flags {
124 RB_FL_OVERWRITE = 1 << 0, 127 RB_FL_OVERWRITE = 1 << 0,
125}; 128};
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d6ff145919ca..04fb47bfb920 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -410,8 +410,7 @@ asmlinkage long sys_getsockopt(int fd, int level, int optname,
410asmlinkage long sys_bind(int, struct sockaddr __user *, int); 410asmlinkage long sys_bind(int, struct sockaddr __user *, int);
411asmlinkage long sys_connect(int, struct sockaddr __user *, int); 411asmlinkage long sys_connect(int, struct sockaddr __user *, int);
412asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *); 412asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *);
413asmlinkage long sys_paccept(int, struct sockaddr __user *, int __user *, 413asmlinkage long sys_accept4(int, struct sockaddr __user *, int __user *, int);
414 const __user sigset_t *, size_t, int);
415asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); 414asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *);
416asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); 415asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *);
417asmlinkage long sys_send(int, void __user *, size_t, unsigned); 416asmlinkage long sys_send(int, void __user *, size_t, unsigned);
diff --git a/init/Kconfig b/init/Kconfig
index 226da2733c1e..f763762d544a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -354,7 +354,7 @@ config RT_GROUP_SCHED
354 setting below. If enabled, it will also make it impossible to 354 setting below. If enabled, it will also make it impossible to
355 schedule realtime tasks for non-root users until you allocate 355 schedule realtime tasks for non-root users until you allocate
356 realtime bandwidth for them. 356 realtime bandwidth for them.
357 See Documentation/sched-rt-group.txt for more information. 357 See Documentation/scheduler/sched-rt-group.txt for more information.
358 358
359choice 359choice
360 depends on GROUP_SCHED 360 depends on GROUP_SCHED
diff --git a/ipc/util.c b/ipc/util.c
index 49b3ea615dc5..361fd1c96fcf 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -266,9 +266,17 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
266 if (ids->in_use >= size) 266 if (ids->in_use >= size)
267 return -ENOSPC; 267 return -ENOSPC;
268 268
269 spin_lock_init(&new->lock);
270 new->deleted = 0;
271 rcu_read_lock();
272 spin_lock(&new->lock);
273
269 err = idr_get_new(&ids->ipcs_idr, new, &id); 274 err = idr_get_new(&ids->ipcs_idr, new, &id);
270 if (err) 275 if (err) {
276 spin_unlock(&new->lock);
277 rcu_read_unlock();
271 return err; 278 return err;
279 }
272 280
273 ids->in_use++; 281 ids->in_use++;
274 282
@@ -280,10 +288,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
280 ids->seq = 0; 288 ids->seq = 0;
281 289
282 new->id = ipc_buildid(id, new->seq); 290 new->id = ipc_buildid(id, new->seq);
283 spin_lock_init(&new->lock);
284 new->deleted = 0;
285 rcu_read_lock();
286 spin_lock(&new->lock);
287 return id; 291 return id;
288} 292}
289 293
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e77564e6f..fe00b3b983a8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2039,10 +2039,13 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
2039 struct cgroup *cgrp; 2039 struct cgroup *cgrp;
2040 struct cgroup_iter it; 2040 struct cgroup_iter it;
2041 struct task_struct *tsk; 2041 struct task_struct *tsk;
2042
2042 /* 2043 /*
2043 * Validate dentry by checking the superblock operations 2044 * Validate dentry by checking the superblock operations,
2045 * and make sure it's a directory.
2044 */ 2046 */
2045 if (dentry->d_sb->s_op != &cgroup_ops) 2047 if (dentry->d_sb->s_op != &cgroup_ops ||
2048 !S_ISDIR(dentry->d_inode->i_mode))
2046 goto err; 2049 goto err;
2047 2050
2048 ret = 0; 2051 ret = 0;
@@ -2472,10 +2475,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
2472 mutex_unlock(&cgroup_mutex); 2475 mutex_unlock(&cgroup_mutex);
2473 return -EBUSY; 2476 return -EBUSY;
2474 } 2477 }
2475 2478 mutex_unlock(&cgroup_mutex);
2476 parent = cgrp->parent;
2477 root = cgrp->root;
2478 sb = root->sb;
2479 2479
2480 /* 2480 /*
2481 * Call pre_destroy handlers of subsys. Notify subsystems 2481 * Call pre_destroy handlers of subsys. Notify subsystems
@@ -2483,7 +2483,14 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
2483 */ 2483 */
2484 cgroup_call_pre_destroy(cgrp); 2484 cgroup_call_pre_destroy(cgrp);
2485 2485
2486 if (cgroup_has_css_refs(cgrp)) { 2486 mutex_lock(&cgroup_mutex);
2487 parent = cgrp->parent;
2488 root = cgrp->root;
2489 sb = root->sb;
2490
2491 if (atomic_read(&cgrp->count)
2492 || !list_empty(&cgrp->children)
2493 || cgroup_has_css_refs(cgrp)) {
2487 mutex_unlock(&cgroup_mutex); 2494 mutex_unlock(&cgroup_mutex);
2488 return -EBUSY; 2495 return -EBUSY;
2489 } 2496 }
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3e00526f52ec..da7ff6137f37 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -36,6 +36,7 @@
36#include <linux/list.h> 36#include <linux/list.h>
37#include <linux/mempolicy.h> 37#include <linux/mempolicy.h>
38#include <linux/mm.h> 38#include <linux/mm.h>
39#include <linux/memory.h>
39#include <linux/module.h> 40#include <linux/module.h>
40#include <linux/mount.h> 41#include <linux/mount.h>
41#include <linux/namei.h> 42#include <linux/namei.h>
@@ -587,7 +588,6 @@ static int generate_sched_domains(cpumask_t **domains,
587 int ndoms; /* number of sched domains in result */ 588 int ndoms; /* number of sched domains in result */
588 int nslot; /* next empty doms[] cpumask_t slot */ 589 int nslot; /* next empty doms[] cpumask_t slot */
589 590
590 ndoms = 0;
591 doms = NULL; 591 doms = NULL;
592 dattr = NULL; 592 dattr = NULL;
593 csa = NULL; 593 csa = NULL;
@@ -674,10 +674,8 @@ restart:
674 * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. 674 * Convert <csn, csa> to <ndoms, doms> and populate cpu masks.
675 */ 675 */
676 doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL); 676 doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL);
677 if (!doms) { 677 if (!doms)
678 ndoms = 0;
679 goto done; 678 goto done;
680 }
681 679
682 /* 680 /*
683 * The rest of the code, including the scheduler, can deal with 681 * The rest of the code, including the scheduler, can deal with
@@ -732,6 +730,13 @@ restart:
732done: 730done:
733 kfree(csa); 731 kfree(csa);
734 732
733 /*
734 * Fallback to the default domain if kmalloc() failed.
735 * See comments in partition_sched_domains().
736 */
737 if (doms == NULL)
738 ndoms = 1;
739
735 *domains = doms; 740 *domains = doms;
736 *attributes = dattr; 741 *attributes = dattr;
737 return ndoms; 742 return ndoms;
@@ -2011,12 +2016,23 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb,
2011 * Call this routine anytime after node_states[N_HIGH_MEMORY] changes. 2016 * Call this routine anytime after node_states[N_HIGH_MEMORY] changes.
2012 * See also the previous routine cpuset_track_online_cpus(). 2017 * See also the previous routine cpuset_track_online_cpus().
2013 */ 2018 */
2014void cpuset_track_online_nodes(void) 2019static int cpuset_track_online_nodes(struct notifier_block *self,
2020 unsigned long action, void *arg)
2015{ 2021{
2016 cgroup_lock(); 2022 cgroup_lock();
2017 top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; 2023 switch (action) {
2018 scan_for_empty_cpusets(&top_cpuset); 2024 case MEM_ONLINE:
2025 top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
2026 break;
2027 case MEM_OFFLINE:
2028 top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
2029 scan_for_empty_cpusets(&top_cpuset);
2030 break;
2031 default:
2032 break;
2033 }
2019 cgroup_unlock(); 2034 cgroup_unlock();
2035 return NOTIFY_OK;
2020} 2036}
2021#endif 2037#endif
2022 2038
@@ -2032,6 +2048,7 @@ void __init cpuset_init_smp(void)
2032 top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; 2048 top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
2033 2049
2034 hotcpu_notifier(cpuset_track_online_cpus, 0); 2050 hotcpu_notifier(cpuset_track_online_cpus, 0);
2051 hotplug_memory_notifier(cpuset_track_online_nodes, 10);
2035} 2052}
2036 2053
2037/** 2054/**
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 5072cf1685a2..7b8b0f21a5b1 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -304,17 +304,24 @@ int sprint_symbol(char *buffer, unsigned long address)
304 char *modname; 304 char *modname;
305 const char *name; 305 const char *name;
306 unsigned long offset, size; 306 unsigned long offset, size;
307 char namebuf[KSYM_NAME_LEN]; 307 int len;
308 308
309 name = kallsyms_lookup(address, &size, &offset, &modname, namebuf); 309 name = kallsyms_lookup(address, &size, &offset, &modname, buffer);
310 if (!name) 310 if (!name)
311 return sprintf(buffer, "0x%lx", address); 311 return sprintf(buffer, "0x%lx", address);
312 312
313 if (name != buffer)
314 strcpy(buffer, name);
315 len = strlen(buffer);
316 buffer += len;
317
313 if (modname) 318 if (modname)
314 return sprintf(buffer, "%s+%#lx/%#lx [%s]", name, offset, 319 len += sprintf(buffer, "+%#lx/%#lx [%s]",
315 size, modname); 320 offset, size, modname);
316 else 321 else
317 return sprintf(buffer, "%s+%#lx/%#lx", name, offset, size); 322 len += sprintf(buffer, "+%#lx/%#lx", offset, size);
323
324 return len;
318} 325}
319 326
320/* Look up a kernel symbol and print it to the kernel messages. */ 327/* Look up a kernel symbol and print it to the kernel messages. */
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 153dcb2639c3..895337b16a24 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -1308,9 +1308,10 @@ static inline int task_cputime_expired(const struct task_cputime *sample,
1308 */ 1308 */
1309static inline int fastpath_timer_check(struct task_struct *tsk) 1309static inline int fastpath_timer_check(struct task_struct *tsk)
1310{ 1310{
1311 struct signal_struct *sig = tsk->signal; 1311 struct signal_struct *sig;
1312 1312
1313 if (unlikely(!sig)) 1313 /* tsk == current, ensure it is safe to use ->signal/sighand */
1314 if (unlikely(tsk->exit_state))
1314 return 0; 1315 return 0;
1315 1316
1316 if (!task_cputime_zero(&tsk->cputime_expires)) { 1317 if (!task_cputime_zero(&tsk->cputime_expires)) {
@@ -1323,6 +1324,8 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
1323 if (task_cputime_expired(&task_sample, &tsk->cputime_expires)) 1324 if (task_cputime_expired(&task_sample, &tsk->cputime_expires))
1324 return 1; 1325 return 1;
1325 } 1326 }
1327
1328 sig = tsk->signal;
1326 if (!task_cputime_zero(&sig->cputime_expires)) { 1329 if (!task_cputime_zero(&sig->cputime_expires)) {
1327 struct task_cputime group_sample; 1330 struct task_cputime group_sample;
1328 1331
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 19122cf6d827..b8f7ce9473e8 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -174,7 +174,7 @@ static void suspend_test_finish(const char *label)
174 * has some performance issues. The stack dump of a WARN_ON 174 * has some performance issues. The stack dump of a WARN_ON
175 * is more likely to get the right attention than a printk... 175 * is more likely to get the right attention than a printk...
176 */ 176 */
177 WARN_ON(msec > (TEST_SUSPEND_SECONDS * 1000)); 177 WARN(msec > (TEST_SUSPEND_SECONDS * 1000), "Component: %s\n", label);
178} 178}
179 179
180#else 180#else
diff --git a/kernel/profile.c b/kernel/profile.c
index 9830a037d8db..5b7d1ac7124c 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -544,7 +544,7 @@ static const struct file_operations proc_profile_operations = {
544}; 544};
545 545
546#ifdef CONFIG_SMP 546#ifdef CONFIG_SMP
547static void __init profile_nop(void *unused) 547static inline void profile_nop(void *unused)
548{ 548{
549} 549}
550 550
diff --git a/kernel/relay.c b/kernel/relay.c
index 8d13a7855c08..32b0befdcb6a 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -400,7 +400,7 @@ void relay_reset(struct rchan *chan)
400 } 400 }
401 401
402 mutex_lock(&relay_channels_mutex); 402 mutex_lock(&relay_channels_mutex);
403 for_each_online_cpu(i) 403 for_each_possible_cpu(i)
404 if (chan->buf[i]) 404 if (chan->buf[i])
405 __relay_reset(chan->buf[i], 0); 405 __relay_reset(chan->buf[i], 0);
406 mutex_unlock(&relay_channels_mutex); 406 mutex_unlock(&relay_channels_mutex);
@@ -611,10 +611,9 @@ struct rchan *relay_open(const char *base_filename,
611 return chan; 611 return chan;
612 612
613free_bufs: 613free_bufs:
614 for_each_online_cpu(i) { 614 for_each_possible_cpu(i) {
615 if (!chan->buf[i]) 615 if (chan->buf[i])
616 break; 616 relay_close_buf(chan->buf[i]);
617 relay_close_buf(chan->buf[i]);
618 } 617 }
619 618
620 kref_put(&chan->kref, relay_destroy_channel); 619 kref_put(&chan->kref, relay_destroy_channel);
diff --git a/kernel/sched.c b/kernel/sched.c
index c94baf2969e7..9b1e79371c20 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7789,13 +7789,14 @@ static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur,
7789 * 7789 *
7790 * The passed in 'doms_new' should be kmalloc'd. This routine takes 7790 * The passed in 'doms_new' should be kmalloc'd. This routine takes
7791 * ownership of it and will kfree it when done with it. If the caller 7791 * ownership of it and will kfree it when done with it. If the caller
7792 * failed the kmalloc call, then it can pass in doms_new == NULL, 7792 * failed the kmalloc call, then it can pass in doms_new == NULL &&
7793 * and partition_sched_domains() will fallback to the single partition 7793 * ndoms_new == 1, and partition_sched_domains() will fallback to
7794 * 'fallback_doms', it also forces the domains to be rebuilt. 7794 * the single partition 'fallback_doms', it also forces the domains
7795 * to be rebuilt.
7795 * 7796 *
7796 * If doms_new==NULL it will be replaced with cpu_online_map. 7797 * If doms_new == NULL it will be replaced with cpu_online_map.
7797 * ndoms_new==0 is a special case for destroying existing domains. 7798 * ndoms_new == 0 is a special case for destroying existing domains,
7798 * It will not create the default domain. 7799 * and it will not create the default domain.
7799 * 7800 *
7800 * Call with hotplug lock held 7801 * Call with hotplug lock held
7801 */ 7802 */
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 48ecc51e7701..26ed8e3d1c15 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -423,10 +423,11 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
423#undef __P 423#undef __P
424 424
425 { 425 {
426 unsigned int this_cpu = raw_smp_processor_id();
426 u64 t0, t1; 427 u64 t0, t1;
427 428
428 t0 = sched_clock(); 429 t0 = cpu_clock(this_cpu);
429 t1 = sched_clock(); 430 t1 = cpu_clock(this_cpu);
430 SEQ_printf(m, "%-35s:%21Ld\n", 431 SEQ_printf(m, "%-35s:%21Ld\n",
431 "clock-delta", (long long)(t1-t0)); 432 "clock-delta", (long long)(t1-t0));
432 } 433 }
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
index ee71bec1da66..7dbf72a2b02c 100644
--- a/kernel/sched_stats.h
+++ b/kernel/sched_stats.h
@@ -298,9 +298,11 @@ static inline void account_group_user_time(struct task_struct *tsk,
298{ 298{
299 struct signal_struct *sig; 299 struct signal_struct *sig;
300 300
301 sig = tsk->signal; 301 /* tsk == current, ensure it is safe to use ->signal */
302 if (unlikely(!sig)) 302 if (unlikely(tsk->exit_state))
303 return; 303 return;
304
305 sig = tsk->signal;
304 if (sig->cputime.totals) { 306 if (sig->cputime.totals) {
305 struct task_cputime *times; 307 struct task_cputime *times;
306 308
@@ -325,9 +327,11 @@ static inline void account_group_system_time(struct task_struct *tsk,
325{ 327{
326 struct signal_struct *sig; 328 struct signal_struct *sig;
327 329
328 sig = tsk->signal; 330 /* tsk == current, ensure it is safe to use ->signal */
329 if (unlikely(!sig)) 331 if (unlikely(tsk->exit_state))
330 return; 332 return;
333
334 sig = tsk->signal;
331 if (sig->cputime.totals) { 335 if (sig->cputime.totals) {
332 struct task_cputime *times; 336 struct task_cputime *times;
333 337
@@ -353,8 +357,11 @@ static inline void account_group_exec_runtime(struct task_struct *tsk,
353 struct signal_struct *sig; 357 struct signal_struct *sig;
354 358
355 sig = tsk->signal; 359 sig = tsk->signal;
360 /* see __exit_signal()->task_rq_unlock_wait() */
361 barrier();
356 if (unlikely(!sig)) 362 if (unlikely(!sig))
357 return; 363 return;
364
358 if (sig->cputime.totals) { 365 if (sig->cputime.totals) {
359 struct task_cputime *times; 366 struct task_cputime *times;
360 367
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index a77b27b11b04..e14a23281707 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -31,7 +31,7 @@ cond_syscall(sys_socketpair);
31cond_syscall(sys_bind); 31cond_syscall(sys_bind);
32cond_syscall(sys_listen); 32cond_syscall(sys_listen);
33cond_syscall(sys_accept); 33cond_syscall(sys_accept);
34cond_syscall(sys_paccept); 34cond_syscall(sys_accept4);
35cond_syscall(sys_connect); 35cond_syscall(sys_connect);
36cond_syscall(sys_getsockname); 36cond_syscall(sys_getsockname);
37cond_syscall(sys_getpeername); 37cond_syscall(sys_getpeername);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 4a39d24568c8..e60205722d0c 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -185,7 +185,6 @@ enum {
185}; 185};
186 186
187static int ftrace_filtered; 187static int ftrace_filtered;
188static int tracing_on;
189 188
190static LIST_HEAD(ftrace_new_addrs); 189static LIST_HEAD(ftrace_new_addrs);
191 190
@@ -506,13 +505,10 @@ static int __ftrace_modify_code(void *data)
506{ 505{
507 int *command = data; 506 int *command = data;
508 507
509 if (*command & FTRACE_ENABLE_CALLS) { 508 if (*command & FTRACE_ENABLE_CALLS)
510 ftrace_replace_code(1); 509 ftrace_replace_code(1);
511 tracing_on = 1; 510 else if (*command & FTRACE_DISABLE_CALLS)
512 } else if (*command & FTRACE_DISABLE_CALLS) {
513 ftrace_replace_code(0); 511 ftrace_replace_code(0);
514 tracing_on = 0;
515 }
516 512
517 if (*command & FTRACE_UPDATE_TRACE_FUNC) 513 if (*command & FTRACE_UPDATE_TRACE_FUNC)
518 ftrace_update_ftrace_func(ftrace_trace_function); 514 ftrace_update_ftrace_func(ftrace_trace_function);
@@ -677,7 +673,7 @@ static int __init ftrace_dyn_table_alloc(unsigned long num_to_init)
677 673
678 cnt = num_to_init / ENTRIES_PER_PAGE; 674 cnt = num_to_init / ENTRIES_PER_PAGE;
679 pr_info("ftrace: allocating %ld entries in %d pages\n", 675 pr_info("ftrace: allocating %ld entries in %d pages\n",
680 num_to_init, cnt); 676 num_to_init, cnt + 1);
681 677
682 for (i = 0; i < cnt; i++) { 678 for (i = 0; i < cnt; i++) {
683 pg->next = (void *)get_zeroed_page(GFP_KERNEL); 679 pg->next = (void *)get_zeroed_page(GFP_KERNEL);
@@ -757,13 +753,11 @@ static void *t_start(struct seq_file *m, loff_t *pos)
757 void *p = NULL; 753 void *p = NULL;
758 loff_t l = -1; 754 loff_t l = -1;
759 755
760 if (*pos != iter->pos) { 756 if (*pos > iter->pos)
761 for (p = t_next(m, p, &l); p && l < *pos; p = t_next(m, p, &l)) 757 *pos = iter->pos;
762 ; 758
763 } else { 759 l = *pos;
764 l = *pos; 760 p = t_next(m, p, &l);
765 p = t_next(m, p, &l);
766 }
767 761
768 return p; 762 return p;
769} 763}
@@ -774,15 +768,21 @@ static void t_stop(struct seq_file *m, void *p)
774 768
775static int t_show(struct seq_file *m, void *v) 769static int t_show(struct seq_file *m, void *v)
776{ 770{
771 struct ftrace_iterator *iter = m->private;
777 struct dyn_ftrace *rec = v; 772 struct dyn_ftrace *rec = v;
778 char str[KSYM_SYMBOL_LEN]; 773 char str[KSYM_SYMBOL_LEN];
774 int ret = 0;
779 775
780 if (!rec) 776 if (!rec)
781 return 0; 777 return 0;
782 778
783 kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); 779 kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
784 780
785 seq_printf(m, "%s\n", str); 781 ret = seq_printf(m, "%s\n", str);
782 if (ret < 0) {
783 iter->pos--;
784 iter->idx--;
785 }
786 786
787 return 0; 787 return 0;
788} 788}
@@ -808,7 +808,7 @@ ftrace_avail_open(struct inode *inode, struct file *file)
808 return -ENOMEM; 808 return -ENOMEM;
809 809
810 iter->pg = ftrace_pages_start; 810 iter->pg = ftrace_pages_start;
811 iter->pos = -1; 811 iter->pos = 0;
812 812
813 ret = seq_open(file, &show_ftrace_seq_ops); 813 ret = seq_open(file, &show_ftrace_seq_ops);
814 if (!ret) { 814 if (!ret) {
@@ -895,7 +895,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
895 895
896 if (file->f_mode & FMODE_READ) { 896 if (file->f_mode & FMODE_READ) {
897 iter->pg = ftrace_pages_start; 897 iter->pg = ftrace_pages_start;
898 iter->pos = -1; 898 iter->pos = 0;
899 iter->flags = enable ? FTRACE_ITER_FILTER : 899 iter->flags = enable ? FTRACE_ITER_FILTER :
900 FTRACE_ITER_NOTRACE; 900 FTRACE_ITER_NOTRACE;
901 901
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 2f76193c3489..036456cbb4f7 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -16,14 +16,49 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18 18
19#include "trace.h"
20
21/* Global flag to disable all recording to ring buffers */
22static int ring_buffers_off __read_mostly;
23
24/**
25 * tracing_on - enable all tracing buffers
26 *
27 * This function enables all tracing buffers that may have been
28 * disabled with tracing_off.
29 */
30void tracing_on(void)
31{
32 ring_buffers_off = 0;
33}
34
35/**
36 * tracing_off - turn off all tracing buffers
37 *
38 * This function stops all tracing buffers from recording data.
39 * It does not disable any overhead the tracers themselves may
40 * be causing. This function simply causes all recording to
41 * the ring buffers to fail.
42 */
43void tracing_off(void)
44{
45 ring_buffers_off = 1;
46}
47
19/* Up this if you want to test the TIME_EXTENTS and normalization */ 48/* Up this if you want to test the TIME_EXTENTS and normalization */
20#define DEBUG_SHIFT 0 49#define DEBUG_SHIFT 0
21 50
22/* FIXME!!! */ 51/* FIXME!!! */
23u64 ring_buffer_time_stamp(int cpu) 52u64 ring_buffer_time_stamp(int cpu)
24{ 53{
54 u64 time;
55
56 preempt_disable_notrace();
25 /* shift to debug/test normalization and TIME_EXTENTS */ 57 /* shift to debug/test normalization and TIME_EXTENTS */
26 return sched_clock() << DEBUG_SHIFT; 58 time = sched_clock() << DEBUG_SHIFT;
59 preempt_enable_notrace();
60
61 return time;
27} 62}
28 63
29void ring_buffer_normalize_time_stamp(int cpu, u64 *ts) 64void ring_buffer_normalize_time_stamp(int cpu, u64 *ts)
@@ -503,6 +538,12 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size)
503 LIST_HEAD(pages); 538 LIST_HEAD(pages);
504 int i, cpu; 539 int i, cpu;
505 540
541 /*
542 * Always succeed at resizing a non-existent buffer:
543 */
544 if (!buffer)
545 return size;
546
506 size = DIV_ROUND_UP(size, BUF_PAGE_SIZE); 547 size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
507 size *= BUF_PAGE_SIZE; 548 size *= BUF_PAGE_SIZE;
508 buffer_size = buffer->pages * BUF_PAGE_SIZE; 549 buffer_size = buffer->pages * BUF_PAGE_SIZE;
@@ -1133,6 +1174,9 @@ ring_buffer_lock_reserve(struct ring_buffer *buffer,
1133 struct ring_buffer_event *event; 1174 struct ring_buffer_event *event;
1134 int cpu, resched; 1175 int cpu, resched;
1135 1176
1177 if (ring_buffers_off)
1178 return NULL;
1179
1136 if (atomic_read(&buffer->record_disabled)) 1180 if (atomic_read(&buffer->record_disabled))
1137 return NULL; 1181 return NULL;
1138 1182
@@ -1249,6 +1293,9 @@ int ring_buffer_write(struct ring_buffer *buffer,
1249 int ret = -EBUSY; 1293 int ret = -EBUSY;
1250 int cpu, resched; 1294 int cpu, resched;
1251 1295
1296 if (ring_buffers_off)
1297 return -EBUSY;
1298
1252 if (atomic_read(&buffer->record_disabled)) 1299 if (atomic_read(&buffer->record_disabled))
1253 return -EBUSY; 1300 return -EBUSY;
1254 1301
@@ -2070,3 +2117,69 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
2070 return 0; 2117 return 0;
2071} 2118}
2072 2119
2120static ssize_t
2121rb_simple_read(struct file *filp, char __user *ubuf,
2122 size_t cnt, loff_t *ppos)
2123{
2124 int *p = filp->private_data;
2125 char buf[64];
2126 int r;
2127
2128 /* !ring_buffers_off == tracing_on */
2129 r = sprintf(buf, "%d\n", !*p);
2130
2131 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
2132}
2133
2134static ssize_t
2135rb_simple_write(struct file *filp, const char __user *ubuf,
2136 size_t cnt, loff_t *ppos)
2137{
2138 int *p = filp->private_data;
2139 char buf[64];
2140 long val;
2141 int ret;
2142
2143 if (cnt >= sizeof(buf))
2144 return -EINVAL;
2145
2146 if (copy_from_user(&buf, ubuf, cnt))
2147 return -EFAULT;
2148
2149 buf[cnt] = 0;
2150
2151 ret = strict_strtoul(buf, 10, &val);
2152 if (ret < 0)
2153 return ret;
2154
2155 /* !ring_buffers_off == tracing_on */
2156 *p = !val;
2157
2158 (*ppos)++;
2159
2160 return cnt;
2161}
2162
2163static struct file_operations rb_simple_fops = {
2164 .open = tracing_open_generic,
2165 .read = rb_simple_read,
2166 .write = rb_simple_write,
2167};
2168
2169
2170static __init int rb_init_debugfs(void)
2171{
2172 struct dentry *d_tracer;
2173 struct dentry *entry;
2174
2175 d_tracer = tracing_init_dentry();
2176
2177 entry = debugfs_create_file("tracing_on", 0644, d_tracer,
2178 &ring_buffers_off, &rb_simple_fops);
2179 if (!entry)
2180 pr_warning("Could not create debugfs 'tracing_on' entry\n");
2181
2182 return 0;
2183}
2184
2185fs_initcall(rb_init_debugfs);
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 8d2688ff1352..b7b449dafbe5 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -395,7 +395,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
395 WARN_ON(!irqs_disabled()); 395 WARN_ON(!irqs_disabled());
396 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ); 396 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
397 } else 397 } else
398 kunmap(miter->addr); 398 kunmap(miter->page);
399 399
400 miter->page = NULL; 400 miter->page = NULL;
401 miter->addr = NULL; 401 miter->addr = NULL;
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 78330c37a61b..5f6c629a924d 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -467,9 +467,13 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
467 dma_addr_t dev_addr; 467 dma_addr_t dev_addr;
468 void *ret; 468 void *ret;
469 int order = get_order(size); 469 int order = get_order(size);
470 u64 dma_mask = DMA_32BIT_MASK;
471
472 if (hwdev && hwdev->coherent_dma_mask)
473 dma_mask = hwdev->coherent_dma_mask;
470 474
471 ret = (void *)__get_free_pages(flags, order); 475 ret = (void *)__get_free_pages(flags, order);
472 if (ret && address_needs_mapping(hwdev, virt_to_bus(ret), size)) { 476 if (ret && !is_buffer_dma_capable(dma_mask, virt_to_bus(ret), size)) {
473 /* 477 /*
474 * The allocated memory isn't reachable by the device. 478 * The allocated memory isn't reachable by the device.
475 * Fall back on swiotlb_map_single(). 479 * Fall back on swiotlb_map_single().
@@ -493,9 +497,9 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
493 dev_addr = virt_to_bus(ret); 497 dev_addr = virt_to_bus(ret);
494 498
495 /* Confirm address can be DMA'd by device */ 499 /* Confirm address can be DMA'd by device */
496 if (address_needs_mapping(hwdev, dev_addr, size)) { 500 if (!is_buffer_dma_capable(dma_mask, dev_addr, size)) {
497 printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", 501 printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n",
498 (unsigned long long)*hwdev->dma_mask, 502 (unsigned long long)dma_mask,
499 (unsigned long long)dev_addr); 503 (unsigned long long)dev_addr);
500 504
501 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ 505 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6837a1014372..b5b2b15085a8 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -22,7 +22,6 @@
22#include <linux/highmem.h> 22#include <linux/highmem.h>
23#include <linux/vmalloc.h> 23#include <linux/vmalloc.h>
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/cpuset.h>
26#include <linux/delay.h> 25#include <linux/delay.h>
27#include <linux/migrate.h> 26#include <linux/migrate.h>
28#include <linux/page-isolation.h> 27#include <linux/page-isolation.h>
@@ -498,8 +497,6 @@ int add_memory(int nid, u64 start, u64 size)
498 /* we online node here. we can't roll back from here. */ 497 /* we online node here. we can't roll back from here. */
499 node_set_online(nid); 498 node_set_online(nid);
500 499
501 cpuset_track_online_nodes();
502
503 if (new_pgdat) { 500 if (new_pgdat) {
504 ret = register_one_node(nid); 501 ret = register_one_node(nid);
505 /* 502 /*
diff --git a/mm/migrate.c b/mm/migrate.c
index 385db89f0c33..1e0d6b237f44 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -522,15 +522,12 @@ static int writeout(struct address_space *mapping, struct page *page)
522 remove_migration_ptes(page, page); 522 remove_migration_ptes(page, page);
523 523
524 rc = mapping->a_ops->writepage(page, &wbc); 524 rc = mapping->a_ops->writepage(page, &wbc);
525 if (rc < 0)
526 /* I/O Error writing */
527 return -EIO;
528 525
529 if (rc != AOP_WRITEPAGE_ACTIVATE) 526 if (rc != AOP_WRITEPAGE_ACTIVATE)
530 /* unlocked. Relock */ 527 /* unlocked. Relock */
531 lock_page(page); 528 lock_page(page);
532 529
533 return -EAGAIN; 530 return (rc < 0) ? -EIO : -EAGAIN;
534} 531}
535 532
536/* 533/*
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ba6b0f5f7fac..30f826d484f0 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -324,14 +324,14 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
324 324
325 BUG_ON(size & ~PAGE_MASK); 325 BUG_ON(size & ~PAGE_MASK);
326 326
327 addr = ALIGN(vstart, align);
328
329 va = kmalloc_node(sizeof(struct vmap_area), 327 va = kmalloc_node(sizeof(struct vmap_area),
330 gfp_mask & GFP_RECLAIM_MASK, node); 328 gfp_mask & GFP_RECLAIM_MASK, node);
331 if (unlikely(!va)) 329 if (unlikely(!va))
332 return ERR_PTR(-ENOMEM); 330 return ERR_PTR(-ENOMEM);
333 331
334retry: 332retry:
333 addr = ALIGN(vstart, align);
334
335 spin_lock(&vmap_area_lock); 335 spin_lock(&vmap_area_lock);
336 /* XXX: could have a last_hole cache */ 336 /* XXX: could have a last_hole cache */
337 n = vmap_area_root.rb_node; 337 n = vmap_area_root.rb_node;
@@ -362,7 +362,7 @@ retry:
362 goto found; 362 goto found;
363 } 363 }
364 364
365 while (addr + size >= first->va_start && addr + size <= vend) { 365 while (addr + size > first->va_start && addr + size <= vend) {
366 addr = ALIGN(first->va_end + PAGE_SIZE, align); 366 addr = ALIGN(first->va_end + PAGE_SIZE, align);
367 367
368 n = rb_next(&first->rb_node); 368 n = rb_next(&first->rb_node);
@@ -522,13 +522,24 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
522} 522}
523 523
524/* 524/*
525 * Kick off a purge of the outstanding lazy areas. Don't bother if somebody
526 * is already purging.
527 */
528static void try_purge_vmap_area_lazy(void)
529{
530 unsigned long start = ULONG_MAX, end = 0;
531
532 __purge_vmap_area_lazy(&start, &end, 0, 0);
533}
534
535/*
525 * Kick off a purge of the outstanding lazy areas. 536 * Kick off a purge of the outstanding lazy areas.
526 */ 537 */
527static void purge_vmap_area_lazy(void) 538static void purge_vmap_area_lazy(void)
528{ 539{
529 unsigned long start = ULONG_MAX, end = 0; 540 unsigned long start = ULONG_MAX, end = 0;
530 541
531 __purge_vmap_area_lazy(&start, &end, 0, 0); 542 __purge_vmap_area_lazy(&start, &end, 1, 0);
532} 543}
533 544
534/* 545/*
@@ -539,7 +550,7 @@ static void free_unmap_vmap_area(struct vmap_area *va)
539 va->flags |= VM_LAZY_FREE; 550 va->flags |= VM_LAZY_FREE;
540 atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr); 551 atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr);
541 if (unlikely(atomic_read(&vmap_lazy_nr) > lazy_max_pages())) 552 if (unlikely(atomic_read(&vmap_lazy_nr) > lazy_max_pages()))
542 purge_vmap_area_lazy(); 553 try_purge_vmap_area_lazy();
543} 554}
544 555
545static struct vmap_area *find_vmap_area(unsigned long addr) 556static struct vmap_area *find_vmap_area(unsigned long addr)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c141b3e78071..7ea1440b53db 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -623,6 +623,8 @@ static unsigned long shrink_page_list(struct list_head *page_list,
623 * Try to allocate it some swap space here. 623 * Try to allocate it some swap space here.
624 */ 624 */
625 if (PageAnon(page) && !PageSwapCache(page)) { 625 if (PageAnon(page) && !PageSwapCache(page)) {
626 if (!(sc->gfp_mask & __GFP_IO))
627 goto keep_locked;
626 switch (try_to_munlock(page)) { 628 switch (try_to_munlock(page)) {
627 case SWAP_FAIL: /* shouldn't happen */ 629 case SWAP_FAIL: /* shouldn't happen */
628 case SWAP_AGAIN: 630 case SWAP_AGAIN:
@@ -634,6 +636,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
634 } 636 }
635 if (!add_to_swap(page, GFP_ATOMIC)) 637 if (!add_to_swap(page, GFP_ATOMIC))
636 goto activate_locked; 638 goto activate_locked;
639 may_enter_fs = 1;
637 } 640 }
638#endif /* CONFIG_SWAP */ 641#endif /* CONFIG_SWAP */
639 642
@@ -1386,9 +1389,9 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc,
1386 file_prio = 200 - sc->swappiness; 1389 file_prio = 200 - sc->swappiness;
1387 1390
1388 /* 1391 /*
1389 * anon recent_rotated[0] 1392 * The amount of pressure on anon vs file pages is inversely
1390 * %anon = 100 * ----------- / ----------------- * IO cost 1393 * proportional to the fraction of recently scanned pages on
1391 * anon + file rotate_sum 1394 * each list that were recently referenced and in active use.
1392 */ 1395 */
1393 ap = (anon_prio + 1) * (zone->recent_scanned[0] + 1); 1396 ap = (anon_prio + 1) * (zone->recent_scanned[0] + 1);
1394 ap /= zone->recent_rotated[0] + 1; 1397 ap /= zone->recent_rotated[0] + 1;
diff --git a/net/compat.c b/net/compat.c
index 6ce1a1cadcc0..a3a2ba0fac08 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -725,7 +725,7 @@ EXPORT_SYMBOL(compat_mc_getsockopt);
725static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), 725static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
726 AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), 726 AL(3),AL(3),AL(4),AL(4),AL(4),AL(6),
727 AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), 727 AL(6),AL(2),AL(5),AL(5),AL(3),AL(3),
728 AL(6)}; 728 AL(4)};
729#undef AL 729#undef AL
730 730
731asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags) 731asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags)
@@ -738,52 +738,13 @@ asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, uns
738 return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); 738 return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
739} 739}
740 740
741asmlinkage long compat_sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr,
742 int __user *upeer_addrlen,
743 const compat_sigset_t __user *sigmask,
744 compat_size_t sigsetsize, int flags)
745{
746 compat_sigset_t ss32;
747 sigset_t ksigmask, sigsaved;
748 int ret;
749
750 if (sigmask) {
751 if (sigsetsize != sizeof(compat_sigset_t))
752 return -EINVAL;
753 if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
754 return -EFAULT;
755 sigset_from_compat(&ksigmask, &ss32);
756
757 sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP));
758 sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
759 }
760
761 ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags);
762
763 if (ret == -ERESTARTNOHAND) {
764 /*
765 * Don't restore the signal mask yet. Let do_signal() deliver
766 * the signal on the way back to userspace, before the signal
767 * mask is restored.
768 */
769 if (sigmask) {
770 memcpy(&current->saved_sigmask, &sigsaved,
771 sizeof(sigsaved));
772 set_restore_sigmask();
773 }
774 } else if (sigmask)
775 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
776
777 return ret;
778}
779
780asmlinkage long compat_sys_socketcall(int call, u32 __user *args) 741asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
781{ 742{
782 int ret; 743 int ret;
783 u32 a[6]; 744 u32 a[6];
784 u32 a0, a1; 745 u32 a0, a1;
785 746
786 if (call < SYS_SOCKET || call > SYS_PACCEPT) 747 if (call < SYS_SOCKET || call > SYS_ACCEPT4)
787 return -EINVAL; 748 return -EINVAL;
788 if (copy_from_user(a, args, nas[call])) 749 if (copy_from_user(a, args, nas[call]))
789 return -EFAULT; 750 return -EFAULT;
@@ -804,7 +765,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
804 ret = sys_listen(a0, a1); 765 ret = sys_listen(a0, a1);
805 break; 766 break;
806 case SYS_ACCEPT: 767 case SYS_ACCEPT:
807 ret = do_accept(a0, compat_ptr(a1), compat_ptr(a[2]), 0); 768 ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), 0);
808 break; 769 break;
809 case SYS_GETSOCKNAME: 770 case SYS_GETSOCKNAME:
810 ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); 771 ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2]));
@@ -844,9 +805,8 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
844 case SYS_RECVMSG: 805 case SYS_RECVMSG:
845 ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]); 806 ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]);
846 break; 807 break;
847 case SYS_PACCEPT: 808 case SYS_ACCEPT4:
848 ret = compat_sys_paccept(a0, compat_ptr(a1), compat_ptr(a[2]), 809 ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), a[3]);
849 compat_ptr(a[3]), a[4], a[5]);
850 break; 810 break;
851 default: 811 default:
852 ret = -EINVAL; 812 ret = -EINVAL;
diff --git a/net/socket.c b/net/socket.c
index 57550c3bcabe..92764d836891 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1426,8 +1426,8 @@ asmlinkage long sys_listen(int fd, int backlog)
1426 * clean when we restucture accept also. 1426 * clean when we restucture accept also.
1427 */ 1427 */
1428 1428
1429long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, 1429asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
1430 int __user *upeer_addrlen, int flags) 1430 int __user *upeer_addrlen, int flags)
1431{ 1431{
1432 struct socket *sock, *newsock; 1432 struct socket *sock, *newsock;
1433 struct file *newfile; 1433 struct file *newfile;
@@ -1510,66 +1510,10 @@ out_fd:
1510 goto out_put; 1510 goto out_put;
1511} 1511}
1512 1512
1513#if 0
1514#ifdef HAVE_SET_RESTORE_SIGMASK
1515asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr,
1516 int __user *upeer_addrlen,
1517 const sigset_t __user *sigmask,
1518 size_t sigsetsize, int flags)
1519{
1520 sigset_t ksigmask, sigsaved;
1521 int ret;
1522
1523 if (sigmask) {
1524 /* XXX: Don't preclude handling different sized sigset_t's. */
1525 if (sigsetsize != sizeof(sigset_t))
1526 return -EINVAL;
1527 if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask)))
1528 return -EFAULT;
1529
1530 sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP));
1531 sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
1532 }
1533
1534 ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags);
1535
1536 if (ret < 0 && signal_pending(current)) {
1537 /*
1538 * Don't restore the signal mask yet. Let do_signal() deliver
1539 * the signal on the way back to userspace, before the signal
1540 * mask is restored.
1541 */
1542 if (sigmask) {
1543 memcpy(&current->saved_sigmask, &sigsaved,
1544 sizeof(sigsaved));
1545 set_restore_sigmask();
1546 }
1547 } else if (sigmask)
1548 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
1549
1550 return ret;
1551}
1552#else
1553asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr,
1554 int __user *upeer_addrlen,
1555 const sigset_t __user *sigmask,
1556 size_t sigsetsize, int flags)
1557{
1558 /* The platform does not support restoring the signal mask in the
1559 * return path. So we do not allow using paccept() with a signal
1560 * mask. */
1561 if (sigmask)
1562 return -EINVAL;
1563
1564 return do_accept(fd, upeer_sockaddr, upeer_addrlen, flags);
1565}
1566#endif
1567#endif
1568
1569asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, 1513asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr,
1570 int __user *upeer_addrlen) 1514 int __user *upeer_addrlen)
1571{ 1515{
1572 return do_accept(fd, upeer_sockaddr, upeer_addrlen, 0); 1516 return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0);
1573} 1517}
1574 1518
1575/* 1519/*
@@ -2096,7 +2040,7 @@ static const unsigned char nargs[19]={
2096 AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), 2040 AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
2097 AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), 2041 AL(3),AL(3),AL(4),AL(4),AL(4),AL(6),
2098 AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), 2042 AL(6),AL(2),AL(5),AL(5),AL(3),AL(3),
2099 AL(6) 2043 AL(4)
2100}; 2044};
2101 2045
2102#undef AL 2046#undef AL
@@ -2115,7 +2059,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args)
2115 unsigned long a0, a1; 2059 unsigned long a0, a1;
2116 int err; 2060 int err;
2117 2061
2118 if (call < 1 || call > SYS_PACCEPT) 2062 if (call < 1 || call > SYS_ACCEPT4)
2119 return -EINVAL; 2063 return -EINVAL;
2120 2064
2121 /* copy_from_user should be SMP safe. */ 2065 /* copy_from_user should be SMP safe. */
@@ -2143,9 +2087,8 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args)
2143 err = sys_listen(a0, a1); 2087 err = sys_listen(a0, a1);
2144 break; 2088 break;
2145 case SYS_ACCEPT: 2089 case SYS_ACCEPT:
2146 err = 2090 err = sys_accept4(a0, (struct sockaddr __user *)a1,
2147 do_accept(a0, (struct sockaddr __user *)a1, 2091 (int __user *)a[2], 0);
2148 (int __user *)a[2], 0);
2149 break; 2092 break;
2150 case SYS_GETSOCKNAME: 2093 case SYS_GETSOCKNAME:
2151 err = 2094 err =
@@ -2192,12 +2135,9 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args)
2192 case SYS_RECVMSG: 2135 case SYS_RECVMSG:
2193 err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); 2136 err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]);
2194 break; 2137 break;
2195 case SYS_PACCEPT: 2138 case SYS_ACCEPT4:
2196 err = 2139 err = sys_accept4(a0, (struct sockaddr __user *)a1,
2197 sys_paccept(a0, (struct sockaddr __user *)a1, 2140 (int __user *)a[2], a[3]);
2198 (int __user *)a[2],
2199 (const sigset_t __user *) a[3],
2200 a[4], a[5]);
2201 break; 2141 break;
2202 default: 2142 default:
2203 err = -EINVAL; 2143 err = -EINVAL;
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 9b77b3e0fa98..3ecd7e797dee 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work)
37 container_of(work, struct hda_beep, beep_work); 37 container_of(work, struct hda_beep, beep_work);
38 struct hda_codec *codec = beep->codec; 38 struct hda_codec *codec = beep->codec;
39 39
40 if (!beep->enabled)
41 return;
42
40 /* generate tone */ 43 /* generate tone */
41 snd_hda_codec_write_cache(codec, beep->nid, 0, 44 snd_hda_codec_write_cache(codec, beep->nid, 0,
42 AC_VERB_SET_BEEP_CONTROL, beep->tone); 45 AC_VERB_SET_BEEP_CONTROL, beep->tone);
@@ -85,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
85 snprintf(beep->phys, sizeof(beep->phys), 88 snprintf(beep->phys, sizeof(beep->phys),
86 "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); 89 "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
87 input_dev = input_allocate_device(); 90 input_dev = input_allocate_device();
91 if (!input_dev) {
92 kfree(beep);
93 return -ENOMEM;
94 }
88 95
89 /* setup digital beep device */ 96 /* setup digital beep device */
90 input_dev->name = "HDA Digital PCBeep"; 97 input_dev->name = "HDA Digital PCBeep";
@@ -115,6 +122,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
115 beep->nid = nid; 122 beep->nid = nid;
116 beep->dev = input_dev; 123 beep->dev = input_dev;
117 beep->codec = codec; 124 beep->codec = codec;
125 beep->enabled = 1;
118 codec->beep = beep; 126 codec->beep = beep;
119 127
120 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); 128 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index de4036e6e710..b9679f081cae 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -31,6 +31,7 @@ struct hda_beep {
31 char phys[32]; 31 char phys[32];
32 int tone; 32 int tone;
33 int nid; 33 int nid;
34 int enabled;
34 struct work_struct beep_work; /* scheduled task for beep event */ 35 struct work_struct beep_work; /* scheduled task for beep event */
35}; 36};
36 37
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 4300a679cd86..9563b5bbb272 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -36,9 +36,11 @@
36#include "hda_beep.h" 36#include "hda_beep.h"
37 37
38#define NUM_CONTROL_ALLOC 32 38#define NUM_CONTROL_ALLOC 32
39
40#define STAC_VREF_EVENT 0x00
41#define STAC_INSERT_EVENT 0x10
39#define STAC_PWR_EVENT 0x20 42#define STAC_PWR_EVENT 0x20
40#define STAC_HP_EVENT 0x30 43#define STAC_HP_EVENT 0x30
41#define STAC_VREF_EVENT 0x40
42 44
43enum { 45enum {
44 STAC_REF, 46 STAC_REF,
@@ -1686,6 +1688,10 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1686 /* SigmaTel reference board */ 1688 /* SigmaTel reference board */
1687 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1689 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1688 "DFI LanParty", STAC_92HD71BXX_REF), 1690 "DFI LanParty", STAC_92HD71BXX_REF),
1691 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2,
1692 "HP dv5", STAC_HP_M4),
1693 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
1694 "HP dv7", STAC_HP_M4),
1689 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, 1695 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1690 "unknown HP", STAC_HP_M4), 1696 "unknown HP", STAC_HP_M4),
1691 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1697 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -2587,8 +2593,10 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
2587}; 2593};
2588 2594
2589/* add dynamic controls */ 2595/* add dynamic controls */
2590static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type, 2596static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
2591 int idx, const char *name, unsigned long val) 2597 struct snd_kcontrol_new *ktemp,
2598 int idx, const char *name,
2599 unsigned long val)
2592{ 2600{
2593 struct snd_kcontrol_new *knew; 2601 struct snd_kcontrol_new *knew;
2594 2602
@@ -2607,20 +2615,29 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
2607 } 2615 }
2608 2616
2609 knew = &spec->kctl_alloc[spec->num_kctl_used]; 2617 knew = &spec->kctl_alloc[spec->num_kctl_used];
2610 *knew = stac92xx_control_templates[type]; 2618 *knew = *ktemp;
2611 knew->index = idx; 2619 knew->index = idx;
2612 knew->name = kstrdup(name, GFP_KERNEL); 2620 knew->name = kstrdup(name, GFP_KERNEL);
2613 if (! knew->name) 2621 if (!knew->name)
2614 return -ENOMEM; 2622 return -ENOMEM;
2615 knew->private_value = val; 2623 knew->private_value = val;
2616 spec->num_kctl_used++; 2624 spec->num_kctl_used++;
2617 return 0; 2625 return 0;
2618} 2626}
2619 2627
2628static inline int stac92xx_add_control_idx(struct sigmatel_spec *spec,
2629 int type, int idx, const char *name,
2630 unsigned long val)
2631{
2632 return stac92xx_add_control_temp(spec,
2633 &stac92xx_control_templates[type],
2634 idx, name, val);
2635}
2636
2620 2637
2621/* add dynamic controls */ 2638/* add dynamic controls */
2622static int stac92xx_add_control(struct sigmatel_spec *spec, int type, 2639static inline int stac92xx_add_control(struct sigmatel_spec *spec, int type,
2623 const char *name, unsigned long val) 2640 const char *name, unsigned long val)
2624{ 2641{
2625 return stac92xx_add_control_idx(spec, type, 0, name, val); 2642 return stac92xx_add_control_idx(spec, type, 0, name, val);
2626} 2643}
@@ -3062,6 +3079,43 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
3062 return 0; 3079 return 0;
3063} 3080}
3064 3081
3082#ifdef CONFIG_SND_HDA_INPUT_BEEP
3083#define stac92xx_dig_beep_switch_info snd_ctl_boolean_mono_info
3084
3085static int stac92xx_dig_beep_switch_get(struct snd_kcontrol *kcontrol,
3086 struct snd_ctl_elem_value *ucontrol)
3087{
3088 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3089 ucontrol->value.integer.value[0] = codec->beep->enabled;
3090 return 0;
3091}
3092
3093static int stac92xx_dig_beep_switch_put(struct snd_kcontrol *kcontrol,
3094 struct snd_ctl_elem_value *ucontrol)
3095{
3096 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3097 int enabled = !!ucontrol->value.integer.value[0];
3098 if (codec->beep->enabled != enabled) {
3099 codec->beep->enabled = enabled;
3100 return 1;
3101 }
3102 return 0;
3103}
3104
3105static struct snd_kcontrol_new stac92xx_dig_beep_ctrl = {
3106 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3107 .info = stac92xx_dig_beep_switch_info,
3108 .get = stac92xx_dig_beep_switch_get,
3109 .put = stac92xx_dig_beep_switch_put,
3110};
3111
3112static int stac92xx_beep_switch_ctl(struct hda_codec *codec)
3113{
3114 return stac92xx_add_control_temp(codec->spec, &stac92xx_dig_beep_ctrl,
3115 0, "PC Beep Playback Switch", 0);
3116}
3117#endif
3118
3065static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) 3119static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
3066{ 3120{
3067 struct sigmatel_spec *spec = codec->spec; 3121 struct sigmatel_spec *spec = codec->spec;
@@ -3368,6 +3422,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3368#ifdef CONFIG_SND_HDA_INPUT_BEEP 3422#ifdef CONFIG_SND_HDA_INPUT_BEEP
3369 if (spec->digbeep_nid > 0) { 3423 if (spec->digbeep_nid > 0) {
3370 hda_nid_t nid = spec->digbeep_nid; 3424 hda_nid_t nid = spec->digbeep_nid;
3425 unsigned int caps;
3371 3426
3372 err = stac92xx_auto_create_beep_ctls(codec, nid); 3427 err = stac92xx_auto_create_beep_ctls(codec, nid);
3373 if (err < 0) 3428 if (err < 0)
@@ -3375,6 +3430,14 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3375 err = snd_hda_attach_beep_device(codec, nid); 3430 err = snd_hda_attach_beep_device(codec, nid);
3376 if (err < 0) 3431 if (err < 0)
3377 return err; 3432 return err;
3433 /* if no beep switch is available, make its own one */
3434 caps = query_amp_caps(codec, nid, HDA_OUTPUT);
3435 if (codec->beep &&
3436 !((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) {
3437 err = stac92xx_beep_switch_ctl(codec);
3438 if (err < 0)
3439 return err;
3440 }
3378 } 3441 }
3379#endif 3442#endif
3380 3443
@@ -4419,6 +4482,13 @@ again:
4419 stac92xx_set_config_regs(codec); 4482 stac92xx_set_config_regs(codec);
4420 } 4483 }
4421 4484
4485 if (spec->board_config > STAC_92HD71BXX_REF) {
4486 /* GPIO0 = EAPD */
4487 spec->gpio_mask = 0x01;
4488 spec->gpio_dir = 0x01;
4489 spec->gpio_data = 0x01;
4490 }
4491
4422 switch (codec->vendor_id) { 4492 switch (codec->vendor_id) {
4423 case 0x111d76b6: /* 4 Port without Analog Mixer */ 4493 case 0x111d76b6: /* 4 Port without Analog Mixer */
4424 case 0x111d76b7: 4494 case 0x111d76b7:
@@ -4429,10 +4499,10 @@ again:
4429 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 4499 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
4430 break; 4500 break;
4431 case 0x111d7608: /* 5 Port with Analog Mixer */ 4501 case 0x111d7608: /* 5 Port with Analog Mixer */
4432 switch (codec->subsystem_id) { 4502 switch (spec->board_config) {
4433 case 0x103c361a: 4503 case STAC_HP_M4:
4434 /* Enable VREF power saving on GPIO1 detect */ 4504 /* Enable VREF power saving on GPIO1 detect */
4435 snd_hda_codec_write(codec, codec->afg, 0, 4505 snd_hda_codec_write_cache(codec, codec->afg, 0,
4436 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02); 4506 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x02);
4437 snd_hda_codec_write_cache(codec, codec->afg, 0, 4507 snd_hda_codec_write_cache(codec, codec->afg, 0,
4438 AC_VERB_SET_UNSOLICITED_ENABLE, 4508 AC_VERB_SET_UNSOLICITED_ENABLE,
@@ -4478,13 +4548,6 @@ again:
4478 spec->aloopback_mask = 0x50; 4548 spec->aloopback_mask = 0x50;
4479 spec->aloopback_shift = 0; 4549 spec->aloopback_shift = 0;
4480 4550
4481 if (spec->board_config > STAC_92HD71BXX_REF) {
4482 /* GPIO0 = EAPD */
4483 spec->gpio_mask = 0x01;
4484 spec->gpio_dir = 0x01;
4485 spec->gpio_data = 0x01;
4486 }
4487
4488 spec->powerdown_adcs = 1; 4551 spec->powerdown_adcs = 1;
4489 spec->digbeep_nid = 0x26; 4552 spec->digbeep_nid = 0x26;
4490 spec->mux_nids = stac92hd71bxx_mux_nids; 4553 spec->mux_nids = stac92hd71bxx_mux_nids;
@@ -4832,7 +4895,7 @@ static int patch_stac9205(struct hda_codec *codec)
4832 stac92xx_set_config_reg(codec, 0x20, 0x1c410030); 4895 stac92xx_set_config_reg(codec, 0x20, 0x1c410030);
4833 4896
4834 /* Enable unsol response for GPIO4/Dock HP connection */ 4897 /* Enable unsol response for GPIO4/Dock HP connection */
4835 snd_hda_codec_write(codec, codec->afg, 0, 4898 snd_hda_codec_write_cache(codec, codec->afg, 0,
4836 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10); 4899 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x10);
4837 snd_hda_codec_write_cache(codec, codec->afg, 0, 4900 snd_hda_codec_write_cache(codec, codec->afg, 0,
4838 AC_VERB_SET_UNSOLICITED_ENABLE, 4901 AC_VERB_SET_UNSOLICITED_ENABLE,
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 0e06c6c9fcc0..73de6e989b3d 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -1229,8 +1229,11 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
1229 return -ENOMEM; 1229 return -ENOMEM;
1230 } 1230 }
1231 1231
1232 if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) 1232 if (snd_BUG_ON(pci_id->driver_data >= PCI_ID_LAST)) {
1233 kfree(mgr);
1234 pci_disable_device(pci);
1233 return -ENODEV; 1235 return -ENODEV;
1236 }
1234 card_name = pcxhr_board_params[pci_id->driver_data].board_name; 1237 card_name = pcxhr_board_params[pci_id->driver_data].board_name;
1235 mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips; 1238 mgr->playback_chips = pcxhr_board_params[pci_id->driver_data].playback_chips;
1236 mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips; 1239 mgr->capture_chips = pcxhr_board_params[pci_id->driver_data].capture_chips;