Magellan Linux

Contents of /trunk/kernel26-magellan-server/patches-2.6.31-r4/0105-2.6.31.6-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 968 - (show annotations) (download)
Fri Jan 1 14:52:51 2010 UTC (14 years, 3 months ago) by niro
File size: 99535 byte(s)
-2.6.31-magellan-r4:
-updated to linux-2.6.31.9

1 diff --git a/Documentation/dontdiff b/Documentation/dontdiff
2 index 88519da..e1efc40 100644
3 --- a/Documentation/dontdiff
4 +++ b/Documentation/dontdiff
5 @@ -152,7 +152,6 @@ piggy.gz
6 piggyback
7 pnmtologo
8 ppc_defs.h*
9 -promcon_tbl.c
10 pss_boot.h
11 qconf
12 raid6altivec*.c
13 diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
14 index b9d6568..1e0c712 100644
15 --- a/arch/alpha/kernel/vmlinux.lds.S
16 +++ b/arch/alpha/kernel/vmlinux.lds.S
17 @@ -1,4 +1,5 @@
18 #include <asm-generic/vmlinux.lds.h>
19 +#include <asm/thread_info.h>
20 #include <asm/page.h>
21
22 OUTPUT_FORMAT("elf64-alpha")
23 diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
24 index fb87c08..2de41c0 100644
25 --- a/arch/m68k/Kconfig
26 +++ b/arch/m68k/Kconfig
27 @@ -555,7 +555,7 @@ config HPAPCI
28
29 config MVME147_SCC
30 bool "SCC support for MVME147 serial ports"
31 - depends on MVME147
32 + depends on MVME147 && BROKEN
33 help
34 This is the driver for the serial ports on the Motorola MVME147
35 boards. Everyone using one of these boards should say Y here.
36 @@ -570,14 +570,14 @@ config SERIAL167
37
38 config MVME162_SCC
39 bool "SCC support for MVME162 serial ports"
40 - depends on MVME16x
41 + depends on MVME16x && BROKEN
42 help
43 This is the driver for the serial ports on the Motorola MVME162 and
44 172 boards. Everyone using one of these boards should say Y here.
45
46 config BVME6000_SCC
47 bool "SCC support for BVME6000 serial ports"
48 - depends on BVME6000
49 + depends on BVME6000 && BROKEN
50 help
51 This is the driver for the serial ports on the BVME4000 and BVME6000
52 boards from BVM Ltd. Everyone using one of these boards should say
53 diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
54 index e961221..eecd2a9 100644
55 --- a/arch/mips/kernel/Makefile
56 +++ b/arch/mips/kernel/Makefile
57 @@ -2,6 +2,8 @@
58 # Makefile for the Linux/MIPS kernel.
59 #
60
61 +CPPFLAGS_vmlinux.lds := $(KBUILD_CFLAGS)
62 +
63 extra-y := head.o init_task.o vmlinux.lds
64
65 obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
66 diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
67 index 576f8fb..b245f46 100644
68 --- a/arch/mips/kernel/vmlinux.lds.S
69 +++ b/arch/mips/kernel/vmlinux.lds.S
70 @@ -10,15 +10,15 @@ PHDRS {
71 note PT_NOTE FLAGS(4); /* R__ */
72 }
73
74 -ifdef CONFIG_32BIT
75 - ifdef CONFIG_CPU_LITTLE_ENDIAN
76 +#ifdef CONFIG_32BIT
77 + #ifdef CONFIG_CPU_LITTLE_ENDIAN
78 jiffies = jiffies_64;
79 - else
80 + #else
81 jiffies = jiffies_64 + 4;
82 - endif
83 -else
84 + #endif
85 +#else
86 jiffies = jiffies_64;
87 -endif
88 +#endif
89
90 SECTIONS
91 {
92 diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
93 index 65c585b..08d94e4 100644
94 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c
95 +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
96 @@ -44,14 +44,6 @@
97 */
98 #undef DEBUG_FREQ
99
100 -/*
101 - * There is a problem with the core cpufreq code on SMP kernels,
102 - * it won't recalculate the Bogomips properly
103 - */
104 -#ifdef CONFIG_SMP
105 -#warning "WARNING, CPUFREQ not recommended on SMP kernels"
106 -#endif
107 -
108 extern void low_choose_7447a_dfs(int dfs);
109 extern void low_choose_750fx_pll(int pll);
110 extern void low_sleep_handler(void);
111 diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
112 index 21226b7..414ca98 100644
113 --- a/arch/powerpc/platforms/powermac/low_i2c.c
114 +++ b/arch/powerpc/platforms/powermac/low_i2c.c
115 @@ -540,8 +540,11 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
116 /* Make sure IRQ is disabled */
117 kw_write_reg(reg_ier, 0);
118
119 - /* Request chip interrupt */
120 - if (request_irq(host->irq, kw_i2c_irq, 0, "keywest i2c", host))
121 + /* Request chip interrupt. We set IRQF_TIMER because we don't
122 + * want that interrupt disabled between the 2 passes of driver
123 + * suspend or we'll have issues running the pfuncs
124 + */
125 + if (request_irq(host->irq, kw_i2c_irq, IRQF_TIMER, "keywest i2c", host))
126 host->irq = NO_IRQ;
127
128 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
129 diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
130 index 04cdd32..e81403b 100644
131 --- a/arch/powerpc/platforms/powermac/pci.c
132 +++ b/arch/powerpc/platforms/powermac/pci.c
133 @@ -1286,3 +1286,64 @@ static void fixup_k2_sata(struct pci_dev* dev)
134 }
135 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, fixup_k2_sata);
136
137 +/*
138 + * On U4 (aka CPC945) the PCIe root complex "P2P" bridge resource ranges aren't
139 + * configured by the firmware. The bridge itself seems to ignore them but it
140 + * causes problems with Linux which then re-assigns devices below the bridge,
141 + * thus changing addresses of those devices from what was in the device-tree,
142 + * which sucks when those are video cards using offb
143 + *
144 + * We could just mark it transparent but I prefer fixing up the resources to
145 + * properly show what's going on here, as I have some doubts about having them
146 + * badly configured potentially being an issue for DMA.
147 + *
148 + * We leave PIO alone, it seems to be fine
149 + *
150 + * Oh and there's another funny bug. The OF properties advertize the region
151 + * 0xf1000000..0xf1ffffff as being forwarded as memory space. But that's
152 + * actually not true, this region is the memory mapped config space. So we
153 + * also need to filter it out or we'll map things in the wrong place.
154 + */
155 +static void fixup_u4_pcie(struct pci_dev* dev)
156 +{
157 + struct pci_controller *host = pci_bus_to_host(dev->bus);
158 + struct resource *region = NULL;
159 + u32 reg;
160 + int i;
161 +
162 + /* Only do that on PowerMac */
163 + if (!machine_is(powermac))
164 + return;
165 +
166 + /* Find the largest MMIO region */
167 + for (i = 0; i < 3; i++) {
168 + struct resource *r = &host->mem_resources[i];
169 + if (!(r->flags & IORESOURCE_MEM))
170 + continue;
171 + /* Skip the 0xf0xxxxxx..f2xxxxxx regions, we know they
172 + * are reserved by HW for other things
173 + */
174 + if (r->start >= 0xf0000000 && r->start < 0xf3000000)
175 + continue;
176 + if (!region || (r->end - r->start) >
177 + (region->end - region->start))
178 + region = r;
179 + }
180 + /* Nothing found, bail */
181 + if (region == 0)
182 + return;
183 +
184 + /* Print things out */
185 + printk(KERN_INFO "PCI: Fixup U4 PCIe bridge range: %pR\n", region);
186 +
187 + /* Fixup bridge config space. We know it's a Mac, resource aren't
188 + * offset so let's just blast them as-is. We also know that they
189 + * fit in 32 bits
190 + */
191 + reg = ((region->start >> 16) & 0xfff0) | (region->end & 0xfff00000);
192 + pci_write_config_dword(dev, PCI_MEMORY_BASE, reg);
193 + pci_write_config_dword(dev, PCI_PREF_BASE_UPPER32, 0);
194 + pci_write_config_dword(dev, PCI_PREF_LIMIT_UPPER32, 0);
195 + pci_write_config_dword(dev, PCI_PREF_MEMORY_BASE, 0);
196 +}
197 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie);
198 diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
199 index 6d4da7b..937a38e 100644
200 --- a/arch/powerpc/platforms/powermac/smp.c
201 +++ b/arch/powerpc/platforms/powermac/smp.c
202 @@ -408,7 +408,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
203 /* reset the entry point so if we get another intr we won't
204 * try to startup again */
205 out_be32(psurge_start, 0x100);
206 - if (setup_irq(30, &psurge_irqaction))
207 + if (setup_irq(irq_create_mapping(NULL, 30), &psurge_irqaction))
208 printk(KERN_ERR "Couldn't get primary IPI interrupt");
209 }
210
211 diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
212 index bf2e1ac..1164c34 100644
213 --- a/arch/powerpc/platforms/pseries/msi.c
214 +++ b/arch/powerpc/platforms/pseries/msi.c
215 @@ -432,8 +432,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
216 /* Read config space back so we can restore after reset */
217 read_msi_msg(virq, &msg);
218 entry->msg = msg;
219 -
220 - unmask_msi_irq(virq);
221 }
222
223 return 0;
224 diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
225 index 419f8a6..b9bf0ee 100644
226 --- a/arch/powerpc/platforms/pseries/xics.c
227 +++ b/arch/powerpc/platforms/pseries/xics.c
228 @@ -18,6 +18,7 @@
229 #include <linux/init.h>
230 #include <linux/radix-tree.h>
231 #include <linux/cpu.h>
232 +#include <linux/msi.h>
233 #include <linux/of.h>
234
235 #include <asm/firmware.h>
236 @@ -219,6 +220,14 @@ static void xics_unmask_irq(unsigned int virq)
237
238 static unsigned int xics_startup(unsigned int virq)
239 {
240 + /*
241 + * The generic MSI code returns with the interrupt disabled on the
242 + * card, using the MSI mask bits. Firmware doesn't appear to unmask
243 + * at that level, so we do it here by hand.
244 + */
245 + if (irq_to_desc(virq)->msi_desc)
246 + unmask_msi_irq(virq);
247 +
248 /* unmask it */
249 xics_unmask_irq(virq);
250 return 0;
251 diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
252 index adf5f27..cb3c72c 100644
253 --- a/arch/sparc/kernel/ldc.c
254 +++ b/arch/sparc/kernel/ldc.c
255 @@ -1242,13 +1242,13 @@ int ldc_bind(struct ldc_channel *lp, const char *name)
256 snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name);
257
258 err = request_irq(lp->cfg.rx_irq, ldc_rx,
259 - IRQF_SAMPLE_RANDOM | IRQF_SHARED,
260 + IRQF_SAMPLE_RANDOM | IRQF_DISABLED | IRQF_SHARED,
261 lp->rx_irq_name, lp);
262 if (err)
263 return err;
264
265 err = request_irq(lp->cfg.tx_irq, ldc_tx,
266 - IRQF_SAMPLE_RANDOM | IRQF_SHARED,
267 + IRQF_SAMPLE_RANDOM | IRQF_DISABLED | IRQF_SHARED,
268 lp->tx_irq_name, lp);
269 if (err) {
270 free_irq(lp->cfg.rx_irq, lp);
271 diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
272 index 998cadb..0ace49b 100644
273 --- a/arch/sparc/kernel/setup_32.c
274 +++ b/arch/sparc/kernel/setup_32.c
275 @@ -263,8 +263,6 @@ void __init setup_arch(char **cmdline_p)
276
277 #ifdef CONFIG_DUMMY_CONSOLE
278 conswitchp = &dummy_con;
279 -#elif defined(CONFIG_PROM_CONSOLE)
280 - conswitchp = &prom_con;
281 #endif
282 boot_flags_init(*cmdline_p);
283
284 diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
285 index f2bcfd2..2118033 100644
286 --- a/arch/sparc/kernel/setup_64.c
287 +++ b/arch/sparc/kernel/setup_64.c
288 @@ -295,8 +295,6 @@ void __init setup_arch(char **cmdline_p)
289
290 #ifdef CONFIG_DUMMY_CONSOLE
291 conswitchp = &dummy_con;
292 -#elif defined(CONFIG_PROM_CONSOLE)
293 - conswitchp = &prom_con;
294 #endif
295
296 idprom_init();
297 diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
298 index d76b026..b09502d 100644
299 --- a/arch/x86/ia32/ia32entry.S
300 +++ b/arch/x86/ia32/ia32entry.S
301 @@ -204,7 +204,7 @@ sysexit_from_sys_call:
302 movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
303 .endm
304
305 - .macro auditsys_exit exit,ebpsave=RBP
306 + .macro auditsys_exit exit
307 testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
308 jnz ia32_ret_from_sys_call
309 TRACE_IRQS_ON
310 @@ -217,7 +217,6 @@ sysexit_from_sys_call:
311 call audit_syscall_exit
312 GET_THREAD_INFO(%r10)
313 movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
314 - movl \ebpsave-ARGOFFSET(%rsp),%ebp /* reload user register value */
315 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
316 cli
317 TRACE_IRQS_OFF
318 @@ -351,7 +350,7 @@ cstar_auditsys:
319 jmp cstar_dispatch
320
321 sysretl_audit:
322 - auditsys_exit sysretl_from_sys_call, RCX /* user %ebp in RCX slot */
323 + auditsys_exit sysretl_from_sys_call
324 #endif
325
326 cstar_tracesys:
327 diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h
328 index bdf96f1..9dbd403 100644
329 --- a/arch/x86/include/asm/amd_iommu.h
330 +++ b/arch/x86/include/asm/amd_iommu.h
331 @@ -30,6 +30,7 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
332 extern void amd_iommu_flush_all_domains(void);
333 extern void amd_iommu_flush_all_devices(void);
334 extern void amd_iommu_shutdown(void);
335 +extern void amd_iommu_apply_erratum_63(u16 devid);
336 #else
337 static inline int amd_iommu_init(void) { return -ENODEV; }
338 static inline void amd_iommu_detect(void) { }
339 diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
340 index 03a0cbd..ca1fe39 100644
341 --- a/arch/x86/include/asm/uv/uv_hub.h
342 +++ b/arch/x86/include/asm/uv/uv_hub.h
343 @@ -18,6 +18,8 @@
344 #include <asm/types.h>
345 #include <asm/percpu.h>
346 #include <asm/uv/uv_mmrs.h>
347 +#include <asm/irq_vectors.h>
348 +#include <asm/io_apic.h>
349
350
351 /*
352 @@ -420,9 +422,14 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
353 static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
354 {
355 unsigned long val;
356 + unsigned long dmode = dest_Fixed;
357 +
358 + if (vector == NMI_VECTOR)
359 + dmode = dest_NMI;
360
361 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
362 ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
363 + (dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
364 (vector << UVH_IPI_INT_VECTOR_SHFT);
365 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
366 }
367 diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
368 index 4607241..f5cb46a 100644
369 --- a/arch/x86/kernel/amd_iommu.c
370 +++ b/arch/x86/kernel/amd_iommu.c
371 @@ -1112,6 +1112,8 @@ static void __detach_device(struct protection_domain *domain, u16 devid)
372 amd_iommu_dev_table[devid].data[1] = 0;
373 amd_iommu_dev_table[devid].data[2] = 0;
374
375 + amd_iommu_apply_erratum_63(devid);
376 +
377 /* decrease reference counter */
378 domain->dev_cnt -= 1;
379
380 diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
381 index c1b17e9..1e423b2 100644
382 --- a/arch/x86/kernel/amd_iommu_init.c
383 +++ b/arch/x86/kernel/amd_iommu_init.c
384 @@ -240,7 +240,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
385 writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET);
386 }
387
388 -static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
389 +static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
390 {
391 u32 ctrl;
392
393 @@ -509,6 +509,26 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
394 amd_iommu_dev_table[devid].data[i] |= (1 << _bit);
395 }
396
397 +static int get_dev_entry_bit(u16 devid, u8 bit)
398 +{
399 + int i = (bit >> 5) & 0x07;
400 + int _bit = bit & 0x1f;
401 +
402 + return (amd_iommu_dev_table[devid].data[i] & (1 << _bit)) >> _bit;
403 +}
404 +
405 +
406 +void amd_iommu_apply_erratum_63(u16 devid)
407 +{
408 + int sysmgt;
409 +
410 + sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) |
411 + (get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1);
412 +
413 + if (sysmgt == 0x01)
414 + set_dev_entry_bit(devid, DEV_ENTRY_IW);
415 +}
416 +
417 /* Writes the specific IOMMU for a device into the rlookup table */
418 static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid)
419 {
420 @@ -537,6 +557,8 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
421 if (flags & ACPI_DEVFLAG_LINT1)
422 set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS);
423
424 + amd_iommu_apply_erratum_63(devid);
425 +
426 set_iommu_for_device(iommu, devid);
427 }
428
429 diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
430 index 6011593..055e394 100644
431 --- a/arch/x86/kernel/apic/x2apic_uv_x.c
432 +++ b/arch/x86/kernel/apic/x2apic_uv_x.c
433 @@ -352,14 +352,14 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size)
434
435 for (i = 0; i < ARRAY_SIZE(redir_addrs); i++) {
436 alias.v = uv_read_local_mmr(redir_addrs[i].alias);
437 - if (alias.s.base == 0) {
438 + if (alias.s.enable && alias.s.base == 0) {
439 *size = (1UL << alias.s.m_alias);
440 redirect.v = uv_read_local_mmr(redir_addrs[i].redirect);
441 *base = (unsigned long)redirect.s.dest_base << DEST_SHIFT;
442 return;
443 }
444 }
445 - BUG();
446 + *base = *size = 0;
447 }
448
449 enum map_type {map_wb, map_uc};
450 @@ -609,12 +609,12 @@ void __init uv_system_init(void)
451 uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base;
452 uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size;
453 uv_cpu_hub_info(cpu)->m_val = m_val;
454 - uv_cpu_hub_info(cpu)->n_val = m_val;
455 + uv_cpu_hub_info(cpu)->n_val = n_val;
456 uv_cpu_hub_info(cpu)->numa_blade_id = blade;
457 uv_cpu_hub_info(cpu)->blade_processor_id = lcpu;
458 uv_cpu_hub_info(cpu)->pnode = pnode;
459 uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask;
460 - uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1;
461 + uv_cpu_hub_info(cpu)->gpa_mask = (1UL << (m_val + n_val)) - 1;
462 uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper;
463 uv_cpu_hub_info(cpu)->gnode_extra = gnode_extra;
464 uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base;
465 diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
466 index 5957a93..600e724 100644
467 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
468 +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
469 @@ -34,20 +34,31 @@
470 /* How long to wait between reporting thermal events */
471 #define CHECK_INTERVAL (300 * HZ)
472
473 -static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES;
474 -static DEFINE_PER_CPU(unsigned long, thermal_throttle_count);
475 -static DEFINE_PER_CPU(bool, thermal_throttle_active);
476 +/*
477 + * Current thermal throttling state:
478 + */
479 +struct thermal_state {
480 + bool is_throttled;
481 +
482 + u64 next_check;
483 + unsigned long throttle_count;
484 + unsigned long last_throttle_count;
485 +};
486 +
487 +static DEFINE_PER_CPU(struct thermal_state, thermal_state);
488
489 -static atomic_t therm_throt_en = ATOMIC_INIT(0);
490 +static atomic_t therm_throt_en = ATOMIC_INIT(0);
491
492 #ifdef CONFIG_SYSFS
493 #define define_therm_throt_sysdev_one_ro(_name) \
494 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL)
495
496 #define define_therm_throt_sysdev_show_func(name) \
497 -static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \
498 - struct sysdev_attribute *attr, \
499 - char *buf) \
500 + \
501 +static ssize_t therm_throt_sysdev_show_##name( \
502 + struct sys_device *dev, \
503 + struct sysdev_attribute *attr, \
504 + char *buf) \
505 { \
506 unsigned int cpu = dev->id; \
507 ssize_t ret; \
508 @@ -55,7 +66,7 @@ static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \
509 preempt_disable(); /* CPU hotplug */ \
510 if (cpu_online(cpu)) \
511 ret = sprintf(buf, "%lu\n", \
512 - per_cpu(thermal_throttle_##name, cpu)); \
513 + per_cpu(thermal_state, cpu).name); \
514 else \
515 ret = 0; \
516 preempt_enable(); \
517 @@ -63,11 +74,11 @@ static ssize_t therm_throt_sysdev_show_##name(struct sys_device *dev, \
518 return ret; \
519 }
520
521 -define_therm_throt_sysdev_show_func(count);
522 -define_therm_throt_sysdev_one_ro(count);
523 +define_therm_throt_sysdev_show_func(throttle_count);
524 +define_therm_throt_sysdev_one_ro(throttle_count);
525
526 static struct attribute *thermal_throttle_attrs[] = {
527 - &attr_count.attr,
528 + &attr_throttle_count.attr,
529 NULL
530 };
531
532 @@ -93,33 +104,39 @@ static struct attribute_group thermal_throttle_attr_group = {
533 * 1 : Event should be logged further, and a message has been
534 * printed to the syslog.
535 */
536 -static int therm_throt_process(int curr)
537 +static int therm_throt_process(bool is_throttled)
538 {
539 - unsigned int cpu = smp_processor_id();
540 - __u64 tmp_jiffs = get_jiffies_64();
541 - bool was_throttled = __get_cpu_var(thermal_throttle_active);
542 - bool is_throttled = __get_cpu_var(thermal_throttle_active) = curr;
543 + struct thermal_state *state;
544 + unsigned int this_cpu;
545 + bool was_throttled;
546 + u64 now;
547 +
548 + this_cpu = smp_processor_id();
549 + now = get_jiffies_64();
550 + state = &per_cpu(thermal_state, this_cpu);
551 +
552 + was_throttled = state->is_throttled;
553 + state->is_throttled = is_throttled;
554
555 if (is_throttled)
556 - __get_cpu_var(thermal_throttle_count)++;
557 + state->throttle_count++;
558
559 - if (!(was_throttled ^ is_throttled) &&
560 - time_before64(tmp_jiffs, __get_cpu_var(next_check)))
561 + if (time_before64(now, state->next_check) &&
562 + state->throttle_count != state->last_throttle_count)
563 return 0;
564
565 - __get_cpu_var(next_check) = tmp_jiffs + CHECK_INTERVAL;
566 + state->next_check = now + CHECK_INTERVAL;
567 + state->last_throttle_count = state->throttle_count;
568
569 /* if we just entered the thermal event */
570 if (is_throttled) {
571 - printk(KERN_CRIT "CPU%d: Temperature above threshold, "
572 - "cpu clock throttled (total events = %lu)\n",
573 - cpu, __get_cpu_var(thermal_throttle_count));
574 + printk(KERN_CRIT "CPU%d: Temperature above threshold, cpu clock throttled (total events = %lu)\n", this_cpu, state->throttle_count);
575
576 add_taint(TAINT_MACHINE_CHECK);
577 return 1;
578 }
579 if (was_throttled) {
580 - printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
581 + printk(KERN_INFO "CPU%d: Temperature/speed normal\n", this_cpu);
582 return 1;
583 }
584
585 @@ -213,7 +230,7 @@ static void intel_thermal_interrupt(void)
586 __u64 msr_val;
587
588 rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
589 - if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT))
590 + if (therm_throt_process((msr_val & THERM_STATUS_PROCHOT) != 0))
591 mce_log_therm_throt_event(msr_val);
592 }
593
594 diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
595 index 5cb5725..0bc204d 100644
596 --- a/arch/x86/kernel/e820.c
597 +++ b/arch/x86/kernel/e820.c
598 @@ -1378,8 +1378,8 @@ static unsigned long ram_alignment(resource_size_t pos)
599 if (mb < 16)
600 return 1024*1024;
601
602 - /* To 32MB for anything above that */
603 - return 32*1024*1024;
604 + /* To 64MB for anything above that */
605 + return 64*1024*1024;
606 }
607
608 #define MAX_RESOURCE_SIZE ((resource_size_t)-1)
609 diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
610 index 77b9689..9848980 100644
611 --- a/arch/x86/kernel/tlb_uv.c
612 +++ b/arch/x86/kernel/tlb_uv.c
613 @@ -843,8 +843,8 @@ static int __init uv_bau_init(void)
614 GFP_KERNEL, cpu_to_node(cur_cpu));
615
616 uv_bau_retry_limit = 1;
617 - uv_nshift = uv_hub_info->n_val;
618 - uv_mmask = (1UL << uv_hub_info->n_val) - 1;
619 + uv_nshift = uv_hub_info->m_val;
620 + uv_mmask = (1UL << uv_hub_info->m_val) - 1;
621 nblades = uv_num_possible_blades();
622
623 uv_bau_table_bases = (struct bau_control **)
624 diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
625 index 21f68e0..5c8bfff 100644
626 --- a/arch/x86/kvm/i8254.c
627 +++ b/arch/x86/kvm/i8254.c
628 @@ -116,7 +116,7 @@ static s64 __kpit_elapsed(struct kvm *kvm)
629 * itself with the initial count and continues counting
630 * from there.
631 */
632 - remaining = hrtimer_expires_remaining(&ps->pit_timer.timer);
633 + remaining = hrtimer_get_remaining(&ps->pit_timer.timer);
634 elapsed = ps->pit_timer.period - ktime_to_ns(remaining);
635 elapsed = mod_64(elapsed, ps->pit_timer.period);
636
637 diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
638 index b225176..9a65123 100644
639 --- a/arch/x86/kvm/lapic.c
640 +++ b/arch/x86/kvm/lapic.c
641 @@ -464,7 +464,7 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
642 if (apic_get_reg(apic, APIC_TMICT) == 0)
643 return 0;
644
645 - remaining = hrtimer_expires_remaining(&apic->lapic_timer.timer);
646 + remaining = hrtimer_get_remaining(&apic->lapic_timer.timer);
647 if (ktime_to_ns(remaining) < 0)
648 remaining = ktime_set(0, 0);
649
650 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
651 index 8aafb62..26e454c 100644
652 --- a/arch/x86/kvm/x86.c
653 +++ b/arch/x86/kvm/x86.c
654 @@ -949,6 +949,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
655 case MSR_P6_EVNTSEL0:
656 case MSR_P6_EVNTSEL1:
657 case MSR_K7_EVNTSEL0:
658 + case MSR_K8_INT_PENDING_MSG:
659 data = 0;
660 break;
661 case MSR_MTRRcap:
662 @@ -3761,7 +3762,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
663 return kvm_write_guest(vcpu->kvm, gpa, seg_desc, 8);
664 }
665
666 -static u32 get_tss_base_addr(struct kvm_vcpu *vcpu,
667 +static gpa_t get_tss_base_addr(struct kvm_vcpu *vcpu,
668 struct desc_struct *seg_desc)
669 {
670 u32 base_addr;
671 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
672 index 3839a0f..a11a115 100644
673 --- a/arch/x86/xen/enlighten.c
674 +++ b/arch/x86/xen/enlighten.c
675 @@ -178,6 +178,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
676 static void xen_cpuid(unsigned int *ax, unsigned int *bx,
677 unsigned int *cx, unsigned int *dx)
678 {
679 + unsigned maskebx = ~0;
680 unsigned maskecx = ~0;
681 unsigned maskedx = ~0;
682
683 @@ -185,9 +186,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
684 * Mask out inconvenient features, to try and disable as many
685 * unsupported kernel subsystems as possible.
686 */
687 - if (*ax == 1) {
688 + switch (*ax) {
689 + case 1:
690 maskecx = cpuid_leaf1_ecx_mask;
691 maskedx = cpuid_leaf1_edx_mask;
692 + break;
693 +
694 + case 0xb:
695 + /* Suppress extended topology stuff */
696 + maskebx = 0;
697 + break;
698 }
699
700 asm(XEN_EMULATE_PREFIX "cpuid"
701 @@ -197,6 +205,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
702 "=d" (*dx)
703 : "0" (*ax), "2" (*cx));
704
705 + *bx &= maskebx;
706 *cx &= maskecx;
707 *dx &= maskedx;
708 }
709 diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
710 index 55b5b90..97fad29 100644
711 --- a/drivers/acpi/pci_root.c
712 +++ b/drivers/acpi/pci_root.c
713 @@ -400,6 +400,17 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
714
715 pbus = pdev->subordinate;
716 pci_dev_put(pdev);
717 +
718 + /*
719 + * This function may be called for a non-PCI device that has a
720 + * PCI parent (eg. a disk under a PCI SATA controller). In that
721 + * case pdev->subordinate will be NULL for the parent.
722 + */
723 + if (!pbus) {
724 + dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");
725 + pdev = NULL;
726 + break;
727 + }
728 }
729 out:
730 list_for_each_entry_safe(node, tmp, &device_list, node)
731 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
732 index 781435d..5dd702c 100644
733 --- a/drivers/acpi/scan.c
734 +++ b/drivers/acpi/scan.c
735 @@ -1264,16 +1264,6 @@ acpi_add_single_object(struct acpi_device **child,
736 acpi_device_set_id(device, parent, handle, type);
737
738 /*
739 - * The ACPI device is attached to acpi handle before getting
740 - * the power/wakeup/peformance flags. Otherwise OS can't get
741 - * the corresponding ACPI device by the acpi handle in the course
742 - * of getting the power/wakeup/performance flags.
743 - */
744 - result = acpi_device_set_context(device, type);
745 - if (result)
746 - goto end;
747 -
748 - /*
749 * Power Management
750 * ----------------
751 */
752 @@ -1303,6 +1293,8 @@ acpi_add_single_object(struct acpi_device **child,
753 goto end;
754 }
755
756 + if ((result = acpi_device_set_context(device, type)))
757 + goto end;
758
759 result = acpi_device_register(device, parent);
760
761 diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
762 index 289c4f8..b2526e4 100644
763 --- a/drivers/ata/ahci.c
764 +++ b/drivers/ata/ahci.c
765 @@ -433,7 +433,8 @@ static const struct ata_port_info ahci_port_info[] = {
766 [board_ahci_sb600] =
767 {
768 AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL |
769 - AHCI_HFLAG_NO_MSI | AHCI_HFLAG_SECT255),
770 + AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI |
771 + AHCI_HFLAG_SECT255),
772 .flags = AHCI_FLAG_COMMON,
773 .pio_mask = ATA_PIO4,
774 .udma_mask = ATA_UDMA6,
775 @@ -2602,51 +2603,6 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
776 }
777 }
778
779 -/*
780 - * SB600 ahci controller on ASUS M2A-VM can't do 64bit DMA with older
781 - * BIOS. The oldest version known to be broken is 0901 and working is
782 - * 1501 which was released on 2007-10-26. Force 32bit DMA on anything
783 - * older than 1501. Please read bko#9412 for more info.
784 - */
785 -static bool ahci_asus_m2a_vm_32bit_only(struct pci_dev *pdev)
786 -{
787 - static const struct dmi_system_id sysids[] = {
788 - {
789 - .ident = "ASUS M2A-VM",
790 - .matches = {
791 - DMI_MATCH(DMI_BOARD_VENDOR,
792 - "ASUSTeK Computer INC."),
793 - DMI_MATCH(DMI_BOARD_NAME, "M2A-VM"),
794 - },
795 - },
796 - { }
797 - };
798 - const char *cutoff_mmdd = "10/26";
799 - const char *date;
800 - int year;
801 -
802 - if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x12, 0) ||
803 - !dmi_check_system(sysids))
804 - return false;
805 -
806 - /*
807 - * Argh.... both version and date are free form strings.
808 - * Let's hope they're using the same date format across
809 - * different versions.
810 - */
811 - date = dmi_get_system_info(DMI_BIOS_DATE);
812 - year = dmi_get_year(DMI_BIOS_DATE);
813 - if (date && strlen(date) >= 10 && date[2] == '/' && date[5] == '/' &&
814 - (year > 2007 ||
815 - (year == 2007 && strncmp(date, cutoff_mmdd, 5) >= 0)))
816 - return false;
817 -
818 - dev_printk(KERN_WARNING, &pdev->dev, "ASUS M2A-VM: BIOS too old, "
819 - "forcing 32bit DMA, update BIOS\n");
820 -
821 - return true;
822 -}
823 -
824 static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
825 {
826 static const struct dmi_system_id broken_systems[] = {
827 @@ -2857,10 +2813,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
828 if (board_id == board_ahci_sb700 && pdev->revision >= 0x40)
829 hpriv->flags &= ~AHCI_HFLAG_IGN_SERR_INTERNAL;
830
831 - /* apply ASUS M2A_VM quirk */
832 - if (ahci_asus_m2a_vm_32bit_only(pdev))
833 - hpriv->flags |= AHCI_HFLAG_32BIT_ONLY;
834 -
835 if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev))
836 pci_intx(pdev, 1);
837
838 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
839 index e71149b..4143943 100644
840 --- a/drivers/ata/libata-core.c
841 +++ b/drivers/ata/libata-core.c
842 @@ -5008,12 +5008,14 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
843 qc->flags |= ATA_QCFLAG_FAILED;
844
845 if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
846 - if (!ata_tag_internal(qc->tag)) {
847 - /* always fill result TF for failed qc */
848 - fill_result_tf(qc);
849 + /* always fill result TF for failed qc */
850 + fill_result_tf(qc);
851 +
852 + if (!ata_tag_internal(qc->tag))
853 ata_qc_schedule_eh(qc);
854 - return;
855 - }
856 + else
857 + __ata_qc_complete(qc);
858 + return;
859 }
860
861 /* read result TF if requested */
862 diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
863 index c644fec..1652b91 100644
864 --- a/drivers/ata/libata-eh.c
865 +++ b/drivers/ata/libata-eh.c
866 @@ -2849,12 +2849,14 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
867 * device detection messages backwards.
868 */
869 ata_for_each_dev(dev, link, ALL) {
870 - if (!(new_mask & (1 << dev->devno)) ||
871 - dev->class == ATA_DEV_PMP)
872 + if (!(new_mask & (1 << dev->devno)))
873 continue;
874
875 dev->class = ehc->classes[dev->devno];
876
877 + if (dev->class == ATA_DEV_PMP)
878 + continue;
879 +
880 ehc->i.flags |= ATA_EHI_PRINTINFO;
881 rc = ata_dev_configure(dev);
882 ehc->i.flags &= ~ATA_EHI_PRINTINFO;
883 diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
884 index f49814d..3bbed83 100644
885 --- a/drivers/ata/pata_sc1200.c
886 +++ b/drivers/ata/pata_sc1200.c
887 @@ -235,8 +235,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
888 .udma_mask = ATA_UDMA2,
889 .port_ops = &sc1200_port_ops
890 };
891 - /* Can't enable port 2 yet, see top comments */
892 - const struct ata_port_info *ppi[] = { &info, };
893 + const struct ata_port_info *ppi[] = { &info, NULL };
894
895 return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL);
896 }
897 diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
898 index 45657ca..88984b8 100644
899 --- a/drivers/ata/pata_via.c
900 +++ b/drivers/ata/pata_via.c
901 @@ -111,7 +111,7 @@ static const struct via_isa_bridge {
902 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
903 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
904 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES },
905 - { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES },
906 + { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0xff, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES },
907 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
908 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
909 { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
910 diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
911 index 86a4058..1eb4e02 100644
912 --- a/drivers/ata/sata_nv.c
913 +++ b/drivers/ata/sata_nv.c
914 @@ -1594,9 +1594,21 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
915 !ata_dev_enabled(link->device))
916 sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
917 NULL, NULL);
918 - else if (!(ehc->i.flags & ATA_EHI_QUIET))
919 - ata_link_printk(link, KERN_INFO,
920 - "nv: skipping hardreset on occupied port\n");
921 + else {
922 + const unsigned long *timing = sata_ehc_deb_timing(ehc);
923 + int rc;
924 +
925 + if (!(ehc->i.flags & ATA_EHI_QUIET))
926 + ata_link_printk(link, KERN_INFO, "nv: skipping "
927 + "hardreset on occupied port\n");
928 +
929 + /* make sure the link is online */
930 + rc = sata_link_resume(link, timing, deadline);
931 + /* whine about phy resume failure but proceed */
932 + if (rc && rc != -EOPNOTSUPP)
933 + ata_link_printk(link, KERN_WARNING, "failed to resume "
934 + "link (errno=%d)\n", rc);
935 + }
936
937 /* device signature acquisition is unreliable */
938 return -EAGAIN;
939 diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
940 index bdd43c7..02efd9a 100644
941 --- a/drivers/ata/sata_via.c
942 +++ b/drivers/ata/sata_via.c
943 @@ -93,7 +93,6 @@ static const struct pci_device_id svia_pci_tbl[] = {
944 { PCI_VDEVICE(VIA, 0x7372), vt6420 },
945 { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */
946 { PCI_VDEVICE(VIA, 0x9000), vt8251 },
947 - { PCI_VDEVICE(VIA, 0x9040), vt8251 },
948
949 { } /* terminate list */
950 };
951 diff --git a/drivers/base/driver.c b/drivers/base/driver.c
952 index 8ae0f63..2b7f5bc 100644
953 --- a/drivers/base/driver.c
954 +++ b/drivers/base/driver.c
955 @@ -236,7 +236,7 @@ int driver_register(struct device_driver *drv)
956 put_driver(other);
957 printk(KERN_ERR "Error: Driver '%s' is already registered, "
958 "aborting...\n", drv->name);
959 - return -EEXIST;
960 + return -EBUSY;
961 }
962
963 ret = bus_add_driver(drv);
964 diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
965 index 6a06913..a95b553 100644
966 --- a/drivers/char/Kconfig
967 +++ b/drivers/char/Kconfig
968 @@ -323,7 +323,7 @@ config SPECIALIX
969
970 config SX
971 tristate "Specialix SX (and SI) card support"
972 - depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
973 + depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN
974 help
975 This is a driver for the SX and SI multiport serial cards.
976 Please read the file <file:Documentation/serial/sx.txt> for details.
977 @@ -334,7 +334,7 @@ config SX
978
979 config RIO
980 tristate "Specialix RIO system support"
981 - depends on SERIAL_NONSTANDARD
982 + depends on SERIAL_NONSTANDARD && BROKEN
983 help
984 This is a driver for the Specialix RIO, a smart serial card which
985 drives an outboard box that can support up to 128 ports. Product
986 @@ -395,7 +395,7 @@ config NOZOMI
987
988 config A2232
989 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
990 - depends on EXPERIMENTAL && ZORRO && BROKEN_ON_SMP
991 + depends on EXPERIMENTAL && ZORRO && BROKEN
992 ---help---
993 This option supports the 2232 7-port serial card shipped with the
994 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
995 diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
996 index 6cf88b6..6a45365 100644
997 --- a/drivers/char/agp/intel-agp.c
998 +++ b/drivers/char/agp/intel-agp.c
999 @@ -36,6 +36,8 @@
1000 #define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2
1001 #define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0
1002 #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2
1003 +#define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40
1004 +#define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42
1005 #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40
1006 #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42
1007 #define PCI_DEVICE_ID_INTEL_IGD_E_HB 0x2E00
1008 @@ -81,6 +83,7 @@
1009 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \
1010 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB || \
1011 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G41_HB || \
1012 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_B43_HB || \
1013 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \
1014 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \
1015 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB)
1016 @@ -1232,6 +1235,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
1017 case PCI_DEVICE_ID_INTEL_Q45_HB:
1018 case PCI_DEVICE_ID_INTEL_G45_HB:
1019 case PCI_DEVICE_ID_INTEL_G41_HB:
1020 + case PCI_DEVICE_ID_INTEL_B43_HB:
1021 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB:
1022 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB:
1023 case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB:
1024 @@ -2208,6 +2212,8 @@ static const struct intel_driver_description {
1025 "Q45/Q43", NULL, &intel_i965_driver },
1026 { PCI_DEVICE_ID_INTEL_G45_HB, PCI_DEVICE_ID_INTEL_G45_IG, 0,
1027 "G45/G43", NULL, &intel_i965_driver },
1028 + { PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG, 0,
1029 + "B43", NULL, &intel_i965_driver },
1030 { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, 0,
1031 "G41", NULL, &intel_i965_driver },
1032 { PCI_DEVICE_ID_INTEL_IGDNG_D_HB, PCI_DEVICE_ID_INTEL_IGDNG_D_IG, 0,
1033 @@ -2408,6 +2414,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
1034 ID(PCI_DEVICE_ID_INTEL_Q45_HB),
1035 ID(PCI_DEVICE_ID_INTEL_G45_HB),
1036 ID(PCI_DEVICE_ID_INTEL_G41_HB),
1037 + ID(PCI_DEVICE_ID_INTEL_B43_HB),
1038 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB),
1039 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB),
1040 ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB),
1041 diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c
1042 index eba999f..ae453cc 100644
1043 --- a/drivers/char/hvc_xen.c
1044 +++ b/drivers/char/hvc_xen.c
1045 @@ -55,7 +55,7 @@ static inline void notify_daemon(void)
1046 notify_remote_via_evtchn(xen_start_info->console.domU.evtchn);
1047 }
1048
1049 -static int write_console(uint32_t vtermno, const char *data, int len)
1050 +static int __write_console(const char *data, int len)
1051 {
1052 struct xencons_interface *intf = xencons_interface();
1053 XENCONS_RING_IDX cons, prod;
1054 @@ -76,6 +76,29 @@ static int write_console(uint32_t vtermno, const char *data, int len)
1055 return sent;
1056 }
1057
1058 +static int write_console(uint32_t vtermno, const char *data, int len)
1059 +{
1060 + int ret = len;
1061 +
1062 + /*
1063 + * Make sure the whole buffer is emitted, polling if
1064 + * necessary. We don't ever want to rely on the hvc daemon
1065 + * because the most interesting console output is when the
1066 + * kernel is crippled.
1067 + */
1068 + while (len) {
1069 + int sent = __write_console(data, len);
1070 +
1071 + data += sent;
1072 + len -= sent;
1073 +
1074 + if (unlikely(len))
1075 + HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
1076 + }
1077 +
1078 + return ret;
1079 +}
1080 +
1081 static int read_console(uint32_t vtermno, char *buf, int len)
1082 {
1083 struct xencons_interface *intf = xencons_interface();
1084 diff --git a/drivers/char/vt.c b/drivers/char/vt.c
1085 index 404f4c1..6aa88f5 100644
1086 --- a/drivers/char/vt.c
1087 +++ b/drivers/char/vt.c
1088 @@ -2948,9 +2948,6 @@ int __init vty_init(const struct file_operations *console_fops)
1089 panic("Couldn't register console driver\n");
1090 kbd_init();
1091 console_map_init();
1092 -#ifdef CONFIG_PROM_CONSOLE
1093 - prom_con_init();
1094 -#endif
1095 #ifdef CONFIG_MDA_CONSOLE
1096 mda_console_init();
1097 #endif
1098 diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
1099 index 8504a21..910c49d 100644
1100 --- a/drivers/cpuidle/cpuidle.c
1101 +++ b/drivers/cpuidle/cpuidle.c
1102 @@ -75,8 +75,11 @@ static void cpuidle_idle_call(void)
1103 #endif
1104 /* ask the governor for the next state */
1105 next_state = cpuidle_curr_governor->select(dev);
1106 - if (need_resched())
1107 + if (need_resched()) {
1108 + local_irq_enable();
1109 return;
1110 + }
1111 +
1112 target_state = &dev->states[next_state];
1113
1114 /* enter the state and update stats */
1115 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
1116 index 5b4f87e..88b3eff 100644
1117 --- a/drivers/gpu/drm/i915/i915_drv.h
1118 +++ b/drivers/gpu/drm/i915/i915_drv.h
1119 @@ -854,6 +854,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
1120 (dev)->pci_device == 0x2E12 || \
1121 (dev)->pci_device == 0x2E22 || \
1122 (dev)->pci_device == 0x2E32 || \
1123 + (dev)->pci_device == 0x2E42 || \
1124 (dev)->pci_device == 0x0042 || \
1125 (dev)->pci_device == 0x0046)
1126
1127 @@ -866,6 +867,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
1128 (dev)->pci_device == 0x2E12 || \
1129 (dev)->pci_device == 0x2E22 || \
1130 (dev)->pci_device == 0x2E32 || \
1131 + (dev)->pci_device == 0x2E42 || \
1132 IS_GM45(dev))
1133
1134 #define IS_IGDG(dev) ((dev)->pci_device == 0xa001)
1135 diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
1136 index 106a1ae..c017fa1 100644
1137 --- a/drivers/gpu/drm/i915/i915_reg.h
1138 +++ b/drivers/gpu/drm/i915/i915_reg.h
1139 @@ -1616,6 +1616,11 @@
1140 #define PIPE_START_VBLANK_INTERRUPT_STATUS (1UL<<2) /* 965 or later */
1141 #define PIPE_VBLANK_INTERRUPT_STATUS (1UL<<1)
1142 #define PIPE_OVERLAY_UPDATED_STATUS (1UL<<0)
1143 +#define PIPE_BPC_MASK (7 << 5) /* Ironlake */
1144 +#define PIPE_8BPC (0 << 5)
1145 +#define PIPE_10BPC (1 << 5)
1146 +#define PIPE_6BPC (2 << 5)
1147 +#define PIPE_12BPC (3 << 5)
1148
1149 #define DSPARB 0x70030
1150 #define DSPARB_CSTART_MASK (0x7f << 7)
1151 @@ -1866,6 +1871,11 @@
1152 #define PFA_CTL_1 0x68080
1153 #define PFB_CTL_1 0x68880
1154 #define PF_ENABLE (1<<31)
1155 +#define PF_FILTER_MASK (3<<23)
1156 +#define PF_FILTER_PROGRAMMED (0<<23)
1157 +#define PF_FILTER_MED_3x3 (1<<23)
1158 +#define PF_FILTER_EDGE_ENHANCE (2<<23)
1159 +#define PF_FILTER_EDGE_SOFTEN (3<<23)
1160 #define PFA_WIN_SZ 0x68074
1161 #define PFB_WIN_SZ 0x68874
1162 #define PFA_WIN_POS 0x68070
1163 @@ -1985,11 +1995,11 @@
1164 #define DREF_CPU_SOURCE_OUTPUT_MASK (3<<13)
1165 #define DREF_SSC_SOURCE_DISABLE (0<<11)
1166 #define DREF_SSC_SOURCE_ENABLE (2<<11)
1167 -#define DREF_SSC_SOURCE_MASK (2<<11)
1168 +#define DREF_SSC_SOURCE_MASK (3<<11)
1169 #define DREF_NONSPREAD_SOURCE_DISABLE (0<<9)
1170 #define DREF_NONSPREAD_CK505_ENABLE (1<<9)
1171 #define DREF_NONSPREAD_SOURCE_ENABLE (2<<9)
1172 -#define DREF_NONSPREAD_SOURCE_MASK (2<<9)
1173 +#define DREF_NONSPREAD_SOURCE_MASK (3<<9)
1174 #define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7)
1175 #define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7)
1176 #define DREF_SSC4_DOWNSPREAD (0<<6)
1177 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
1178 index 8b5af29..318ba47 100644
1179 --- a/drivers/gpu/drm/i915/intel_display.c
1180 +++ b/drivers/gpu/drm/i915/intel_display.c
1181 @@ -1213,7 +1213,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1182 /* Enable panel fitting for LVDS */
1183 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
1184 temp = I915_READ(pf_ctl_reg);
1185 - I915_WRITE(pf_ctl_reg, temp | PF_ENABLE);
1186 + I915_WRITE(pf_ctl_reg, temp | PF_ENABLE | PF_FILTER_MED_3x3);
1187
1188 /* currently full aspect */
1189 I915_WRITE(pf_win_pos, 0);
1190 @@ -1764,7 +1764,7 @@ fdi_reduce_ratio(u32 *num, u32 *den)
1191 #define LINK_N 0x80000
1192
1193 static void
1194 -igdng_compute_m_n(int bytes_per_pixel, int nlanes,
1195 +igdng_compute_m_n(int bits_per_pixel, int nlanes,
1196 int pixel_clock, int link_clock,
1197 struct fdi_m_n *m_n)
1198 {
1199 @@ -1774,7 +1774,8 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes,
1200
1201 temp = (u64) DATA_N * pixel_clock;
1202 temp = div_u64(temp, link_clock);
1203 - m_n->gmch_m = div_u64(temp * bytes_per_pixel, nlanes);
1204 + m_n->gmch_m = div_u64(temp * bits_per_pixel, nlanes);
1205 + m_n->gmch_m >>= 3; /* convert to bytes_per_pixel */
1206 m_n->gmch_n = DATA_N;
1207 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
1208
1209 @@ -2396,7 +2397,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1210
1211 /* FDI link */
1212 if (IS_IGDNG(dev)) {
1213 - int lane, link_bw;
1214 + int lane, link_bw, bpp;
1215 /* eDP doesn't require FDI link, so just set DP M/N
1216 according to current link config */
1217 if (is_edp) {
1218 @@ -2415,10 +2416,72 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1219 lane = 4;
1220 link_bw = 270000;
1221 }
1222 - igdng_compute_m_n(3, lane, target_clock,
1223 +
1224 + /* determine panel color depth */
1225 + temp = I915_READ(pipeconf_reg);
1226 +
1227 + switch (temp & PIPE_BPC_MASK) {
1228 + case PIPE_8BPC:
1229 + bpp = 24;
1230 + break;
1231 + case PIPE_10BPC:
1232 + bpp = 30;
1233 + break;
1234 + case PIPE_6BPC:
1235 + bpp = 18;
1236 + break;
1237 + case PIPE_12BPC:
1238 + bpp = 36;
1239 + break;
1240 + default:
1241 + DRM_ERROR("unknown pipe bpc value\n");
1242 + bpp = 24;
1243 + }
1244 +
1245 + igdng_compute_m_n(bpp, lane, target_clock,
1246 link_bw, &m_n);
1247 }
1248
1249 + /* Ironlake: try to setup display ref clock before DPLL
1250 + * enabling. This is only under driver's control after
1251 + * PCH B stepping, previous chipset stepping should be
1252 + * ignoring this setting.
1253 + */
1254 + if (IS_IGDNG(dev)) {
1255 + temp = I915_READ(PCH_DREF_CONTROL);
1256 + /* Always enable nonspread source */
1257 + temp &= ~DREF_NONSPREAD_SOURCE_MASK;
1258 + temp |= DREF_NONSPREAD_SOURCE_ENABLE;
1259 + I915_WRITE(PCH_DREF_CONTROL, temp);
1260 + POSTING_READ(PCH_DREF_CONTROL);
1261 +
1262 + temp &= ~DREF_SSC_SOURCE_MASK;
1263 + temp |= DREF_SSC_SOURCE_ENABLE;
1264 + I915_WRITE(PCH_DREF_CONTROL, temp);
1265 + POSTING_READ(PCH_DREF_CONTROL);
1266 +
1267 + udelay(200);
1268 +
1269 + if (is_edp) {
1270 + if (dev_priv->lvds_use_ssc) {
1271 + temp |= DREF_SSC1_ENABLE;
1272 + I915_WRITE(PCH_DREF_CONTROL, temp);
1273 + POSTING_READ(PCH_DREF_CONTROL);
1274 +
1275 + udelay(200);
1276 +
1277 + temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK;
1278 + temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD;
1279 + I915_WRITE(PCH_DREF_CONTROL, temp);
1280 + POSTING_READ(PCH_DREF_CONTROL);
1281 + } else {
1282 + temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD;
1283 + I915_WRITE(PCH_DREF_CONTROL, temp);
1284 + POSTING_READ(PCH_DREF_CONTROL);
1285 + }
1286 + }
1287 + }
1288 +
1289 if (IS_IGD(dev))
1290 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2;
1291 else
1292 diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
1293 index 9157247..231a6a5 100644
1294 --- a/drivers/hwmon/it87.c
1295 +++ b/drivers/hwmon/it87.c
1296 @@ -1028,12 +1028,11 @@ static int __init it87_find(unsigned short *address,
1297 chip_type, *address, sio_data->revision);
1298
1299 /* Read GPIO config and VID value from LDN 7 (GPIO) */
1300 - if (chip_type != IT8705F_DEVID) {
1301 + if (sio_data->type != it87) {
1302 int reg;
1303
1304 superio_select(GPIO);
1305 - if ((chip_type == it8718) ||
1306 - (chip_type == it8720))
1307 + if (sio_data->type == it8718 || sio_data->type == it8720)
1308 sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
1309
1310 reg = superio_inb(IT87_SIO_PINX2_REG);
1311 diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
1312 index 19984bf..c65e245 100644
1313 --- a/drivers/input/mouse/synaptics.c
1314 +++ b/drivers/input/mouse/synaptics.c
1315 @@ -652,6 +652,16 @@ static const struct dmi_system_id toshiba_dmi_table[] = {
1316 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1317 DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"),
1318 },
1319 +
1320 + },
1321 + {
1322 + .ident = "Toshiba Portege M300",
1323 + .matches = {
1324 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1325 + DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"),
1326 + DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"),
1327 + },
1328 +
1329 },
1330 { }
1331 };
1332 diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
1333 index b40fb9b..6f308a4 100644
1334 --- a/drivers/macintosh/via-pmu.c
1335 +++ b/drivers/macintosh/via-pmu.c
1336 @@ -405,7 +405,11 @@ static int __init via_pmu_start(void)
1337 printk(KERN_ERR "via-pmu: can't map interrupt\n");
1338 return -ENODEV;
1339 }
1340 - if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) {
1341 + /* We set IRQF_TIMER because we don't want the interrupt to be disabled
1342 + * between the 2 passes of driver suspend, we control our own disabling
1343 + * for that one
1344 + */
1345 + if (request_irq(irq, via_pmu_interrupt, IRQF_TIMER, "VIA-PMU", (void *)0)) {
1346 printk(KERN_ERR "via-pmu: can't request irq %d\n", irq);
1347 return -ENODEV;
1348 }
1349 @@ -419,7 +423,7 @@ static int __init via_pmu_start(void)
1350 gpio_irq = irq_of_parse_and_map(gpio_node, 0);
1351
1352 if (gpio_irq != NO_IRQ) {
1353 - if (request_irq(gpio_irq, gpio1_interrupt, 0,
1354 + if (request_irq(gpio_irq, gpio1_interrupt, IRQF_TIMER,
1355 "GPIO1 ADB", (void *)0))
1356 printk(KERN_ERR "pmu: can't get irq %d"
1357 " (GPIO1)\n", gpio_irq);
1358 @@ -925,8 +929,7 @@ proc_write_options(struct file *file, const char __user *buffer,
1359
1360 #ifdef CONFIG_ADB
1361 /* Send an ADB command */
1362 -static int
1363 -pmu_send_request(struct adb_request *req, int sync)
1364 +static int pmu_send_request(struct adb_request *req, int sync)
1365 {
1366 int i, ret;
1367
1368 @@ -1005,16 +1008,11 @@ pmu_send_request(struct adb_request *req, int sync)
1369 }
1370
1371 /* Enable/disable autopolling */
1372 -static int
1373 -pmu_adb_autopoll(int devs)
1374 +static int __pmu_adb_autopoll(int devs)
1375 {
1376 struct adb_request req;
1377
1378 - if ((vias == NULL) || (!pmu_fully_inited) || !pmu_has_adb)
1379 - return -ENXIO;
1380 -
1381 if (devs) {
1382 - adb_dev_map = devs;
1383 pmu_request(&req, NULL, 5, PMU_ADB_CMD, 0, 0x86,
1384 adb_dev_map >> 8, adb_dev_map);
1385 pmu_adb_flags = 2;
1386 @@ -1027,9 +1025,17 @@ pmu_adb_autopoll(int devs)
1387 return 0;
1388 }
1389
1390 +static int pmu_adb_autopoll(int devs)
1391 +{
1392 + if ((vias == NULL) || (!pmu_fully_inited) || !pmu_has_adb)
1393 + return -ENXIO;
1394 +
1395 + adb_dev_map = devs;
1396 + return __pmu_adb_autopoll(devs);
1397 +}
1398 +
1399 /* Reset the ADB bus */
1400 -static int
1401 -pmu_adb_reset_bus(void)
1402 +static int pmu_adb_reset_bus(void)
1403 {
1404 struct adb_request req;
1405 int save_autopoll = adb_dev_map;
1406 @@ -1038,13 +1044,13 @@ pmu_adb_reset_bus(void)
1407 return -ENXIO;
1408
1409 /* anyone got a better idea?? */
1410 - pmu_adb_autopoll(0);
1411 + __pmu_adb_autopoll(0);
1412
1413 - req.nbytes = 5;
1414 + req.nbytes = 4;
1415 req.done = NULL;
1416 req.data[0] = PMU_ADB_CMD;
1417 - req.data[1] = 0;
1418 - req.data[2] = ADB_BUSRESET;
1419 + req.data[1] = ADB_BUSRESET;
1420 + req.data[2] = 0;
1421 req.data[3] = 0;
1422 req.data[4] = 0;
1423 req.reply_len = 0;
1424 @@ -1056,7 +1062,7 @@ pmu_adb_reset_bus(void)
1425 pmu_wait_complete(&req);
1426
1427 if (save_autopoll != 0)
1428 - pmu_adb_autopoll(save_autopoll);
1429 + __pmu_adb_autopoll(save_autopoll);
1430
1431 return 0;
1432 }
1433 diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
1434 index 556acff..932d1b1 100644
1435 --- a/drivers/md/dm-exception-store.c
1436 +++ b/drivers/md/dm-exception-store.c
1437 @@ -155,7 +155,8 @@ static int set_chunk_size(struct dm_exception_store *store,
1438 char *value;
1439
1440 chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10);
1441 - if (*chunk_size_arg == '\0' || *value != '\0') {
1442 + if (*chunk_size_arg == '\0' || *value != '\0' ||
1443 + chunk_size_ulong > UINT_MAX) {
1444 *error = "Invalid chunk size";
1445 return -EINVAL;
1446 }
1447 @@ -171,34 +172,35 @@ static int set_chunk_size(struct dm_exception_store *store,
1448 */
1449 chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9);
1450
1451 - return dm_exception_store_set_chunk_size(store, chunk_size_ulong,
1452 + return dm_exception_store_set_chunk_size(store,
1453 + (unsigned) chunk_size_ulong,
1454 error);
1455 }
1456
1457 int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
1458 - unsigned long chunk_size_ulong,
1459 + unsigned chunk_size,
1460 char **error)
1461 {
1462 /* Check chunk_size is a power of 2 */
1463 - if (!is_power_of_2(chunk_size_ulong)) {
1464 + if (!is_power_of_2(chunk_size)) {
1465 *error = "Chunk size is not a power of 2";
1466 return -EINVAL;
1467 }
1468
1469 /* Validate the chunk size against the device block size */
1470 - if (chunk_size_ulong % (bdev_logical_block_size(store->cow->bdev) >> 9)) {
1471 + if (chunk_size % (bdev_logical_block_size(store->cow->bdev) >> 9)) {
1472 *error = "Chunk size is not a multiple of device blocksize";
1473 return -EINVAL;
1474 }
1475
1476 - if (chunk_size_ulong > INT_MAX >> SECTOR_SHIFT) {
1477 + if (chunk_size > INT_MAX >> SECTOR_SHIFT) {
1478 *error = "Chunk size is too high";
1479 return -EINVAL;
1480 }
1481
1482 - store->chunk_size = chunk_size_ulong;
1483 - store->chunk_mask = chunk_size_ulong - 1;
1484 - store->chunk_shift = ffs(chunk_size_ulong) - 1;
1485 + store->chunk_size = chunk_size;
1486 + store->chunk_mask = chunk_size - 1;
1487 + store->chunk_shift = ffs(chunk_size) - 1;
1488
1489 return 0;
1490 }
1491 @@ -251,7 +253,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
1492
1493 r = set_chunk_size(tmp_store, argv[2], &ti->error);
1494 if (r)
1495 - goto bad_cow;
1496 + goto bad_ctr;
1497
1498 r = type->ctr(tmp_store, 0, NULL);
1499 if (r) {
1500 diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
1501 index 812c718..8a223a4 100644
1502 --- a/drivers/md/dm-exception-store.h
1503 +++ b/drivers/md/dm-exception-store.h
1504 @@ -101,9 +101,9 @@ struct dm_exception_store {
1505 struct dm_dev *cow;
1506
1507 /* Size of data blocks saved - must be a power of 2 */
1508 - chunk_t chunk_size;
1509 - chunk_t chunk_mask;
1510 - chunk_t chunk_shift;
1511 + unsigned chunk_size;
1512 + unsigned chunk_mask;
1513 + unsigned chunk_shift;
1514
1515 void *context;
1516 };
1517 @@ -169,7 +169,7 @@ int dm_exception_store_type_register(struct dm_exception_store_type *type);
1518 int dm_exception_store_type_unregister(struct dm_exception_store_type *type);
1519
1520 int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
1521 - unsigned long chunk_size_ulong,
1522 + unsigned chunk_size,
1523 char **error);
1524
1525 int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
1526 diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
1527 index 652bd33..7ac2c14 100644
1528 --- a/drivers/md/dm-log-userspace-base.c
1529 +++ b/drivers/md/dm-log-userspace-base.c
1530 @@ -156,7 +156,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
1531 }
1532
1533 /* The ptr value is sufficient for local unique id */
1534 - lc->luid = (uint64_t)lc;
1535 + lc->luid = (unsigned long)lc;
1536
1537 lc->ti = ti;
1538
1539 diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
1540 index d5b2e08..0c74642 100644
1541 --- a/drivers/md/dm-snap-persistent.c
1542 +++ b/drivers/md/dm-snap-persistent.c
1543 @@ -284,12 +284,13 @@ static int read_header(struct pstore *ps, int *new_snapshot)
1544 {
1545 int r;
1546 struct disk_header *dh;
1547 - chunk_t chunk_size;
1548 + unsigned chunk_size;
1549 int chunk_size_supplied = 1;
1550 char *chunk_err;
1551
1552 /*
1553 - * Use default chunk size (or hardsect_size, if larger) if none supplied
1554 + * Use default chunk size (or logical_block_size, if larger)
1555 + * if none supplied
1556 */
1557 if (!ps->store->chunk_size) {
1558 ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS,
1559 @@ -334,10 +335,9 @@ static int read_header(struct pstore *ps, int *new_snapshot)
1560 return 0;
1561
1562 if (chunk_size_supplied)
1563 - DMWARN("chunk size %llu in device metadata overrides "
1564 - "table chunk size of %llu.",
1565 - (unsigned long long)chunk_size,
1566 - (unsigned long long)ps->store->chunk_size);
1567 + DMWARN("chunk size %u in device metadata overrides "
1568 + "table chunk size of %u.",
1569 + chunk_size, ps->store->chunk_size);
1570
1571 /* We had a bogus chunk_size. Fix stuff up. */
1572 free_area(ps);
1573 @@ -345,8 +345,8 @@ static int read_header(struct pstore *ps, int *new_snapshot)
1574 r = dm_exception_store_set_chunk_size(ps->store, chunk_size,
1575 &chunk_err);
1576 if (r) {
1577 - DMERR("invalid on-disk chunk size %llu: %s.",
1578 - (unsigned long long)chunk_size, chunk_err);
1579 + DMERR("invalid on-disk chunk size %u: %s.",
1580 + chunk_size, chunk_err);
1581 return r;
1582 }
1583
1584 diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
1585 index 57f1bf7..3a3ba46 100644
1586 --- a/drivers/md/dm-snap.c
1587 +++ b/drivers/md/dm-snap.c
1588 @@ -296,6 +296,7 @@ static void __insert_origin(struct origin *o)
1589 */
1590 static int register_snapshot(struct dm_snapshot *snap)
1591 {
1592 + struct dm_snapshot *l;
1593 struct origin *o, *new_o;
1594 struct block_device *bdev = snap->origin->bdev;
1595
1596 @@ -319,7 +320,11 @@ static int register_snapshot(struct dm_snapshot *snap)
1597 __insert_origin(o);
1598 }
1599
1600 - list_add_tail(&snap->list, &o->snapshots);
1601 + /* Sort the list according to chunk size, largest-first smallest-last */
1602 + list_for_each_entry(l, &o->snapshots, list)
1603 + if (l->store->chunk_size < snap->store->chunk_size)
1604 + break;
1605 + list_add_tail(&snap->list, &l->list);
1606
1607 up_write(&_origins_lock);
1608 return 0;
1609 @@ -668,6 +673,11 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1610 bio_list_init(&s->queued_bios);
1611 INIT_WORK(&s->queued_bios_work, flush_queued_bios);
1612
1613 + if (!s->store->chunk_size) {
1614 + ti->error = "Chunk size not set";
1615 + goto bad_load_and_register;
1616 + }
1617 +
1618 /* Add snapshot to the list of snapshots for this origin */
1619 /* Exceptions aren't triggered till snapshot_resume() is called */
1620 if (register_snapshot(s)) {
1621 @@ -951,7 +961,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
1622
1623 src.bdev = bdev;
1624 src.sector = chunk_to_sector(s->store, pe->e.old_chunk);
1625 - src.count = min(s->store->chunk_size, dev_size - src.sector);
1626 + src.count = min((sector_t)s->store->chunk_size, dev_size - src.sector);
1627
1628 dest.bdev = s->store->cow->bdev;
1629 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk);
1630 @@ -1142,6 +1152,8 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
1631 unsigned sz = 0;
1632 struct dm_snapshot *snap = ti->private;
1633
1634 + down_write(&snap->lock);
1635 +
1636 switch (type) {
1637 case STATUSTYPE_INFO:
1638 if (!snap->valid)
1639 @@ -1173,6 +1185,8 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
1640 break;
1641 }
1642
1643 + up_write(&snap->lock);
1644 +
1645 return 0;
1646 }
1647
1648 @@ -1388,7 +1402,7 @@ static void origin_resume(struct dm_target *ti)
1649 struct dm_dev *dev = ti->private;
1650 struct dm_snapshot *snap;
1651 struct origin *o;
1652 - chunk_t chunk_size = 0;
1653 + unsigned chunk_size = 0;
1654
1655 down_read(&_origins_lock);
1656 o = __lookup_origin(dev->bdev);
1657 @@ -1465,7 +1479,7 @@ static int __init dm_snapshot_init(void)
1658 r = dm_register_target(&snapshot_target);
1659 if (r) {
1660 DMERR("snapshot target register failed %d", r);
1661 - return r;
1662 + goto bad_register_snapshot_target;
1663 }
1664
1665 r = dm_register_target(&origin_target);
1666 @@ -1522,6 +1536,9 @@ bad2:
1667 dm_unregister_target(&origin_target);
1668 bad1:
1669 dm_unregister_target(&snapshot_target);
1670 +
1671 +bad_register_snapshot_target:
1672 + dm_exception_store_exit();
1673 return r;
1674 }
1675
1676 diff --git a/drivers/md/dm.c b/drivers/md/dm.c
1677 index b4845b1..ae087b0 100644
1678 --- a/drivers/md/dm.c
1679 +++ b/drivers/md/dm.c
1680 @@ -47,6 +47,7 @@ struct dm_io {
1681 atomic_t io_count;
1682 struct bio *bio;
1683 unsigned long start_time;
1684 + spinlock_t endio_lock;
1685 };
1686
1687 /*
1688 @@ -576,8 +577,12 @@ static void dec_pending(struct dm_io *io, int error)
1689 struct mapped_device *md = io->md;
1690
1691 /* Push-back supersedes any I/O errors */
1692 - if (error && !(io->error > 0 && __noflush_suspending(md)))
1693 - io->error = error;
1694 + if (unlikely(error)) {
1695 + spin_lock_irqsave(&io->endio_lock, flags);
1696 + if (!(io->error > 0 && __noflush_suspending(md)))
1697 + io->error = error;
1698 + spin_unlock_irqrestore(&io->endio_lock, flags);
1699 + }
1700
1701 if (atomic_dec_and_test(&io->io_count)) {
1702 if (io->error == DM_ENDIO_REQUEUE) {
1703 @@ -1224,6 +1229,7 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio)
1704 atomic_set(&ci.io->io_count, 1);
1705 ci.io->bio = bio;
1706 ci.io->md = md;
1707 + spin_lock_init(&ci.io->endio_lock);
1708 ci.sector = bio->bi_sector;
1709 ci.sector_count = bio_sectors(bio);
1710 if (unlikely(bio_empty_barrier(bio)))
1711 @@ -1819,6 +1825,7 @@ static struct mapped_device *alloc_dev(int minor)
1712 bad_bdev:
1713 destroy_workqueue(md->wq);
1714 bad_thread:
1715 + del_gendisk(md->disk);
1716 put_disk(md->disk);
1717 bad_disk:
1718 blk_cleanup_queue(md->queue);
1719 diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
1720 index 9cbf95b..de530d9 100644
1721 --- a/drivers/misc/sgi-gru/gruprocfs.c
1722 +++ b/drivers/misc/sgi-gru/gruprocfs.c
1723 @@ -161,14 +161,15 @@ static int options_show(struct seq_file *s, void *p)
1724 static ssize_t options_write(struct file *file, const char __user *userbuf,
1725 size_t count, loff_t *data)
1726 {
1727 - unsigned long val;
1728 - char buf[80];
1729 + char buf[20];
1730
1731 - if (strncpy_from_user(buf, userbuf, sizeof(buf) - 1) < 0)
1732 + if (count >= sizeof(buf))
1733 + return -EINVAL;
1734 + if (copy_from_user(buf, userbuf, count))
1735 return -EFAULT;
1736 - buf[count - 1] = '\0';
1737 - if (!strict_strtoul(buf, 10, &val))
1738 - gru_options = val;
1739 + buf[count] = '\0';
1740 + if (strict_strtoul(buf, 0, &gru_options))
1741 + return -EINVAL;
1742
1743 return count;
1744 }
1745 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
1746 index aa1be1f..7029d53 100644
1747 --- a/drivers/net/bonding/bond_main.c
1748 +++ b/drivers/net/bonding/bond_main.c
1749 @@ -691,7 +691,7 @@ static int bond_check_dev_link(struct bonding *bond,
1750 struct net_device *slave_dev, int reporting)
1751 {
1752 const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
1753 - static int (*ioctl)(struct net_device *, struct ifreq *, int);
1754 + int (*ioctl)(struct net_device *, struct ifreq *, int);
1755 struct ifreq ifr;
1756 struct mii_ioctl_data *mii;
1757
1758 diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
1759 index 31e5599..dcde92d 100644
1760 --- a/drivers/net/wireless/b43/rfkill.c
1761 +++ b/drivers/net/wireless/b43/rfkill.c
1762 @@ -33,7 +33,8 @@ bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
1763 & B43_MMIO_RADIO_HWENABLED_HI_MASK))
1764 return 1;
1765 } else {
1766 - if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
1767 + if (b43_status(dev) >= B43_STAT_STARTED &&
1768 + b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
1769 & B43_MMIO_RADIO_HWENABLED_LO_MASK)
1770 return 1;
1771 }
1772 diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
1773 index 2b8d40b..a13f678 100644
1774 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c
1775 +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
1776 @@ -239,33 +239,51 @@ void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1777 struct iwl_rx_queue *rxq = &priv->rxq;
1778 struct list_head *element;
1779 struct iwl_rx_mem_buffer *rxb;
1780 + struct sk_buff *skb;
1781 unsigned long flags;
1782
1783 while (1) {
1784 spin_lock_irqsave(&rxq->lock, flags);
1785 -
1786 if (list_empty(&rxq->rx_used)) {
1787 spin_unlock_irqrestore(&rxq->lock, flags);
1788 return;
1789 }
1790 - element = rxq->rx_used.next;
1791 - rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1792 - list_del(element);
1793 -
1794 spin_unlock_irqrestore(&rxq->lock, flags);
1795
1796 + if (rxq->free_count > RX_LOW_WATERMARK)
1797 + priority |= __GFP_NOWARN;
1798 /* Alloc a new receive buffer */
1799 - rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
1800 + skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
1801 priority);
1802
1803 - if (!rxb->skb) {
1804 - IWL_CRIT(priv, "Can not allocate SKB buffers\n");
1805 + if (!skb) {
1806 + if (net_ratelimit())
1807 + IWL_DEBUG_INFO(priv, "Failed to allocate SKB buffer.\n");
1808 + if ((rxq->free_count <= RX_LOW_WATERMARK) &&
1809 + net_ratelimit())
1810 + IWL_CRIT(priv, "Failed to allocate SKB buffer with %s. Only %u free buffers remaining.\n",
1811 + priority == GFP_ATOMIC ? "GFP_ATOMIC" : "GFP_KERNEL",
1812 + rxq->free_count);
1813 /* We don't reschedule replenish work here -- we will
1814 * call the restock method and if it still needs
1815 * more buffers it will schedule replenish */
1816 break;
1817 }
1818
1819 + spin_lock_irqsave(&rxq->lock, flags);
1820 +
1821 + if (list_empty(&rxq->rx_used)) {
1822 + spin_unlock_irqrestore(&rxq->lock, flags);
1823 + dev_kfree_skb_any(skb);
1824 + return;
1825 + }
1826 + element = rxq->rx_used.next;
1827 + rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1828 + list_del(element);
1829 +
1830 + spin_unlock_irqrestore(&rxq->lock, flags);
1831 +
1832 + rxb->skb = skb;
1833 /* Get physical address of RB/SKB */
1834 rxb->real_dma_addr = pci_map_single(
1835 priv->pci_dev,
1836 diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
1837 index 054d6c7..4fac582 100644
1838 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
1839 +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
1840 @@ -1196,6 +1196,7 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1841 struct iwl_rx_queue *rxq = &priv->rxq;
1842 struct list_head *element;
1843 struct iwl_rx_mem_buffer *rxb;
1844 + struct sk_buff *skb;
1845 unsigned long flags;
1846
1847 while (1) {
1848 @@ -1205,25 +1206,39 @@ static void iwl3945_rx_allocate(struct iwl_priv *priv, gfp_t priority)
1849 spin_unlock_irqrestore(&rxq->lock, flags);
1850 return;
1851 }
1852 -
1853 - element = rxq->rx_used.next;
1854 - rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1855 - list_del(element);
1856 spin_unlock_irqrestore(&rxq->lock, flags);
1857
1858 + if (rxq->free_count > RX_LOW_WATERMARK)
1859 + priority |= __GFP_NOWARN;
1860 /* Alloc a new receive buffer */
1861 - rxb->skb =
1862 - alloc_skb(priv->hw_params.rx_buf_size,
1863 - priority);
1864 - if (!rxb->skb) {
1865 + skb = alloc_skb(priv->hw_params.rx_buf_size, priority);
1866 + if (!skb) {
1867 if (net_ratelimit())
1868 - IWL_CRIT(priv, ": Can not allocate SKB buffers\n");
1869 + IWL_DEBUG_INFO(priv, "Failed to allocate SKB buffer.\n");
1870 + if ((rxq->free_count <= RX_LOW_WATERMARK) &&
1871 + net_ratelimit())
1872 + IWL_CRIT(priv, "Failed to allocate SKB buffer with %s. Only %u free buffers remaining.\n",
1873 + priority == GFP_ATOMIC ? "GFP_ATOMIC" : "GFP_KERNEL",
1874 + rxq->free_count);
1875 /* We don't reschedule replenish work here -- we will
1876 * call the restock method and if it still needs
1877 * more buffers it will schedule replenish */
1878 break;
1879 }
1880
1881 + spin_lock_irqsave(&rxq->lock, flags);
1882 + if (list_empty(&rxq->rx_used)) {
1883 + spin_unlock_irqrestore(&rxq->lock, flags);
1884 + dev_kfree_skb_any(skb);
1885 + return;
1886 + }
1887 + element = rxq->rx_used.next;
1888 + rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
1889 + list_del(element);
1890 + spin_unlock_irqrestore(&rxq->lock, flags);
1891 +
1892 + rxb->skb = skb;
1893 +
1894 /* If radiotap head is required, reserve some headroom here.
1895 * The physical head count is a variable rx_stats->phy_count.
1896 * We reserve 4 bytes here. Plus these extra bytes, the
1897 diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
1898 index 1844c5a..3a9a8c1 100644
1899 --- a/drivers/net/wireless/libertas/if_usb.c
1900 +++ b/drivers/net/wireless/libertas/if_usb.c
1901 @@ -507,7 +507,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
1902 /* Fill the receive configuration URB and initialise the Rx call back */
1903 usb_fill_bulk_urb(cardp->rx_urb, cardp->udev,
1904 usb_rcvbulkpipe(cardp->udev, cardp->ep_in),
1905 - (void *) (skb->tail + (size_t) IPFIELD_ALIGN_OFFSET),
1906 + skb->data + IPFIELD_ALIGN_OFFSET,
1907 MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn,
1908 cardp);
1909
1910 diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
1911 index 698b11b..8c67a48 100644
1912 --- a/drivers/net/wireless/ray_cs.c
1913 +++ b/drivers/net/wireless/ray_cs.c
1914 @@ -2878,7 +2878,7 @@ static int write_essid(struct file *file, const char __user *buffer,
1915 unsigned long count, void *data)
1916 {
1917 static char proc_essid[33];
1918 - int len = count;
1919 + unsigned int len = count;
1920
1921 if (len > 32)
1922 len = 32;
1923 diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
1924 index 934d4be..698d75c 100644
1925 --- a/drivers/pcmcia/cs.c
1926 +++ b/drivers/pcmcia/cs.c
1927 @@ -98,10 +98,13 @@ EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
1928 * These functions check for the appropriate struct pcmcia_soket arrays,
1929 * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
1930 */
1931 +static int socket_early_resume(struct pcmcia_socket *skt);
1932 +static int socket_late_resume(struct pcmcia_socket *skt);
1933 static int socket_resume(struct pcmcia_socket *skt);
1934 static int socket_suspend(struct pcmcia_socket *skt);
1935
1936 -int pcmcia_socket_dev_suspend(struct device *dev)
1937 +static void pcmcia_socket_dev_run(struct device *dev,
1938 + int (*cb)(struct pcmcia_socket *))
1939 {
1940 struct pcmcia_socket *socket;
1941
1942 @@ -110,29 +113,34 @@ int pcmcia_socket_dev_suspend(struct device *dev)
1943 if (socket->dev.parent != dev)
1944 continue;
1945 mutex_lock(&socket->skt_mutex);
1946 - socket_suspend(socket);
1947 + cb(socket);
1948 mutex_unlock(&socket->skt_mutex);
1949 }
1950 up_read(&pcmcia_socket_list_rwsem);
1951 +}
1952
1953 +int pcmcia_socket_dev_suspend(struct device *dev)
1954 +{
1955 + pcmcia_socket_dev_run(dev, socket_suspend);
1956 return 0;
1957 }
1958 EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
1959
1960 -int pcmcia_socket_dev_resume(struct device *dev)
1961 +void pcmcia_socket_dev_early_resume(struct device *dev)
1962 {
1963 - struct pcmcia_socket *socket;
1964 + pcmcia_socket_dev_run(dev, socket_early_resume);
1965 +}
1966 +EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
1967
1968 - down_read(&pcmcia_socket_list_rwsem);
1969 - list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
1970 - if (socket->dev.parent != dev)
1971 - continue;
1972 - mutex_lock(&socket->skt_mutex);
1973 - socket_resume(socket);
1974 - mutex_unlock(&socket->skt_mutex);
1975 - }
1976 - up_read(&pcmcia_socket_list_rwsem);
1977 +void pcmcia_socket_dev_late_resume(struct device *dev)
1978 +{
1979 + pcmcia_socket_dev_run(dev, socket_late_resume);
1980 +}
1981 +EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
1982
1983 +int pcmcia_socket_dev_resume(struct device *dev)
1984 +{
1985 + pcmcia_socket_dev_run(dev, socket_resume);
1986 return 0;
1987 }
1988 EXPORT_SYMBOL(pcmcia_socket_dev_resume);
1989 @@ -546,29 +554,24 @@ static int socket_suspend(struct pcmcia_socket *skt)
1990 return 0;
1991 }
1992
1993 -/*
1994 - * Resume a socket. If a card is present, verify its CIS against
1995 - * our cached copy. If they are different, the card has been
1996 - * replaced, and we need to tell the drivers.
1997 - */
1998 -static int socket_resume(struct pcmcia_socket *skt)
1999 +static int socket_early_resume(struct pcmcia_socket *skt)
2000 {
2001 - int ret;
2002 -
2003 - if (!(skt->state & SOCKET_SUSPEND))
2004 - return -EBUSY;
2005 -
2006 skt->socket = dead_socket;
2007 skt->ops->init(skt);
2008 skt->ops->set_socket(skt, &skt->socket);
2009 + if (skt->state & SOCKET_PRESENT)
2010 + skt->resume_status = socket_setup(skt, resume_delay);
2011 + return 0;
2012 +}
2013
2014 +static int socket_late_resume(struct pcmcia_socket *skt)
2015 +{
2016 if (!(skt->state & SOCKET_PRESENT)) {
2017 skt->state &= ~SOCKET_SUSPEND;
2018 return socket_insert(skt);
2019 }
2020
2021 - ret = socket_setup(skt, resume_delay);
2022 - if (ret == 0) {
2023 + if (skt->resume_status == 0) {
2024 /*
2025 * FIXME: need a better check here for cardbus cards.
2026 */
2027 @@ -596,6 +599,20 @@ static int socket_resume(struct pcmcia_socket *skt)
2028 return 0;
2029 }
2030
2031 +/*
2032 + * Resume a socket. If a card is present, verify its CIS against
2033 + * our cached copy. If they are different, the card has been
2034 + * replaced, and we need to tell the drivers.
2035 + */
2036 +static int socket_resume(struct pcmcia_socket *skt)
2037 +{
2038 + if (!(skt->state & SOCKET_SUSPEND))
2039 + return -EBUSY;
2040 +
2041 + socket_early_resume(skt);
2042 + return socket_late_resume(skt);
2043 +}
2044 +
2045 static void socket_remove(struct pcmcia_socket *skt)
2046 {
2047 dev_printk(KERN_NOTICE, &skt->dev,
2048 diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
2049 index f728a45..bcebffb 100644
2050 --- a/drivers/pcmcia/yenta_socket.c
2051 +++ b/drivers/pcmcia/yenta_socket.c
2052 @@ -1275,16 +1275,26 @@ static int yenta_dev_resume_noirq(struct device *dev)
2053 if (socket->type && socket->type->restore_state)
2054 socket->type->restore_state(socket);
2055
2056 - return pcmcia_socket_dev_resume(dev);
2057 + pcmcia_socket_dev_early_resume(dev);
2058 + return 0;
2059 +}
2060 +
2061 +static int yenta_dev_resume(struct device *dev)
2062 +{
2063 + pcmcia_socket_dev_late_resume(dev);
2064 + return 0;
2065 }
2066
2067 static struct dev_pm_ops yenta_pm_ops = {
2068 .suspend_noirq = yenta_dev_suspend_noirq,
2069 .resume_noirq = yenta_dev_resume_noirq,
2070 + .resume = yenta_dev_resume,
2071 .freeze_noirq = yenta_dev_suspend_noirq,
2072 .thaw_noirq = yenta_dev_resume_noirq,
2073 + .thaw = yenta_dev_resume,
2074 .poweroff_noirq = yenta_dev_suspend_noirq,
2075 .restore_noirq = yenta_dev_resume_noirq,
2076 + .restore = yenta_dev_resume,
2077 };
2078
2079 #define YENTA_PM_OPS (&yenta_pm_ops)
2080 diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
2081 index b6af63c..4967643 100644
2082 --- a/drivers/scsi/dpt_i2o.c
2083 +++ b/drivers/scsi/dpt_i2o.c
2084 @@ -1918,6 +1918,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
2085 }
2086 size = size>>16;
2087 size *= 4;
2088 + if (size > MAX_MESSAGE_SIZE) {
2089 + rcode = -EINVAL;
2090 + goto cleanup;
2091 + }
2092 /* Copy in the user's I2O command */
2093 if (copy_from_user (msg, user_msg, size)) {
2094 rcode = -EFAULT;
2095 diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
2096 index e7108e7..7b5ff09 100644
2097 --- a/drivers/serial/8250_pci.c
2098 +++ b/drivers/serial/8250_pci.c
2099 @@ -1561,6 +1561,7 @@ enum pci_board_num_t {
2100 pbn_exar_XR17C152,
2101 pbn_exar_XR17C154,
2102 pbn_exar_XR17C158,
2103 + pbn_exar_ibm_saturn,
2104 pbn_pasemi_1682M,
2105 pbn_ni8430_2,
2106 pbn_ni8430_4,
2107 @@ -2146,6 +2147,13 @@ static struct pciserial_board pci_boards[] __devinitdata = {
2108 .base_baud = 921600,
2109 .uart_offset = 0x200,
2110 },
2111 + [pbn_exar_ibm_saturn] = {
2112 + .flags = FL_BASE0,
2113 + .num_ports = 1,
2114 + .base_baud = 921600,
2115 + .uart_offset = 0x200,
2116 + },
2117 +
2118 /*
2119 * PA Semi PWRficient PA6T-1682M on-chip UART
2120 */
2121 @@ -2649,6 +2657,9 @@ static struct pci_device_id serial_pci_tbl[] = {
2122 PCI_SUBVENDOR_ID_CONNECT_TECH,
2123 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
2124 pbn_b0_8_1843200_200 },
2125 + { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2126 + PCI_VENDOR_ID_IBM, PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT,
2127 + 0, 0, pbn_exar_ibm_saturn },
2128
2129 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
2130 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2131 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
2132 index 20b0788..7c99185 100644
2133 --- a/drivers/usb/serial/option.c
2134 +++ b/drivers/usb/serial/option.c
2135 @@ -166,6 +166,7 @@ static int option_resume(struct usb_serial *serial);
2136 #define HUAWEI_PRODUCT_E143D 0x143D
2137 #define HUAWEI_PRODUCT_E143E 0x143E
2138 #define HUAWEI_PRODUCT_E143F 0x143F
2139 +#define HUAWEI_PRODUCT_E14AC 0x14AC
2140
2141 #define QUANTA_VENDOR_ID 0x0408
2142 #define QUANTA_PRODUCT_Q101 0xEA02
2143 @@ -315,6 +316,9 @@ static int option_resume(struct usb_serial *serial);
2144 #define QISDA_PRODUCT_H20_4515 0x4515
2145 #define QISDA_PRODUCT_H20_4519 0x4519
2146
2147 +/* TLAYTECH PRODUCTS */
2148 +#define TLAYTECH_VENDOR_ID 0x20B9
2149 +#define TLAYTECH_PRODUCT_TEU800 0x1682
2150
2151 /* TOSHIBA PRODUCTS */
2152 #define TOSHIBA_VENDOR_ID 0x0930
2153 @@ -328,6 +332,9 @@ static int option_resume(struct usb_serial *serial);
2154 #define ALCATEL_VENDOR_ID 0x1bbb
2155 #define ALCATEL_PRODUCT_X060S 0x0000
2156
2157 +/* Airplus products */
2158 +#define AIRPLUS_VENDOR_ID 0x1011
2159 +#define AIRPLUS_PRODUCT_MCD650 0x3198
2160
2161 static struct usb_device_id option_ids[] = {
2162 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
2163 @@ -426,6 +433,7 @@ static struct usb_device_id option_ids[] = {
2164 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
2165 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
2166 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
2167 + { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) },
2168 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
2169 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
2170 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */
2171 @@ -588,6 +596,8 @@ static struct usb_device_id option_ids[] = {
2172 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) },
2173 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) },
2174 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
2175 + { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
2176 + { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
2177 { } /* Terminating entry */
2178 };
2179 MODULE_DEVICE_TABLE(usb, option_ids);
2180 diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
2181 index f48d05e..c5fbaa5 100644
2182 --- a/drivers/usb/serial/sierra.c
2183 +++ b/drivers/usb/serial/sierra.c
2184 @@ -287,6 +287,8 @@ static int sierra_send_setup(struct usb_serial_port *port)
2185 struct sierra_port_private *portdata;
2186 __u16 interface = 0;
2187 int val = 0;
2188 + int do_send = 0;
2189 + int retval;
2190
2191 dev_dbg(&port->dev, "%s\n", __func__);
2192
2193 @@ -305,10 +307,7 @@ static int sierra_send_setup(struct usb_serial_port *port)
2194 */
2195 if (port->interrupt_in_urb) {
2196 /* send control message */
2197 - return usb_control_msg(serial->dev,
2198 - usb_rcvctrlpipe(serial->dev, 0),
2199 - 0x22, 0x21, val, interface,
2200 - NULL, 0, USB_CTRL_SET_TIMEOUT);
2201 + do_send = 1;
2202 }
2203 }
2204
2205 @@ -320,12 +319,18 @@ static int sierra_send_setup(struct usb_serial_port *port)
2206 interface = 1;
2207 else if (port->bulk_out_endpointAddress == 5)
2208 interface = 2;
2209 - return usb_control_msg(serial->dev,
2210 - usb_rcvctrlpipe(serial->dev, 0),
2211 - 0x22, 0x21, val, interface,
2212 - NULL, 0, USB_CTRL_SET_TIMEOUT);
2213 +
2214 + do_send = 1;
2215 }
2216 - return 0;
2217 + if (!do_send)
2218 + return 0;
2219 +
2220 + usb_autopm_get_interface(serial->interface);
2221 + retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
2222 + 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT);
2223 + usb_autopm_put_interface(serial->interface);
2224 +
2225 + return retval;
2226 }
2227
2228 static void sierra_set_termios(struct tty_struct *tty,
2229 diff --git a/drivers/video/console/.gitignore b/drivers/video/console/.gitignore
2230 deleted file mode 100644
2231 index 0c258b4..0000000
2232 --- a/drivers/video/console/.gitignore
2233 +++ /dev/null
2234 @@ -1,2 +0,0 @@
2235 -# conmakehash generated file
2236 -promcon_tbl.c
2237 diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
2238 index 2f50a80..979b5a1 100644
2239 --- a/drivers/video/console/Kconfig
2240 +++ b/drivers/video/console/Kconfig
2241 @@ -67,16 +67,9 @@ config SGI_NEWPORT_CONSOLE
2242
2243 # bool 'IODC console' CONFIG_IODC_CONSOLE
2244
2245 -config PROM_CONSOLE
2246 - bool "PROM console"
2247 - depends on SPARC
2248 - help
2249 - Say Y to build a console driver for Sun machines that uses the
2250 - terminal emulation built into their console PROMS.
2251 -
2252 config DUMMY_CONSOLE
2253 bool
2254 - depends on PROM_CONSOLE!=y || VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y
2255 + depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y
2256 default y
2257
2258 config DUMMY_CONSOLE_COLUMNS
2259 diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
2260 index ac46cc3..a862e91 100644
2261 --- a/drivers/video/console/Makefile
2262 +++ b/drivers/video/console/Makefile
2263 @@ -22,7 +22,6 @@ font-objs += $(font-objs-y)
2264
2265 obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
2266 obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o
2267 -obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
2268 obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o font.o
2269 obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
2270 obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
2271 @@ -40,14 +39,3 @@ obj-$(CONFIG_FB_STI) += sticore.o font.o
2272 ifeq ($(CONFIG_USB_SISUSBVGA_CON),y)
2273 obj-$(CONFIG_USB_SISUSBVGA) += font.o
2274 endif
2275 -
2276 -# Targets that kbuild needs to know about
2277 -targets := promcon_tbl.c
2278 -
2279 -quiet_cmd_conmakehash = CNMKHSH $@
2280 - cmd_conmakehash = scripts/conmakehash $< | \
2281 - sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
2282 - -e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@
2283 -
2284 -$(obj)/promcon_tbl.c: $(src)/prom.uni
2285 - $(call cmd,conmakehash)
2286 diff --git a/drivers/video/console/prom.uni b/drivers/video/console/prom.uni
2287 deleted file mode 100644
2288 index 58f9c04..0000000
2289 --- a/drivers/video/console/prom.uni
2290 +++ /dev/null
2291 @@ -1,11 +0,0 @@
2292 -#
2293 -# Unicode mapping table for font in Sun PROM
2294 -#
2295 -#
2296 -0x20-0x7e idem
2297 -0xa0-0xff idem
2298 -#
2299 -0x7c U+2502
2300 -0x2d U+2500
2301 -0x2b U+250c U+2510 U+2514 U+2518 U+251c U+2524 U+252c U+2534 U+253c
2302 -0xa4 U+fffd
2303 diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
2304 index a882f26..0ffff9e 100644
2305 --- a/drivers/virtio/virtio_ring.c
2306 +++ b/drivers/virtio/virtio_ring.c
2307 @@ -281,6 +281,9 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)
2308 return NULL;
2309 }
2310
2311 + /* Only get used array entries after they have been exposed by host. */
2312 + rmb();
2313 +
2314 i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
2315 *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;
2316
2317 diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c
2318 index 1e8f02f..d3c824d 100644
2319 --- a/drivers/watchdog/riowd.c
2320 +++ b/drivers/watchdog/riowd.c
2321 @@ -206,7 +206,7 @@ static int __devinit riowd_probe(struct of_device *op,
2322
2323 dev_set_drvdata(&op->dev, p);
2324 riowd_device = p;
2325 - err = 0;
2326 + return 0;
2327
2328 out_iounmap:
2329 of_iounmap(&op->resource[0], p->regs, 2);
2330 diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
2331 index 1f3345d..1b056d4 100644
2332 --- a/fs/cifs/connect.c
2333 +++ b/fs/cifs/connect.c
2334 @@ -1556,7 +1556,8 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2335
2336 out_err:
2337 if (tcp_ses) {
2338 - kfree(tcp_ses->hostname);
2339 + if (!IS_ERR(tcp_ses->hostname))
2340 + kfree(tcp_ses->hostname);
2341 if (tcp_ses->ssocket)
2342 sock_release(tcp_ses->ssocket);
2343 kfree(tcp_ses);
2344 diff --git a/fs/fuse/file.c b/fs/fuse/file.c
2345 index cbc4640..899870a 100644
2346 --- a/fs/fuse/file.c
2347 +++ b/fs/fuse/file.c
2348 @@ -1063,7 +1063,8 @@ ssize_t fuse_direct_io(struct file *file, const char __user *buf,
2349 break;
2350 }
2351 }
2352 - fuse_put_request(fc, req);
2353 + if (!IS_ERR(req))
2354 + fuse_put_request(fc, req);
2355 if (res > 0)
2356 *ppos = pos;
2357
2358 @@ -1599,7 +1600,7 @@ static int fuse_ioctl_copy_user(struct page **pages, struct iovec *iov,
2359 kaddr += copy;
2360 }
2361
2362 - kunmap(map);
2363 + kunmap(page);
2364 }
2365
2366 return 0;
2367 diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
2368 index 175d08e..bed78ac 100644
2369 --- a/fs/hfsplus/wrapper.c
2370 +++ b/fs/hfsplus/wrapper.c
2371 @@ -99,6 +99,10 @@ int hfsplus_read_wrapper(struct super_block *sb)
2372
2373 if (hfsplus_get_last_session(sb, &part_start, &part_size))
2374 return -EINVAL;
2375 + if ((u64)part_start + part_size > 0x100000000ULL) {
2376 + pr_err("hfs: volumes larger than 2TB are not supported yet\n");
2377 + return -EINVAL;
2378 + }
2379 while (1) {
2380 bh = sb_bread512(sb, part_start + HFSPLUS_VOLHEAD_SECTOR, vhdr);
2381 if (!bh)
2382 diff --git a/fs/nfs/client.c b/fs/nfs/client.c
2383 index 8d25ccb..bdd76b9 100644
2384 --- a/fs/nfs/client.c
2385 +++ b/fs/nfs/client.c
2386 @@ -1171,7 +1171,7 @@ static int nfs4_init_client(struct nfs_client *clp,
2387 1, flags & NFS_MOUNT_NORESVPORT);
2388 if (error < 0)
2389 goto error;
2390 - memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
2391 + strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
2392
2393 error = nfs_idmap_new(clp);
2394 if (error < 0) {
2395 diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
2396 index 32062c3..7cb2985 100644
2397 --- a/fs/nfs/dir.c
2398 +++ b/fs/nfs/dir.c
2399 @@ -1536,6 +1536,8 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
2400 old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
2401 dentry->d_parent->d_name.name, dentry->d_name.name);
2402
2403 + nfs_inode_return_delegation(inode);
2404 +
2405 d_drop(dentry);
2406 error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name);
2407 if (error == 0) {
2408 diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
2409 index e4e089a..1af78ff 100644
2410 --- a/fs/nfs/direct.c
2411 +++ b/fs/nfs/direct.c
2412 @@ -457,6 +457,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
2413 };
2414 struct rpc_task_setup task_setup_data = {
2415 .rpc_client = NFS_CLIENT(inode),
2416 + .rpc_message = &msg,
2417 .callback_ops = &nfs_write_direct_ops,
2418 .workqueue = nfsiod_workqueue,
2419 .flags = RPC_TASK_ASYNC,
2420 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
2421 index 6917311..2aa2396 100644
2422 --- a/fs/nfs/nfs4proc.c
2423 +++ b/fs/nfs/nfs4proc.c
2424 @@ -71,12 +71,17 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2425 /* Prevent leaks of NFSv4 errors into userland */
2426 static int nfs4_map_errors(int err)
2427 {
2428 - if (err < -1000) {
2429 + if (err >= -1000)
2430 + return err;
2431 + switch (err) {
2432 + case -NFS4ERR_RESOURCE:
2433 + return -EREMOTEIO;
2434 + default:
2435 dprintk("%s could not handle NFSv4 error %d\n",
2436 __func__, -err);
2437 - return -EIO;
2438 + break;
2439 }
2440 - return err;
2441 + return -EIO;
2442 }
2443
2444 /*
2445 @@ -3033,9 +3038,6 @@ static void nfs4_renew_done(struct rpc_task *task, void *data)
2446 if (time_before(clp->cl_last_renewal,timestamp))
2447 clp->cl_last_renewal = timestamp;
2448 spin_unlock(&clp->cl_lock);
2449 - dprintk("%s calling put_rpccred on rpc_cred %p\n", __func__,
2450 - task->tk_msg.rpc_cred);
2451 - put_rpccred(task->tk_msg.rpc_cred);
2452 }
2453
2454 static const struct rpc_call_ops nfs4_renew_ops = {
2455 @@ -4850,7 +4852,6 @@ void nfs41_sequence_call_done(struct rpc_task *task, void *data)
2456 nfs41_sequence_free_slot(clp, task->tk_msg.rpc_resp);
2457 dprintk("%s rpc_cred %p\n", __func__, task->tk_msg.rpc_cred);
2458
2459 - put_rpccred(task->tk_msg.rpc_cred);
2460 kfree(task->tk_msg.rpc_argp);
2461 kfree(task->tk_msg.rpc_resp);
2462
2463 diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c
2464 index e27c6ce..0156c01 100644
2465 --- a/fs/nfs/nfs4renewd.c
2466 +++ b/fs/nfs/nfs4renewd.c
2467 @@ -127,12 +127,6 @@ nfs4_schedule_state_renewal(struct nfs_client *clp)
2468 }
2469
2470 void
2471 -nfs4_renewd_prepare_shutdown(struct nfs_server *server)
2472 -{
2473 - cancel_delayed_work(&server->nfs_client->cl_renewd);
2474 -}
2475 -
2476 -void
2477 nfs4_kill_renewd(struct nfs_client *clp)
2478 {
2479 cancel_delayed_work_sync(&clp->cl_renewd);
2480 diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
2481 index 617273e..f4c9e1a 100644
2482 --- a/fs/nfs/nfs4xdr.c
2483 +++ b/fs/nfs/nfs4xdr.c
2484 @@ -5406,7 +5406,6 @@ static struct {
2485 { NFS4ERR_SERVERFAULT, -ESERVERFAULT },
2486 { NFS4ERR_BADTYPE, -EBADTYPE },
2487 { NFS4ERR_LOCKED, -EAGAIN },
2488 - { NFS4ERR_RESOURCE, -EREMOTEIO },
2489 { NFS4ERR_SYMLINK, -ELOOP },
2490 { NFS4ERR_OP_ILLEGAL, -EOPNOTSUPP },
2491 { NFS4ERR_DEADLOCK, -EDEADLK },
2492 diff --git a/fs/nfs/super.c b/fs/nfs/super.c
2493 index 0b4cbdc..9848169 100644
2494 --- a/fs/nfs/super.c
2495 +++ b/fs/nfs/super.c
2496 @@ -1323,6 +1323,7 @@ static int nfs_parse_mount_options(char *raw,
2497 default:
2498 dfprintk(MOUNT, "NFS: unrecognized "
2499 "transport protocol\n");
2500 + kfree(string);
2501 return 0;
2502 }
2503 break;
2504 @@ -2669,7 +2670,6 @@ static void nfs4_kill_super(struct super_block *sb)
2505 dprintk("--> %s\n", __func__);
2506 nfs_super_return_all_delegations(sb);
2507 kill_anon_super(sb);
2508 - nfs4_renewd_prepare_shutdown(server);
2509 nfs_fscache_release_super_cookie(sb);
2510 nfs_free_server(server);
2511 dprintk("<-- %s\n", __func__);
2512 diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c
2513 index 5be2c8b..862ad29 100644
2514 --- a/fs/nilfs2/btnode.c
2515 +++ b/fs/nilfs2/btnode.c
2516 @@ -276,8 +276,7 @@ void nilfs_btnode_commit_change_key(struct address_space *btnc,
2517 "invalid oldkey %lld (newkey=%lld)",
2518 (unsigned long long)oldkey,
2519 (unsigned long long)newkey);
2520 - if (!test_set_buffer_dirty(obh) && TestSetPageDirty(opage))
2521 - BUG();
2522 + nilfs_btnode_mark_dirty(obh);
2523
2524 spin_lock_irq(&btnc->tree_lock);
2525 radix_tree_delete(&btnc->page_tree, oldkey);
2526 diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
2527 index c8a07c6..3165d85 100644
2528 --- a/fs/notify/inode_mark.c
2529 +++ b/fs/notify/inode_mark.c
2530 @@ -324,11 +324,11 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
2531 spin_lock(&group->mark_lock);
2532 spin_lock(&inode->i_lock);
2533
2534 - entry->group = group;
2535 - entry->inode = inode;
2536 -
2537 lentry = fsnotify_find_mark_entry(group, inode);
2538 if (!lentry) {
2539 + entry->group = group;
2540 + entry->inode = inode;
2541 +
2542 hlist_add_head(&entry->i_list, &inode->i_fsnotify_mark_entries);
2543 list_add(&entry->g_list, &group->mark_entries);
2544
2545 diff --git a/fs/pipe.c b/fs/pipe.c
2546 index 52c4151..ae17d02 100644
2547 --- a/fs/pipe.c
2548 +++ b/fs/pipe.c
2549 @@ -777,36 +777,55 @@ pipe_rdwr_release(struct inode *inode, struct file *filp)
2550 static int
2551 pipe_read_open(struct inode *inode, struct file *filp)
2552 {
2553 - /* We could have perhaps used atomic_t, but this and friends
2554 - below are the only places. So it doesn't seem worthwhile. */
2555 + int ret = -ENOENT;
2556 +
2557 mutex_lock(&inode->i_mutex);
2558 - inode->i_pipe->readers++;
2559 +
2560 + if (inode->i_pipe) {
2561 + ret = 0;
2562 + inode->i_pipe->readers++;
2563 + }
2564 +
2565 mutex_unlock(&inode->i_mutex);
2566
2567 - return 0;
2568 + return ret;
2569 }
2570
2571 static int
2572 pipe_write_open(struct inode *inode, struct file *filp)
2573 {
2574 + int ret = -ENOENT;
2575 +
2576 mutex_lock(&inode->i_mutex);
2577 - inode->i_pipe->writers++;
2578 +
2579 + if (inode->i_pipe) {
2580 + ret = 0;
2581 + inode->i_pipe->writers++;
2582 + }
2583 +
2584 mutex_unlock(&inode->i_mutex);
2585
2586 - return 0;
2587 + return ret;
2588 }
2589
2590 static int
2591 pipe_rdwr_open(struct inode *inode, struct file *filp)
2592 {
2593 + int ret = -ENOENT;
2594 +
2595 mutex_lock(&inode->i_mutex);
2596 - if (filp->f_mode & FMODE_READ)
2597 - inode->i_pipe->readers++;
2598 - if (filp->f_mode & FMODE_WRITE)
2599 - inode->i_pipe->writers++;
2600 +
2601 + if (inode->i_pipe) {
2602 + ret = 0;
2603 + if (filp->f_mode & FMODE_READ)
2604 + inode->i_pipe->readers++;
2605 + if (filp->f_mode & FMODE_WRITE)
2606 + inode->i_pipe->writers++;
2607 + }
2608 +
2609 mutex_unlock(&inode->i_mutex);
2610
2611 - return 0;
2612 + return ret;
2613 }
2614
2615 /*
2616 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
2617 index 8535084..3f6e545 100644
2618 --- a/include/drm/drm_pciids.h
2619 +++ b/include/drm/drm_pciids.h
2620 @@ -552,6 +552,7 @@
2621 {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2622 {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2623 {0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2624 + {0x8086, 0x2e42, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2625 {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2626 {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2627 {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
2628 diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
2629 index 6547c3c..82a9124 100644
2630 --- a/include/linux/moduleparam.h
2631 +++ b/include/linux/moduleparam.h
2632 @@ -37,7 +37,6 @@ typedef int (*param_set_fn)(const char *val, struct kernel_param *kp);
2633 typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp);
2634
2635 /* Flag bits for kernel_param.flags */
2636 -#define KPARAM_KMALLOCED 1
2637 #define KPARAM_ISBOOL 2
2638
2639 struct kernel_param {
2640 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
2641 index 73b46b6..dc4cc29 100644
2642 --- a/include/linux/pci_ids.h
2643 +++ b/include/linux/pci_ids.h
2644 @@ -479,6 +479,9 @@
2645 #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361
2646 #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
2647
2648 +#define PCI_SUBVENDOR_ID_IBM 0x1014
2649 +#define PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT 0x03d4
2650 +
2651 #define PCI_VENDOR_ID_UNISYS 0x1018
2652 #define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C
2653
2654 @@ -877,6 +880,7 @@
2655 #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
2656 #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
2657 #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
2658 +#define PCI_DEVICE_ID_APPLE_U4_PCIE 0x005b
2659 #define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066
2660 #define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069
2661 #define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a
2662 diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
2663 index 56677eb..fbc0146 100644
2664 --- a/include/pcmcia/ss.h
2665 +++ b/include/pcmcia/ss.h
2666 @@ -262,6 +262,8 @@ struct pcmcia_socket {
2667 struct device dev;
2668 /* data internal to the socket driver */
2669 void *driver_data;
2670 + /* status of the card during resume from a system sleep state */
2671 + int resume_status;
2672 };
2673
2674
2675 @@ -280,6 +282,8 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
2676
2677 /* socket drivers are expected to use these callbacks in their .drv struct */
2678 extern int pcmcia_socket_dev_suspend(struct device *dev);
2679 +extern void pcmcia_socket_dev_early_resume(struct device *dev);
2680 +extern void pcmcia_socket_dev_late_resume(struct device *dev);
2681 extern int pcmcia_socket_dev_resume(struct device *dev);
2682
2683 /* socket drivers use this callback in their IRQ handler */
2684 diff --git a/kernel/futex.c b/kernel/futex.c
2685 index 59a2f4d..c0a020f 100644
2686 --- a/kernel/futex.c
2687 +++ b/kernel/futex.c
2688 @@ -150,7 +150,8 @@ static struct futex_hash_bucket *hash_futex(union futex_key *key)
2689 */
2690 static inline int match_futex(union futex_key *key1, union futex_key *key2)
2691 {
2692 - return (key1->both.word == key2->both.word
2693 + return (key1 && key2
2694 + && key1->both.word == key2->both.word
2695 && key1->both.ptr == key2->both.ptr
2696 && key1->both.offset == key2->both.offset);
2697 }
2698 @@ -1027,7 +1028,6 @@ static inline
2699 void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key,
2700 struct futex_hash_bucket *hb)
2701 {
2702 - drop_futex_key_refs(&q->key);
2703 get_futex_key_refs(key);
2704 q->key = *key;
2705
2706 @@ -1225,6 +1225,7 @@ retry_private:
2707 */
2708 if (ret == 1) {
2709 WARN_ON(pi_state);
2710 + drop_count++;
2711 task_count++;
2712 ret = get_futex_value_locked(&curval2, uaddr2);
2713 if (!ret)
2714 @@ -1303,6 +1304,7 @@ retry_private:
2715 if (ret == 1) {
2716 /* We got the lock. */
2717 requeue_pi_wake_futex(this, &key2, hb2);
2718 + drop_count++;
2719 continue;
2720 } else if (ret) {
2721 /* -EDEADLK */
2722 @@ -1767,6 +1769,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,
2723 current->timer_slack_ns);
2724 }
2725
2726 +retry:
2727 /* Prepare to wait on uaddr. */
2728 ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
2729 if (ret)
2730 @@ -1784,9 +1787,14 @@ static int futex_wait(u32 __user *uaddr, int fshared,
2731 goto out_put_key;
2732
2733 /*
2734 - * We expect signal_pending(current), but another thread may
2735 - * have handled it for us already.
2736 + * We expect signal_pending(current), but we might be the
2737 + * victim of a spurious wakeup as well.
2738 */
2739 + if (!signal_pending(current)) {
2740 + put_futex_key(fshared, &q.key);
2741 + goto retry;
2742 + }
2743 +
2744 ret = -ERESTARTSYS;
2745 if (!abs_time)
2746 goto out_put_key;
2747 @@ -2094,9 +2102,11 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
2748 */
2749 plist_del(&q->list, &q->list.plist);
2750
2751 + /* Handle spurious wakeups gracefully */
2752 + ret = -EWOULDBLOCK;
2753 if (timeout && !timeout->task)
2754 ret = -ETIMEDOUT;
2755 - else
2756 + else if (signal_pending(current))
2757 ret = -ERESTARTNOINTR;
2758 }
2759 return ret;
2760 diff --git a/kernel/params.c b/kernel/params.c
2761 index 7f6912c..f04a1e7 100644
2762 --- a/kernel/params.c
2763 +++ b/kernel/params.c
2764 @@ -217,15 +217,11 @@ int param_set_charp(const char *val, struct kernel_param *kp)
2765 return -ENOSPC;
2766 }
2767
2768 - if (kp->flags & KPARAM_KMALLOCED)
2769 - kfree(*(char **)kp->arg);
2770 -
2771 /* This is a hack. We can't need to strdup in early boot, and we
2772 * don't need to; this mangled commandline is preserved. */
2773 if (slab_is_available()) {
2774 - kp->flags |= KPARAM_KMALLOCED;
2775 *(char **)kp->arg = kstrdup(val, GFP_KERNEL);
2776 - if (!kp->arg)
2777 + if (!*(char **)kp->arg)
2778 return -ENOMEM;
2779 } else
2780 *(const char **)kp->arg = val;
2781 @@ -303,6 +299,7 @@ static int param_array(const char *name,
2782 unsigned int min, unsigned int max,
2783 void *elem, int elemsize,
2784 int (*set)(const char *, struct kernel_param *kp),
2785 + u16 flags,
2786 unsigned int *num)
2787 {
2788 int ret;
2789 @@ -312,6 +309,7 @@ static int param_array(const char *name,
2790 /* Get the name right for errors. */
2791 kp.name = name;
2792 kp.arg = elem;
2793 + kp.flags = flags;
2794
2795 /* No equals sign? */
2796 if (!val) {
2797 @@ -357,7 +355,8 @@ int param_array_set(const char *val, struct kernel_param *kp)
2798 unsigned int temp_num;
2799
2800 return param_array(kp->name, val, 1, arr->max, arr->elem,
2801 - arr->elemsize, arr->set, arr->num ?: &temp_num);
2802 + arr->elemsize, arr->set, kp->flags,
2803 + arr->num ?: &temp_num);
2804 }
2805
2806 int param_array_get(char *buffer, struct kernel_param *kp)
2807 @@ -604,11 +603,7 @@ void module_param_sysfs_remove(struct module *mod)
2808
2809 void destroy_params(const struct kernel_param *params, unsigned num)
2810 {
2811 - unsigned int i;
2812 -
2813 - for (i = 0; i < num; i++)
2814 - if (params[i].flags & KPARAM_KMALLOCED)
2815 - kfree(*(char **)params[i].arg);
2816 + /* FIXME: This should free kmalloced charp parameters. It doesn't. */
2817 }
2818
2819 static void __init kernel_add_sysfs_param(const char *name,
2820 diff --git a/mm/mempolicy.c b/mm/mempolicy.c
2821 index 7dd9d9f..4545d59 100644
2822 --- a/mm/mempolicy.c
2823 +++ b/mm/mempolicy.c
2824 @@ -1024,7 +1024,7 @@ static long do_mbind(unsigned long start, unsigned long len,
2825
2826 err = migrate_prep();
2827 if (err)
2828 - return err;
2829 + goto mpol_out;
2830 }
2831 {
2832 NODEMASK_SCRATCH(scratch);
2833 @@ -1039,10 +1039,9 @@ static long do_mbind(unsigned long start, unsigned long len,
2834 err = -ENOMEM;
2835 NODEMASK_SCRATCH_FREE(scratch);
2836 }
2837 - if (err) {
2838 - mpol_put(new);
2839 - return err;
2840 - }
2841 + if (err)
2842 + goto mpol_out;
2843 +
2844 vma = check_range(mm, start, end, nmask,
2845 flags | MPOL_MF_INVERT, &pagelist);
2846
2847 @@ -1058,9 +1057,11 @@ static long do_mbind(unsigned long start, unsigned long len,
2848
2849 if (!err && nr_failed && (flags & MPOL_MF_STRICT))
2850 err = -EIO;
2851 - }
2852 + } else
2853 + putback_lru_pages(&pagelist);
2854
2855 up_write(&mm->mmap_sem);
2856 + mpol_out:
2857 mpol_put(new);
2858 return err;
2859 }
2860 diff --git a/mm/nommu.c b/mm/nommu.c
2861 index 82fedca..10cdd4c 100644
2862 --- a/mm/nommu.c
2863 +++ b/mm/nommu.c
2864 @@ -1384,9 +1384,11 @@ share:
2865 error_just_free:
2866 up_write(&nommu_region_sem);
2867 error:
2868 - fput(region->vm_file);
2869 + if (region->vm_file)
2870 + fput(region->vm_file);
2871 kmem_cache_free(vm_region_jar, region);
2872 - fput(vma->vm_file);
2873 + if (vma->vm_file)
2874 + fput(vma->vm_file);
2875 if (vma->vm_flags & VM_EXECUTABLE)
2876 removed_exe_file_vma(vma->vm_mm);
2877 kmem_cache_free(vm_area_cachep, vma);
2878 diff --git a/mm/swapfile.c b/mm/swapfile.c
2879 index 8ffdc0d..b47ccd7 100644
2880 --- a/mm/swapfile.c
2881 +++ b/mm/swapfile.c
2882 @@ -1149,8 +1149,7 @@ static int try_to_unuse(unsigned int type)
2883 } else
2884 retval = unuse_mm(mm, entry, page);
2885
2886 - if (set_start_mm &&
2887 - swap_count(*swap_map) < swcount) {
2888 + if (set_start_mm && *swap_map < swcount) {
2889 mmput(new_start_mm);
2890 atomic_inc(&mm->mm_users);
2891 new_start_mm = mm;
2892 diff --git a/mm/vmscan.c b/mm/vmscan.c
2893 index 94e86dd..95f35a7 100644
2894 --- a/mm/vmscan.c
2895 +++ b/mm/vmscan.c
2896 @@ -1298,7 +1298,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
2897 * IO, plus JVM can create lots of anon VM_EXEC pages,
2898 * so we ignore them here.
2899 */
2900 - if ((vm_flags & VM_EXEC) && !PageAnon(page)) {
2901 + if ((vm_flags & VM_EXEC) && page_is_file_cache(page)) {
2902 list_add(&page->lru, &l_active);
2903 continue;
2904 }
2905 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
2906 index 3f47276..88b0648 100644
2907 --- a/net/mac80211/cfg.c
2908 +++ b/net/mac80211/cfg.c
2909 @@ -87,6 +87,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
2910 if (!dev)
2911 return -ENODEV;
2912
2913 + if (netif_running(dev))
2914 + return -EBUSY;
2915 +
2916 if (!nl80211_type_check(type))
2917 return -EINVAL;
2918
2919 @@ -96,9 +99,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
2920 if (ret)
2921 return ret;
2922
2923 - if (netif_running(sdata->dev))
2924 - return -EBUSY;
2925 -
2926 if (ieee80211_vif_is_mesh(&sdata->vif) && params->mesh_id_len)
2927 ieee80211_sdata_set_mesh_id(sdata,
2928 params->mesh_id_len,
2929 diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
2930 index 98576d4..e5d720e 100644
2931 --- a/net/mac80211/tx.c
2932 +++ b/net/mac80211/tx.c
2933 @@ -1478,7 +1478,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
2934 if (sdata->vif.type != NL80211_IFTYPE_AP)
2935 continue;
2936 if (compare_ether_addr(sdata->dev->dev_addr,
2937 - hdr->addr2)) {
2938 + hdr->addr2) == 0) {
2939 dev_hold(sdata->dev);
2940 dev_put(odev);
2941 osdata = sdata;
2942 diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
2943 index 09cdcdf..b83ac88 100644
2944 --- a/net/sched/cls_api.c
2945 +++ b/net/sched/cls_api.c
2946 @@ -348,7 +348,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp,
2947 tcm = NLMSG_DATA(nlh);
2948 tcm->tcm_family = AF_UNSPEC;
2949 tcm->tcm__pad1 = 0;
2950 - tcm->tcm__pad1 = 0;
2951 + tcm->tcm__pad2 = 0;
2952 tcm->tcm_ifindex = qdisc_dev(tp->q)->ifindex;
2953 tcm->tcm_parent = tp->classid;
2954 tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
2955 diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
2956 index 51ab497..fc820cd 100644
2957 --- a/net/unix/af_unix.c
2958 +++ b/net/unix/af_unix.c
2959 @@ -1074,6 +1074,8 @@ restart:
2960 err = -ECONNREFUSED;
2961 if (other->sk_state != TCP_LISTEN)
2962 goto out_unlock;
2963 + if (other->sk_shutdown & RCV_SHUTDOWN)
2964 + goto out_unlock;
2965
2966 if (unix_recvq_full(other)) {
2967 err = -EAGAIN;
2968 diff --git a/scripts/Makefile b/scripts/Makefile
2969 index 9dd5b25..842dbc2 100644
2970 --- a/scripts/Makefile
2971 +++ b/scripts/Makefile
2972 @@ -10,7 +10,6 @@
2973 hostprogs-$(CONFIG_KALLSYMS) += kallsyms
2974 hostprogs-$(CONFIG_LOGO) += pnmtologo
2975 hostprogs-$(CONFIG_VT) += conmakehash
2976 -hostprogs-$(CONFIG_PROM_CONSOLE) += conmakehash
2977 hostprogs-$(CONFIG_IKCONFIG) += bin2c
2978
2979 always := $(hostprogs-y) $(hostprogs-m)
2980 diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
2981 index 7f09fb8..667aecd 100644
2982 --- a/security/keys/keyctl.c
2983 +++ b/security/keys/keyctl.c
2984 @@ -860,7 +860,7 @@ static long get_instantiation_keyring(key_serial_t ringid,
2985 /* otherwise specify the destination keyring recorded in the
2986 * authorisation key (any KEY_SPEC_*_KEYRING) */
2987 if (ringid >= KEY_SPEC_REQUESTOR_KEYRING) {
2988 - *_dest_keyring = rka->dest_keyring;
2989 + *_dest_keyring = key_get(rka->dest_keyring);
2990 return 0;
2991 }
2992
2993 diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
2994 index cc84a83..56d1bd8 100644
2995 --- a/sound/pci/ice1712/ice1724.c
2996 +++ b/sound/pci/ice1712/ice1724.c
2997 @@ -643,7 +643,7 @@ static int snd_vt1724_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate,
2998 (inb(ICEMT1724(ice, DMA_PAUSE)) & DMA_PAUSES)) {
2999 /* running? we cannot change the rate now... */
3000 spin_unlock_irqrestore(&ice->reg_lock, flags);
3001 - return -EBUSY;
3002 + return ((rate == ice->cur_rate) && !force) ? 0 : -EBUSY;
3003 }
3004 if (!force && is_pro_rate_locked(ice)) {
3005 spin_unlock_irqrestore(&ice->reg_lock, flags);
3006 diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
3007 index 2884baf..198c750 100644
3008 --- a/virt/kvm/kvm_main.c
3009 +++ b/virt/kvm/kvm_main.c
3010 @@ -2590,8 +2590,6 @@ int kvm_init(void *opaque, unsigned int vcpu_size,
3011 int r;
3012 int cpu;
3013
3014 - kvm_init_debug();
3015 -
3016 r = kvm_arch_init(opaque);
3017 if (r)
3018 goto out_fail;
3019 @@ -2658,6 +2656,8 @@ int kvm_init(void *opaque, unsigned int vcpu_size,
3020 kvm_preempt_ops.sched_in = kvm_sched_in;
3021 kvm_preempt_ops.sched_out = kvm_sched_out;
3022
3023 + kvm_init_debug();
3024 +
3025 return 0;
3026
3027 out_free:
3028 @@ -2679,7 +2679,6 @@ out_free_0:
3029 __free_page(bad_page);
3030 out:
3031 kvm_arch_exit();
3032 - kvm_exit_debug();
3033 out_fail:
3034 return r;
3035 }
3036 @@ -2688,6 +2687,7 @@ EXPORT_SYMBOL_GPL(kvm_init);
3037 void kvm_exit(void)
3038 {
3039 kvm_trace_cleanup();
3040 + kvm_exit_debug();
3041 misc_deregister(&kvm_dev);
3042 kmem_cache_destroy(kvm_vcpu_cache);
3043 sysdev_unregister(&kvm_sysdev);
3044 @@ -2697,7 +2697,6 @@ void kvm_exit(void)
3045 on_each_cpu(hardware_disable, NULL, 1);
3046 kvm_arch_hardware_unsetup();
3047 kvm_arch_exit();
3048 - kvm_exit_debug();
3049 free_cpumask_var(cpus_hardware_enabled);
3050 __free_page(bad_page);
3051 }