Magellan Linux

Annotation of /trunk/kernel26-alx/patches-2.6.33-r4/0106-2.6.33.7-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1286 - (hide annotations) (download)
Thu Feb 17 15:05:15 2011 UTC (13 years, 2 months ago) by niro
File size: 159008 byte(s)
2.6.33-alx-r4: enabled usbserial generic module for accu-chek II devices
1 niro 1286 diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
2     index da1f949..8bccbfa 100644
3     --- a/arch/arm/kernel/kprobes-decode.c
4     +++ b/arch/arm/kernel/kprobes-decode.c
5     @@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
6     {
7     insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0];
8     kprobe_opcode_t insn = p->opcode;
9     + long ppc = (long)p->addr + 8;
10     union reg_pair fnr;
11     int rd = (insn >> 12) & 0xf;
12     int rn = (insn >> 16) & 0xf;
13     int rm = insn & 0xf;
14     long rdv;
15     - long rnv = regs->uregs[rn];
16     - long rmv = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */
17     + long rnv = (rn == 15) ? ppc : regs->uregs[rn];
18     + long rmv = (rm == 15) ? ppc : regs->uregs[rm];
19     long cpsr = regs->ARM_cpsr;
20    
21     fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn);
22     diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
23     index acafdbc..51c2d37 100644
24     --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
25     +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
26     @@ -147,6 +147,10 @@ static void __init rx51_add_gpio_keys(void)
27     #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
28    
29     static int board_keymap[] = {
30     + /*
31     + * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row
32     + * connected to the ground" matrix state.
33     + */
34     KEY(0, 0, KEY_Q),
35     KEY(0, 1, KEY_O),
36     KEY(0, 2, KEY_P),
37     @@ -154,6 +158,7 @@ static int board_keymap[] = {
38     KEY(0, 4, KEY_BACKSPACE),
39     KEY(0, 6, KEY_A),
40     KEY(0, 7, KEY_S),
41     +
42     KEY(1, 0, KEY_W),
43     KEY(1, 1, KEY_D),
44     KEY(1, 2, KEY_F),
45     @@ -162,6 +167,7 @@ static int board_keymap[] = {
46     KEY(1, 5, KEY_J),
47     KEY(1, 6, KEY_K),
48     KEY(1, 7, KEY_L),
49     +
50     KEY(2, 0, KEY_E),
51     KEY(2, 1, KEY_DOT),
52     KEY(2, 2, KEY_UP),
53     @@ -169,6 +175,8 @@ static int board_keymap[] = {
54     KEY(2, 5, KEY_Z),
55     KEY(2, 6, KEY_X),
56     KEY(2, 7, KEY_C),
57     + KEY(2, 8, KEY_F9),
58     +
59     KEY(3, 0, KEY_R),
60     KEY(3, 1, KEY_V),
61     KEY(3, 2, KEY_B),
62     @@ -177,20 +185,23 @@ static int board_keymap[] = {
63     KEY(3, 5, KEY_SPACE),
64     KEY(3, 6, KEY_SPACE),
65     KEY(3, 7, KEY_LEFT),
66     +
67     KEY(4, 0, KEY_T),
68     KEY(4, 1, KEY_DOWN),
69     KEY(4, 2, KEY_RIGHT),
70     KEY(4, 4, KEY_LEFTCTRL),
71     KEY(4, 5, KEY_RIGHTALT),
72     KEY(4, 6, KEY_LEFTSHIFT),
73     + KEY(4, 8, KEY_F10),
74     +
75     KEY(5, 0, KEY_Y),
76     + KEY(5, 8, KEY_F11),
77     +
78     KEY(6, 0, KEY_U),
79     +
80     KEY(7, 0, KEY_I),
81     KEY(7, 1, KEY_F7),
82     KEY(7, 2, KEY_F8),
83     - KEY(0xff, 2, KEY_F9),
84     - KEY(0xff, 4, KEY_F10),
85     - KEY(0xff, 5, KEY_F11),
86     };
87    
88     static struct matrix_keymap_data board_map_data = {
89     diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
90     index ee5e392..b4575ae 100644
91     --- a/arch/arm/mach-realview/Kconfig
92     +++ b/arch/arm/mach-realview/Kconfig
93     @@ -18,6 +18,7 @@ config REALVIEW_EB_ARM11MP
94     bool "Support ARM11MPCore tile"
95     depends on MACH_REALVIEW_EB
96     select CPU_V6
97     + select ARCH_HAS_BARRIERS if SMP
98     help
99     Enable support for the ARM11MPCore tile on the Realview platform.
100    
101     @@ -35,6 +36,7 @@ config MACH_REALVIEW_PB11MP
102     select CPU_V6
103     select ARM_GIC
104     select HAVE_PATA_PLATFORM
105     + select ARCH_HAS_BARRIERS if SMP
106     help
107     Include support for the ARM(R) RealView MPCore Platform Baseboard.
108     PB11MPCore is a platform with an on-board ARM11MPCore and has
109     diff --git a/arch/arm/mach-realview/include/mach/barriers.h b/arch/arm/mach-realview/include/mach/barriers.h
110     new file mode 100644
111     index 0000000..0c5d749
112     --- /dev/null
113     +++ b/arch/arm/mach-realview/include/mach/barriers.h
114     @@ -0,0 +1,8 @@
115     +/*
116     + * Barriers redefined for RealView ARM11MPCore platforms with L220 cache
117     + * controller to work around hardware errata causing the outer_sync()
118     + * operation to deadlock the system.
119     + */
120     +#define mb() dsb()
121     +#define rmb() dmb()
122     +#define wmb() mb()
123     diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
124     index f3de9d7..99c1364 100644
125     --- a/arch/ia64/mm/tlb.c
126     +++ b/arch/ia64/mm/tlb.c
127     @@ -120,7 +120,7 @@ static inline void down_spin(struct spinaphore *ss)
128     ia64_invala();
129    
130     for (;;) {
131     - asm volatile ("ld4.c.nc %0=[%1]" : "=r"(serve) : "r"(&ss->serve) : "memory");
132     + asm volatile ("ld8.c.nc %0=[%1]" : "=r"(serve) : "r"(&ss->serve) : "memory");
133     if (time_before(t, serve))
134     return;
135     cpu_relax();
136     diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
137     index f4ab313..b149c3c 100644
138     --- a/arch/mips/include/asm/mipsregs.h
139     +++ b/arch/mips/include/asm/mipsregs.h
140     @@ -135,6 +135,12 @@
141     #define FPU_CSR_COND7 0x80000000 /* $fcc7 */
142    
143     /*
144     + * Bits 18 - 20 of the FPU Status Register will be read as 0,
145     + * and should be written as zero.
146     + */
147     +#define FPU_CSR_RSVD 0x001c0000
148     +
149     +/*
150     * X the exception cause indicator
151     * E the exception enable
152     * S the sticky/flag bit
153     @@ -161,7 +167,8 @@
154     #define FPU_CSR_UDF_S 0x00000008
155     #define FPU_CSR_INE_S 0x00000004
156    
157     -/* rounding mode */
158     +/* Bits 0 and 1 of FPU Status Register specify the rounding mode */
159     +#define FPU_CSR_RM 0x00000003
160     #define FPU_CSR_RN 0x0 /* nearest */
161     #define FPU_CSR_RZ 0x1 /* towards zero */
162     #define FPU_CSR_RU 0x2 /* towards +Infinity */
163     diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
164     index 8f2f8e9..f2338d1 100644
165     --- a/arch/mips/math-emu/cp1emu.c
166     +++ b/arch/mips/math-emu/cp1emu.c
167     @@ -78,6 +78,9 @@ DEFINE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
168     #define FPCREG_RID 0 /* $0 = revision id */
169     #define FPCREG_CSR 31 /* $31 = csr */
170    
171     +/* Determine rounding mode from the RM bits of the FCSR */
172     +#define modeindex(v) ((v) & FPU_CSR_RM)
173     +
174     /* Convert Mips rounding mode (0..3) to IEEE library modes. */
175     static const unsigned char ieee_rm[4] = {
176     [FPU_CSR_RN] = IEEE754_RN,
177     @@ -384,10 +387,14 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
178     (void *) (xcp->cp0_epc),
179     MIPSInst_RT(ir), value);
180     #endif
181     - value &= (FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03);
182     - ctx->fcr31 &= ~(FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03);
183     - /* convert to ieee library modes */
184     - ctx->fcr31 |= (value & ~0x3) | ieee_rm[value & 0x3];
185     +
186     + /*
187     + * Don't write reserved bits,
188     + * and convert to ieee library modes
189     + */
190     + ctx->fcr31 = (value &
191     + ~(FPU_CSR_RSVD | FPU_CSR_RM)) |
192     + ieee_rm[modeindex(value)];
193     }
194     if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
195     return SIGFPE;
196     diff --git a/arch/powerpc/include/asm/cpm.h b/arch/powerpc/include/asm/cpm.h
197     index 0835eb9..e50323f 100644
198     --- a/arch/powerpc/include/asm/cpm.h
199     +++ b/arch/powerpc/include/asm/cpm.h
200     @@ -7,6 +7,30 @@
201     #include <linux/of.h>
202    
203     /*
204     + * SPI Parameter RAM common to QE and CPM.
205     + */
206     +struct spi_pram {
207     + __be16 rbase; /* Rx Buffer descriptor base address */
208     + __be16 tbase; /* Tx Buffer descriptor base address */
209     + u8 rfcr; /* Rx function code */
210     + u8 tfcr; /* Tx function code */
211     + __be16 mrblr; /* Max receive buffer length */
212     + __be32 rstate; /* Internal */
213     + __be32 rdp; /* Internal */
214     + __be16 rbptr; /* Internal */
215     + __be16 rbc; /* Internal */
216     + __be32 rxtmp; /* Internal */
217     + __be32 tstate; /* Internal */
218     + __be32 tdp; /* Internal */
219     + __be16 tbptr; /* Internal */
220     + __be16 tbc; /* Internal */
221     + __be32 txtmp; /* Internal */
222     + __be32 res; /* Tx temp. */
223     + __be16 rpbase; /* Relocation pointer (CPM1 only) */
224     + __be16 res1; /* Reserved */
225     +};
226     +
227     +/*
228     * USB Controller pram common to QE and CPM.
229     */
230     struct usb_ctlr {
231     diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
232     index dee83b8..11b300a 100644
233     --- a/arch/powerpc/kernel/irq.c
234     +++ b/arch/powerpc/kernel/irq.c
235     @@ -247,7 +247,10 @@ void fixup_irqs(cpumask_t map)
236     cpumask_t mask;
237    
238     desc = irq_to_desc(irq);
239     - if (desc && desc->status & IRQ_PER_CPU)
240     + if (!desc)
241     + continue;
242     +
243     + if (desc->status & IRQ_PER_CPU)
244     continue;
245    
246     cpumask_and(&mask, desc->affinity, &map);
247     diff --git a/arch/powerpc/sysdev/micropatch.c b/arch/powerpc/sysdev/micropatch.c
248     index d8d6028..6c56ae9 100644
249     --- a/arch/powerpc/sysdev/micropatch.c
250     +++ b/arch/powerpc/sysdev/micropatch.c
251     @@ -16,6 +16,7 @@
252     #include <asm/page.h>
253     #include <asm/pgtable.h>
254     #include <asm/8xx_immap.h>
255     +#include <asm/cpm.h>
256     #include <asm/cpm1.h>
257    
258     /*
259     @@ -625,9 +626,14 @@ cpm_load_patch(cpm8xx_t *cp)
260     {
261     volatile uint *dp; /* Dual-ported RAM. */
262     volatile cpm8xx_t *commproc;
263     +#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \
264     + defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
265     volatile iic_t *iip;
266     - volatile spi_t *spp;
267     + volatile struct spi_pram *spp;
268     +#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH
269     volatile smc_uart_t *smp;
270     +#endif
271     +#endif
272     int i;
273    
274     commproc = cp;
275     @@ -668,8 +674,8 @@ cpm_load_patch(cpm8xx_t *cp)
276     /* Put SPI above the IIC, also 32-byte aligned.
277     */
278     i = (RPBASE + sizeof(iic_t) + 31) & ~31;
279     - spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
280     - spp->spi_rpbase = i;
281     + spp = (struct spi_pram *)&commproc->cp_dparam[PROFF_SPI];
282     + spp->rpbase = i;
283    
284     # if defined(CONFIG_I2C_SPI_UCODE_PATCH)
285     commproc->cp_cpmcr1 = 0x802a;
286     diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
287     index 39327d6..a232e9e 100644
288     --- a/arch/sparc/include/asm/stat.h
289     +++ b/arch/sparc/include/asm/stat.h
290     @@ -53,8 +53,8 @@ struct stat {
291     ino_t st_ino;
292     mode_t st_mode;
293     short st_nlink;
294     - uid16_t st_uid;
295     - gid16_t st_gid;
296     + unsigned short st_uid;
297     + unsigned short st_gid;
298     unsigned short st_rdev;
299     off_t st_size;
300     time_t st_atime;
301     diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
302     index d86da72..5928fc0 100644
303     --- a/arch/x86/include/asm/msr-index.h
304     +++ b/arch/x86/include/asm/msr-index.h
305     @@ -107,6 +107,7 @@
306     #define MSR_AMD64_PATCH_LOADER 0xc0010020
307     #define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140
308     #define MSR_AMD64_OSVW_STATUS 0xc0010141
309     +#define MSR_AMD64_DC_CFG 0xc0011022
310     #define MSR_AMD64_IBSFETCHCTL 0xc0011030
311     #define MSR_AMD64_IBSFETCHLINAD 0xc0011031
312     #define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
313     diff --git a/arch/x86/include/asm/suspend_32.h b/arch/x86/include/asm/suspend_32.h
314     index 48dcfa6..fd921c3 100644
315     --- a/arch/x86/include/asm/suspend_32.h
316     +++ b/arch/x86/include/asm/suspend_32.h
317     @@ -15,6 +15,8 @@ static inline int arch_prepare_suspend(void) { return 0; }
318     struct saved_context {
319     u16 es, fs, gs, ss;
320     unsigned long cr0, cr2, cr3, cr4;
321     + u64 misc_enable;
322     + bool misc_enable_saved;
323     struct desc_ptr gdt;
324     struct desc_ptr idt;
325     u16 ldt;
326     diff --git a/arch/x86/include/asm/suspend_64.h b/arch/x86/include/asm/suspend_64.h
327     index 06284f4..8d942af 100644
328     --- a/arch/x86/include/asm/suspend_64.h
329     +++ b/arch/x86/include/asm/suspend_64.h
330     @@ -27,6 +27,8 @@ struct saved_context {
331     u16 ds, es, fs, gs, ss;
332     unsigned long gs_base, gs_kernel_base, fs_base;
333     unsigned long cr0, cr2, cr3, cr4, cr8;
334     + u64 misc_enable;
335     + bool misc_enable_saved;
336     unsigned long efer;
337     u16 gdt_pad;
338     u16 gdt_limit;
339     diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
340     index e04740f..2a19418 100644
341     --- a/arch/x86/include/asm/system.h
342     +++ b/arch/x86/include/asm/system.h
343     @@ -451,7 +451,7 @@ void stop_this_cpu(void *dummy);
344     *
345     * (Could use an alternative three way for this if there was one.)
346     */
347     -static inline void rdtsc_barrier(void)
348     +static __always_inline void rdtsc_barrier(void)
349     {
350     alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
351     alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
352     diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
353     index 2e837f5..fb7a5f0 100644
354     --- a/arch/x86/kernel/acpi/cstate.c
355     +++ b/arch/x86/kernel/acpi/cstate.c
356     @@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
357     percpu_entry->states[cx->index].eax = cx->address;
358     percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
359     }
360     +
361     + /*
362     + * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared,
363     + * then we should skip checking BM_STS for this C-state.
364     + * ref: "Intel Processor Vendor-Specific ACPI Interface Specification"
365     + */
366     + if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2))
367     + cx->bm_sts_skip = 1;
368     +
369     return retval;
370     }
371     EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
372     diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
373     index f996103..82e5086 100644
374     --- a/arch/x86/kernel/acpi/sleep.c
375     +++ b/arch/x86/kernel/acpi/sleep.c
376     @@ -162,8 +162,6 @@ static int __init acpi_sleep_setup(char *str)
377     #endif
378     if (strncmp(str, "old_ordering", 12) == 0)
379     acpi_old_suspend_ordering();
380     - if (strncmp(str, "sci_force_enable", 16) == 0)
381     - acpi_set_sci_en_on_resume();
382     str = strchr(str, ',');
383     if (str != NULL)
384     str += strspn(str, ", \t");
385     diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
386     index d4df517..7718bb3 100644
387     --- a/arch/x86/kernel/apic/apic.c
388     +++ b/arch/x86/kernel/apic/apic.c
389     @@ -920,7 +920,7 @@ void disable_local_APIC(void)
390     unsigned int value;
391    
392     /* APIC hasn't been mapped yet */
393     - if (!apic_phys)
394     + if (!x2apic_mode && !apic_phys)
395     return;
396    
397     clear_local_APIC();
398     diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
399     index 773afc9..241c5b2 100644
400     --- a/arch/x86/kernel/hpet.c
401     +++ b/arch/x86/kernel/hpet.c
402     @@ -958,7 +958,7 @@ fs_initcall(hpet_late_init);
403    
404     void hpet_disable(void)
405     {
406     - if (is_hpet_capable()) {
407     + if (is_hpet_capable() && hpet_virt_address) {
408     unsigned int cfg = hpet_readl(HPET_CFG);
409    
410     if (hpet_legacy_int_enabled) {
411     diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
412     index 2bbde60..aa740fa 100644
413     --- a/arch/x86/kernel/pci-calgary_64.c
414     +++ b/arch/x86/kernel/pci-calgary_64.c
415     @@ -103,11 +103,16 @@ int use_calgary __read_mostly = 0;
416     #define PMR_SOFTSTOPFAULT 0x40000000
417     #define PMR_HARDSTOP 0x20000000
418    
419     -#define MAX_NUM_OF_PHBS 8 /* how many PHBs in total? */
420     -#define MAX_NUM_CHASSIS 8 /* max number of chassis */
421     -/* MAX_PHB_BUS_NUM is the maximal possible dev->bus->number */
422     -#define MAX_PHB_BUS_NUM (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2)
423     -#define PHBS_PER_CALGARY 4
424     +/*
425     + * The maximum PHB bus number.
426     + * x3950M2 (rare): 8 chassis, 48 PHBs per chassis = 384
427     + * x3950M2: 4 chassis, 48 PHBs per chassis = 192
428     + * x3950 (PCIE): 8 chassis, 32 PHBs per chassis = 256
429     + * x3950 (PCIX): 8 chassis, 16 PHBs per chassis = 128
430     + */
431     +#define MAX_PHB_BUS_NUM 256
432     +
433     +#define PHBS_PER_CALGARY 4
434    
435     /* register offsets in Calgary's internal register space */
436     static const unsigned long tar_offsets[] = {
437     @@ -1051,8 +1056,6 @@ static int __init calgary_init_one(struct pci_dev *dev)
438     struct iommu_table *tbl;
439     int ret;
440    
441     - BUG_ON(dev->bus->number >= MAX_PHB_BUS_NUM);
442     -
443     bbar = busno_to_bbar(dev->bus->number);
444     ret = calgary_setup_tar(dev, bbar);
445     if (ret)
446     diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
447     index 3339917..b1e85b0 100644
448     --- a/arch/x86/kernel/traps.c
449     +++ b/arch/x86/kernel/traps.c
450     @@ -529,11 +529,20 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
451     dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
452     {
453     struct task_struct *tsk = current;
454     + int user_icebp = 0;
455     unsigned long dr6;
456     int si_code;
457    
458     get_debugreg(dr6, 6);
459    
460     + /*
461     + * If dr6 has no reason to give us about the origin of this trap,
462     + * then it's very likely the result of an icebp/int01 trap.
463     + * User wants a sigtrap for that.
464     + */
465     + if (!(dr6 & ~0xffff0ff0) && user_mode(regs))
466     + user_icebp = 1;
467     +
468     /* Catch kmemcheck conditions first of all! */
469     if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
470     return;
471     @@ -575,7 +584,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
472     regs->flags &= ~X86_EFLAGS_TF;
473     }
474     si_code = get_si_code(tsk->thread.debugreg6);
475     - if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS))
476     + if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
477     send_sigtrap(tsk, regs, error_code, si_code);
478     preempt_conditional_cli(regs);
479    
480     diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
481     index 8822021..ca7c528 100644
482     --- a/arch/x86/kvm/mmu.c
483     +++ b/arch/x86/kvm/mmu.c
484     @@ -1849,6 +1849,9 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
485    
486     spte |= PT_WRITABLE_MASK;
487    
488     + if (!tdp_enabled && !(pte_access & ACC_WRITE_MASK))
489     + spte &= ~PT_USER_MASK;
490     +
491     /*
492     * Optimization: for pte sync, if spte was writable the hash
493     * lookup is unnecessary (and expensive). Write protection
494     @@ -1904,6 +1907,8 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
495    
496     child = page_header(pte & PT64_BASE_ADDR_MASK);
497     mmu_page_remove_parent_pte(child, sptep);
498     + __set_spte(sptep, shadow_trap_nonpresent_pte);
499     + kvm_flush_remote_tlbs(vcpu->kvm);
500     } else if (pfn != spte_to_pfn(*sptep)) {
501     pgprintk("hfn old %lx new %lx\n",
502     spte_to_pfn(*sptep), pfn);
503     diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
504     index a2f839c..8d128be 100644
505     --- a/arch/x86/kvm/svm.c
506     +++ b/arch/x86/kvm/svm.c
507     @@ -27,6 +27,7 @@
508     #include <linux/sched.h>
509     #include <linux/ftrace_event.h>
510    
511     +#include <asm/tlbflush.h>
512     #include <asm/desc.h>
513    
514     #include <asm/virtext.h>
515     @@ -54,6 +55,8 @@ MODULE_LICENSE("GPL");
516    
517     #define DEBUGCTL_RESERVED_BITS (~(0x3fULL))
518    
519     +static bool erratum_383_found __read_mostly;
520     +
521     static const u32 host_save_user_msrs[] = {
522     #ifdef CONFIG_X86_64
523     MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
524     @@ -297,6 +300,31 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
525     svm_set_interrupt_shadow(vcpu, 0);
526     }
527    
528     +static void svm_init_erratum_383(void)
529     +{
530     + u32 low, high;
531     + int err;
532     + u64 val;
533     +
534     + /* Only Fam10h is affected */
535     + if (boot_cpu_data.x86 != 0x10)
536     + return;
537     +
538     + /* Use _safe variants to not break nested virtualization */
539     + val = native_read_msr_safe(MSR_AMD64_DC_CFG, &err);
540     + if (err)
541     + return;
542     +
543     + val |= (1ULL << 47);
544     +
545     + low = lower_32_bits(val);
546     + high = upper_32_bits(val);
547     +
548     + native_write_msr_safe(MSR_AMD64_DC_CFG, low, high);
549     +
550     + erratum_383_found = true;
551     +}
552     +
553     static int has_svm(void)
554     {
555     const char *msg;
556     @@ -352,6 +380,8 @@ static int svm_hardware_enable(void *garbage)
557    
558     wrmsrl(MSR_VM_HSAVE_PA, page_to_pfn(sd->save_area) << PAGE_SHIFT);
559    
560     + svm_init_erratum_383();
561     +
562     return 0;
563     }
564    
565     @@ -1255,8 +1285,59 @@ static int nm_interception(struct vcpu_svm *svm)
566     return 1;
567     }
568    
569     -static int mc_interception(struct vcpu_svm *svm)
570     +static bool is_erratum_383(void)
571     {
572     + int err, i;
573     + u64 value;
574     +
575     + if (!erratum_383_found)
576     + return false;
577     +
578     + value = native_read_msr_safe(MSR_IA32_MC0_STATUS, &err);
579     + if (err)
580     + return false;
581     +
582     + /* Bit 62 may or may not be set for this mce */
583     + value &= ~(1ULL << 62);
584     +
585     + if (value != 0xb600000000010015ULL)
586     + return false;
587     +
588     + /* Clear MCi_STATUS registers */
589     + for (i = 0; i < 6; ++i)
590     + native_write_msr_safe(MSR_IA32_MCx_STATUS(i), 0, 0);
591     +
592     + value = native_read_msr_safe(MSR_IA32_MCG_STATUS, &err);
593     + if (!err) {
594     + u32 low, high;
595     +
596     + value &= ~(1ULL << 2);
597     + low = lower_32_bits(value);
598     + high = upper_32_bits(value);
599     +
600     + native_write_msr_safe(MSR_IA32_MCG_STATUS, low, high);
601     + }
602     +
603     + /* Flush tlb to evict multi-match entries */
604     + __flush_tlb_all();
605     +
606     + return true;
607     +}
608     +
609     +static void svm_handle_mce(struct vcpu_svm *svm)
610     +{
611     + if (is_erratum_383()) {
612     + /*
613     + * Erratum 383 triggered. Guest state is corrupt so kill the
614     + * guest.
615     + */
616     + pr_err("KVM: Guest triggered AMD Erratum 383\n");
617     +
618     + set_bit(KVM_REQ_TRIPLE_FAULT, &svm->vcpu.requests);
619     +
620     + return;
621     + }
622     +
623     /*
624     * On an #MC intercept the MCE handler is not called automatically in
625     * the host. So do it by hand here.
626     @@ -1265,6 +1346,11 @@ static int mc_interception(struct vcpu_svm *svm)
627     "int $0x12\n");
628     /* not sure if we ever come back to this point */
629    
630     + return;
631     +}
632     +
633     +static int mc_interception(struct vcpu_svm *svm)
634     +{
635     return 1;
636     }
637    
638     @@ -2820,6 +2906,14 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
639     vcpu->arch.regs_avail &= ~(1 << VCPU_EXREG_PDPTR);
640     vcpu->arch.regs_dirty &= ~(1 << VCPU_EXREG_PDPTR);
641     }
642     +
643     + /*
644     + * We need to handle MC intercepts here before the vcpu has a chance to
645     + * change the physical cpu
646     + */
647     + if (unlikely(svm->vmcb->control.exit_code ==
648     + SVM_EXIT_EXCP_BASE + MC_VECTOR))
649     + svm_handle_mce(svm);
650     }
651    
652     #undef R
653     diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
654     index 0a979f3..1290ba5 100644
655     --- a/arch/x86/power/cpu.c
656     +++ b/arch/x86/power/cpu.c
657     @@ -105,6 +105,8 @@ static void __save_processor_state(struct saved_context *ctxt)
658     ctxt->cr4 = read_cr4();
659     ctxt->cr8 = read_cr8();
660     #endif
661     + ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE,
662     + &ctxt->misc_enable);
663     }
664    
665     /* Needed by apm.c */
666     @@ -152,6 +154,8 @@ static void fix_processor_context(void)
667     */
668     static void __restore_processor_state(struct saved_context *ctxt)
669     {
670     + if (ctxt->misc_enable_saved)
671     + wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable);
672     /*
673     * control registers
674     */
675     diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
676     index d0f8146..7424bf9 100644
677     --- a/block/cfq-iosched.c
678     +++ b/block/cfq-iosched.c
679     @@ -1934,6 +1934,15 @@ static void cfq_setup_merge(struct cfq_queue *cfqq, struct cfq_queue *new_cfqq)
680     int process_refs, new_process_refs;
681     struct cfq_queue *__cfqq;
682    
683     + /*
684     + * If there are no process references on the new_cfqq, then it is
685     + * unsafe to follow the ->new_cfqq chain as other cfqq's in the
686     + * chain may have dropped their last reference (not just their
687     + * last process reference).
688     + */
689     + if (!cfqq_process_refs(new_cfqq))
690     + return;
691     +
692     /* Avoid a circular list and skip interim queue merges */
693     while ((__cfqq = new_cfqq->new_cfqq)) {
694     if (__cfqq == cfqq)
695     @@ -1942,17 +1951,17 @@ static void cfq_setup_merge(struct cfq_queue *cfqq, struct cfq_queue *new_cfqq)
696     }
697    
698     process_refs = cfqq_process_refs(cfqq);
699     + new_process_refs = cfqq_process_refs(new_cfqq);
700     /*
701     * If the process for the cfqq has gone away, there is no
702     * sense in merging the queues.
703     */
704     - if (process_refs == 0)
705     + if (process_refs == 0 || new_process_refs == 0)
706     return;
707    
708     /*
709     * Merge in the direction of the lesser amount of work.
710     */
711     - new_process_refs = cfqq_process_refs(new_cfqq);
712     if (new_process_refs >= process_refs) {
713     cfqq->new_cfqq = new_cfqq;
714     atomic_add(process_refs, &new_cfqq->ref);
715     diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
716     index cc978a8..64db828 100644
717     --- a/drivers/acpi/processor_idle.c
718     +++ b/drivers/acpi/processor_idle.c
719     @@ -954,7 +954,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
720     if (acpi_idle_suspend)
721     return(acpi_idle_enter_c1(dev, state));
722    
723     - if (acpi_idle_bm_check()) {
724     + if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
725     if (dev->safe_state) {
726     dev->last_state = dev->safe_state;
727     return dev->safe_state->enter(dev, dev->safe_state);
728     diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
729     index 9ed9292..0458094 100644
730     --- a/drivers/acpi/sleep.c
731     +++ b/drivers/acpi/sleep.c
732     @@ -80,22 +80,6 @@ static int acpi_sleep_prepare(u32 acpi_state)
733    
734     #ifdef CONFIG_ACPI_SLEEP
735     static u32 acpi_target_sleep_state = ACPI_STATE_S0;
736     -/*
737     - * According to the ACPI specification the BIOS should make sure that ACPI is
738     - * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
739     - * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
740     - * on such systems during resume. Unfortunately that doesn't help in
741     - * particularly pathological cases in which SCI_EN has to be set directly on
742     - * resume, although the specification states very clearly that this flag is
743     - * owned by the hardware. The set_sci_en_on_resume variable will be set in such
744     - * cases.
745     - */
746     -static bool set_sci_en_on_resume;
747     -
748     -void __init acpi_set_sci_en_on_resume(void)
749     -{
750     - set_sci_en_on_resume = true;
751     -}
752    
753     /*
754     * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
755     @@ -253,11 +237,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
756     break;
757     }
758    
759     - /* If ACPI is not enabled by the BIOS, we need to enable it here. */
760     - if (set_sci_en_on_resume)
761     - acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
762     - else
763     - acpi_enable();
764     + /* This violates the spec but is required for bug compatibility. */
765     + acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
766    
767     /* Reprogram control registers and execute _BFS */
768     acpi_leave_sleep_state_prep(acpi_state);
769     @@ -346,12 +327,6 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
770     return 0;
771     }
772    
773     -static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d)
774     -{
775     - set_sci_en_on_resume = true;
776     - return 0;
777     -}
778     -
779     static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
780     {
781     .callback = init_old_suspend_ordering,
782     @@ -370,22 +345,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
783     },
784     },
785     {
786     - .callback = init_set_sci_en_on_resume,
787     - .ident = "Apple MacBook 1,1",
788     - .matches = {
789     - DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
790     - DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
791     - },
792     - },
793     - {
794     - .callback = init_set_sci_en_on_resume,
795     - .ident = "Apple MacMini 1,1",
796     - .matches = {
797     - DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
798     - DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
799     - },
800     - },
801     - {
802     .callback = init_old_suspend_ordering,
803     .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
804     .matches = {
805     @@ -394,94 +353,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
806     },
807     },
808     {
809     - .callback = init_set_sci_en_on_resume,
810     - .ident = "Toshiba Satellite L300",
811     - .matches = {
812     - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
813     - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"),
814     - },
815     - },
816     - {
817     - .callback = init_set_sci_en_on_resume,
818     - .ident = "Hewlett-Packard HP G7000 Notebook PC",
819     - .matches = {
820     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
821     - DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"),
822     - },
823     - },
824     - {
825     - .callback = init_set_sci_en_on_resume,
826     - .ident = "Hewlett-Packard HP Pavilion dv3 Notebook PC",
827     - .matches = {
828     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
829     - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv3 Notebook PC"),
830     - },
831     - },
832     - {
833     - .callback = init_set_sci_en_on_resume,
834     - .ident = "Hewlett-Packard Pavilion dv4",
835     - .matches = {
836     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
837     - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4"),
838     - },
839     - },
840     - {
841     - .callback = init_set_sci_en_on_resume,
842     - .ident = "Hewlett-Packard Pavilion dv7",
843     - .matches = {
844     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
845     - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7"),
846     - },
847     - },
848     - {
849     - .callback = init_set_sci_en_on_resume,
850     - .ident = "Hewlett-Packard Compaq Presario C700 Notebook PC",
851     - .matches = {
852     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
853     - DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario C700 Notebook PC"),
854     - },
855     - },
856     - {
857     - .callback = init_set_sci_en_on_resume,
858     - .ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC",
859     - .matches = {
860     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
861     - DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"),
862     - },
863     - },
864     - {
865     - .callback = init_set_sci_en_on_resume,
866     - .ident = "Lenovo ThinkPad T410",
867     - .matches = {
868     - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
869     - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
870     - },
871     - },
872     - {
873     - .callback = init_set_sci_en_on_resume,
874     - .ident = "Lenovo ThinkPad T510",
875     - .matches = {
876     - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
877     - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
878     - },
879     - },
880     - {
881     - .callback = init_set_sci_en_on_resume,
882     - .ident = "Lenovo ThinkPad W510",
883     - .matches = {
884     - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
885     - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
886     - },
887     - },
888     - {
889     - .callback = init_set_sci_en_on_resume,
890     - .ident = "Lenovo ThinkPad X201[s]",
891     - .matches = {
892     - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
893     - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
894     - },
895     - },
896     - {
897     .callback = init_old_suspend_ordering,
898     .ident = "Panasonic CF51-2L",
899     .matches = {
900     @@ -490,30 +361,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
901     DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
902     },
903     },
904     - {
905     - .callback = init_set_sci_en_on_resume,
906     - .ident = "Dell Studio 1558",
907     - .matches = {
908     - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
909     - DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"),
910     - },
911     - },
912     - {
913     - .callback = init_set_sci_en_on_resume,
914     - .ident = "Dell Studio 1557",
915     - .matches = {
916     - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
917     - DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"),
918     - },
919     - },
920     - {
921     - .callback = init_set_sci_en_on_resume,
922     - .ident = "Dell Studio 1555",
923     - .matches = {
924     - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
925     - DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"),
926     - },
927     - },
928     {},
929     };
930     #endif /* CONFIG_SUSPEND */
931     diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
932     index 462200d..9c6747c 100644
933     --- a/drivers/ata/ahci.c
934     +++ b/drivers/ata/ahci.c
935     @@ -3037,6 +3037,16 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
936     if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable)
937     return -ENODEV;
938    
939     + /*
940     + * For some reason, MCP89 on MacBook 7,1 doesn't work with
941     + * ahci, use ata_generic instead.
942     + */
943     + if (pdev->vendor == PCI_VENDOR_ID_NVIDIA &&
944     + pdev->device == PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA &&
945     + pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
946     + pdev->subsystem_device == 0xcb89)
947     + return -ENODEV;
948     +
949     /* Promise's PDC42819 is a SAS/SATA controller that has an AHCI mode.
950     * At the moment, we can only use the AHCI mode. Let the users know
951     * that for SAS drives they're out of luck.
952     diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
953     index 12e26c3..151eb43 100644
954     --- a/drivers/ata/ata_generic.c
955     +++ b/drivers/ata/ata_generic.c
956     @@ -168,6 +168,12 @@ static struct pci_device_id ata_generic[] = {
957     { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561), },
958     { PCI_DEVICE(PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558), },
959     { PCI_DEVICE(PCI_VENDOR_ID_CENATEK,PCI_DEVICE_ID_CENATEK_IDE), },
960     + /*
961     + * For some reason, MCP89 on MacBook 7,1 doesn't work with
962     + * ahci, use ata_generic instead.
963     + */
964     + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA,
965     + PCI_VENDOR_ID_APPLE, 0xcb89, },
966     #if !defined(CONFIG_PATA_TOSHIBA) && !defined(CONFIG_PATA_TOSHIBA_MODULE)
967     { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), },
968     { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), },
969     diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
970     index a950241..ff911ae 100644
971     --- a/drivers/base/firmware_class.c
972     +++ b/drivers/base/firmware_class.c
973     @@ -125,6 +125,17 @@ static ssize_t firmware_loading_show(struct device *dev,
974     return sprintf(buf, "%d\n", loading);
975     }
976    
977     +static void firmware_free_data(const struct firmware *fw)
978     +{
979     + int i;
980     + vunmap(fw->data);
981     + if (fw->pages) {
982     + for (i = 0; i < PFN_UP(fw->size); i++)
983     + __free_page(fw->pages[i]);
984     + kfree(fw->pages);
985     + }
986     +}
987     +
988     /* Some architectures don't have PAGE_KERNEL_RO */
989     #ifndef PAGE_KERNEL_RO
990     #define PAGE_KERNEL_RO PAGE_KERNEL
991     @@ -157,21 +168,21 @@ static ssize_t firmware_loading_store(struct device *dev,
992     mutex_unlock(&fw_lock);
993     break;
994     }
995     - vfree(fw_priv->fw->data);
996     - fw_priv->fw->data = NULL;
997     + firmware_free_data(fw_priv->fw);
998     + memset(fw_priv->fw, 0, sizeof(struct firmware));
999     + /* If the pages are not owned by 'struct firmware' */
1000     for (i = 0; i < fw_priv->nr_pages; i++)
1001     __free_page(fw_priv->pages[i]);
1002     kfree(fw_priv->pages);
1003     fw_priv->pages = NULL;
1004     fw_priv->page_array_size = 0;
1005     fw_priv->nr_pages = 0;
1006     - fw_priv->fw->size = 0;
1007     set_bit(FW_STATUS_LOADING, &fw_priv->status);
1008     mutex_unlock(&fw_lock);
1009     break;
1010     case 0:
1011     if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
1012     - vfree(fw_priv->fw->data);
1013     + vunmap(fw_priv->fw->data);
1014     fw_priv->fw->data = vmap(fw_priv->pages,
1015     fw_priv->nr_pages,
1016     0, PAGE_KERNEL_RO);
1017     @@ -179,7 +190,10 @@ static ssize_t firmware_loading_store(struct device *dev,
1018     dev_err(dev, "%s: vmap() failed\n", __func__);
1019     goto err;
1020     }
1021     - /* Pages will be freed by vfree() */
1022     + /* Pages are now owned by 'struct firmware' */
1023     + fw_priv->fw->pages = fw_priv->pages;
1024     + fw_priv->pages = NULL;
1025     +
1026     fw_priv->page_array_size = 0;
1027     fw_priv->nr_pages = 0;
1028     complete(&fw_priv->completion);
1029     @@ -572,7 +586,7 @@ release_firmware(const struct firmware *fw)
1030     if (fw->data == builtin->data)
1031     goto free_fw;
1032     }
1033     - vfree(fw->data);
1034     + firmware_free_data(fw);
1035     free_fw:
1036     kfree(fw);
1037     }
1038     diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
1039     index fd50ead..93f56d6 100644
1040     --- a/drivers/char/agp/amd64-agp.c
1041     +++ b/drivers/char/agp/amd64-agp.c
1042     @@ -499,6 +499,10 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
1043     u8 cap_ptr;
1044     int err;
1045    
1046     + /* The Highlander principle */
1047     + if (agp_bridges_found)
1048     + return -ENODEV;
1049     +
1050     cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
1051     if (!cap_ptr)
1052     return -ENODEV;
1053     @@ -562,6 +566,8 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
1054     amd64_aperture_sizes[bridge->aperture_size_idx].size);
1055     agp_remove_bridge(bridge);
1056     agp_put_bridge(bridge);
1057     +
1058     + agp_bridges_found--;
1059     }
1060    
1061     #ifdef CONFIG_PM
1062     @@ -709,6 +715,11 @@ static struct pci_device_id agp_amd64_pci_table[] = {
1063    
1064     MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table);
1065    
1066     +static DEFINE_PCI_DEVICE_TABLE(agp_amd64_pci_promisc_table) = {
1067     + { PCI_DEVICE_CLASS(0, 0) },
1068     + { }
1069     +};
1070     +
1071     static struct pci_driver agp_amd64_pci_driver = {
1072     .name = "agpgart-amd64",
1073     .id_table = agp_amd64_pci_table,
1074     @@ -734,7 +745,6 @@ int __init agp_amd64_init(void)
1075     return err;
1076    
1077     if (agp_bridges_found == 0) {
1078     - struct pci_dev *dev;
1079     if (!agp_try_unsupported && !agp_try_unsupported_boot) {
1080     printk(KERN_INFO PFX "No supported AGP bridge found.\n");
1081     #ifdef MODULE
1082     @@ -750,17 +760,10 @@ int __init agp_amd64_init(void)
1083     return -ENODEV;
1084    
1085     /* Look for any AGP bridge */
1086     - dev = NULL;
1087     - err = -ENODEV;
1088     - for_each_pci_dev(dev) {
1089     - if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
1090     - continue;
1091     - /* Only one bridge supported right now */
1092     - if (agp_amd64_probe(dev, NULL) == 0) {
1093     - err = 0;
1094     - break;
1095     - }
1096     - }
1097     + agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table;
1098     + err = driver_attach(&agp_amd64_pci_driver.driver);
1099     + if (err == 0 && agp_bridges_found == 0)
1100     + err = -ENODEV;
1101     }
1102     return err;
1103     }
1104     diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
1105     index 8e00b4d..792868d 100644
1106     --- a/drivers/char/tpm/tpm.h
1107     +++ b/drivers/char/tpm/tpm.h
1108     @@ -224,6 +224,7 @@ struct tpm_readpubek_params_out {
1109     u8 algorithm[4];
1110     u8 encscheme[2];
1111     u8 sigscheme[2];
1112     + __be32 paramsize;
1113     u8 parameters[12]; /*assuming RSA*/
1114     __be32 keysize;
1115     u8 modulus[256];
1116     diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
1117     index 2405f17..ca15c04 100644
1118     --- a/drivers/char/tpm/tpm_tis.c
1119     +++ b/drivers/char/tpm/tpm_tis.c
1120     @@ -622,7 +622,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
1121    
1122     static int tpm_tis_pnp_resume(struct pnp_dev *dev)
1123     {
1124     - return tpm_pm_resume(&dev->dev);
1125     + struct tpm_chip *chip = pnp_get_drvdata(dev);
1126     + int ret;
1127     +
1128     + ret = tpm_pm_resume(&dev->dev);
1129     + if (!ret)
1130     + tpm_continue_selftest(chip);
1131     +
1132     + return ret;
1133     }
1134    
1135     static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
1136     diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
1137     index 67bc2ec..295dc63 100644
1138     --- a/drivers/cpufreq/cpufreq.c
1139     +++ b/drivers/cpufreq/cpufreq.c
1140     @@ -1765,17 +1765,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1141     dprintk("governor switch\n");
1142    
1143     /* end old governor */
1144     - if (data->governor) {
1145     - /*
1146     - * Need to release the rwsem around governor
1147     - * stop due to lock dependency between
1148     - * cancel_delayed_work_sync and the read lock
1149     - * taken in the delayed work handler.
1150     - */
1151     - unlock_policy_rwsem_write(data->cpu);
1152     + if (data->governor)
1153     __cpufreq_governor(data, CPUFREQ_GOV_STOP);
1154     - lock_policy_rwsem_write(data->cpu);
1155     - }
1156    
1157     /* start new governor */
1158     data->governor = policy->governor;
1159     diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
1160     index 55c9c59..d3b21a5 100644
1161     --- a/drivers/edac/Kconfig
1162     +++ b/drivers/edac/Kconfig
1163     @@ -196,7 +196,7 @@ config EDAC_I5100
1164    
1165     config EDAC_MPC85XX
1166     tristate "Freescale MPC83xx / MPC85xx"
1167     - depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx)
1168     + depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx)
1169     help
1170     Support for error detection and correction on the Freescale
1171     MPC8349, MPC8560, MPC8540, MPC8548
1172     diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
1173     index 3391e67..72904c8 100644
1174     --- a/drivers/edac/amd64_edac.c
1175     +++ b/drivers/edac/amd64_edac.c
1176     @@ -1958,20 +1958,20 @@ static int get_channel_from_ecc_syndrome(struct mem_ctl_info *mci, u16 syndrome)
1177     u32 value = 0;
1178     int err_sym = 0;
1179    
1180     - amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value);
1181     + if (boot_cpu_data.x86 == 0x10) {
1182    
1183     - /* F3x180[EccSymbolSize]=1, x8 symbols */
1184     - if (boot_cpu_data.x86 == 0x10 &&
1185     - boot_cpu_data.x86_model > 7 &&
1186     - value & BIT(25)) {
1187     - err_sym = decode_syndrome(syndrome, x8_vectors,
1188     - ARRAY_SIZE(x8_vectors), 8);
1189     - return map_err_sym_to_channel(err_sym, 8);
1190     - } else {
1191     - err_sym = decode_syndrome(syndrome, x4_vectors,
1192     - ARRAY_SIZE(x4_vectors), 4);
1193     - return map_err_sym_to_channel(err_sym, 4);
1194     + amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value);
1195     +
1196     + /* F3x180[EccSymbolSize]=1 => x8 symbols */
1197     + if (boot_cpu_data.x86_model > 7 &&
1198     + value & BIT(25)) {
1199     + err_sym = decode_syndrome(syndrome, x8_vectors,
1200     + ARRAY_SIZE(x8_vectors), 8);
1201     + return map_err_sym_to_channel(err_sym, 8);
1202     + }
1203     }
1204     + err_sym = decode_syndrome(syndrome, x4_vectors, ARRAY_SIZE(x4_vectors), 4);
1205     + return map_err_sym_to_channel(err_sym, 4);
1206     }
1207    
1208     /*
1209     diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
1210     index 930664c..73bd7f4 100644
1211     --- a/drivers/gpu/drm/i915/i915_drv.c
1212     +++ b/drivers/gpu/drm/i915/i915_drv.c
1213     @@ -328,6 +328,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
1214     }
1215     } else {
1216     DRM_ERROR("Error occurred. Don't know how to reset this chip.\n");
1217     + mutex_unlock(&dev->struct_mutex);
1218     return -ENODEV;
1219     }
1220    
1221     diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
1222     index 4a44de4..8a41c4e 100644
1223     --- a/drivers/gpu/drm/i915/i915_gem.c
1224     +++ b/drivers/gpu/drm/i915/i915_gem.c
1225     @@ -2288,8 +2288,9 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
1226     mapping = inode->i_mapping;
1227     for (i = 0; i < page_count; i++) {
1228     page = read_cache_page_gfp(mapping, i,
1229     - mapping_gfp_mask (mapping) |
1230     + GFP_HIGHUSER |
1231     __GFP_COLD |
1232     + __GFP_RECLAIMABLE |
1233     gfpmask);
1234     if (IS_ERR(page))
1235     goto err_pages;
1236     @@ -4998,6 +4999,16 @@ i915_gem_load(struct drm_device *dev)
1237     list_add(&dev_priv->mm.shrink_list, &shrink_list);
1238     spin_unlock(&shrink_list_lock);
1239    
1240     + /* On GEN3 we really need to make sure the ARB C3 LP bit is set */
1241     + if (IS_GEN3(dev)) {
1242     + u32 tmp = I915_READ(MI_ARB_STATE);
1243     + if (!(tmp & MI_ARB_C3_LP_WRITE_ENABLE)) {
1244     + /* arb state is a masked write, so set bit + bit in mask */
1245     + tmp = MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE << MI_ARB_MASK_SHIFT);
1246     + I915_WRITE(MI_ARB_STATE, tmp);
1247     + }
1248     + }
1249     +
1250     /* Old X drivers will take 0-2 for front, back, depth buffers */
1251     dev_priv->fence_reg_start = 3;
1252    
1253     diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
1254     index 30a2322..635d349 100644
1255     --- a/drivers/gpu/drm/i915/i915_reg.h
1256     +++ b/drivers/gpu/drm/i915/i915_reg.h
1257     @@ -326,6 +326,70 @@
1258     #define LM_BURST_LENGTH 0x00000700
1259     #define LM_FIFO_WATERMARK 0x0000001F
1260     #define MI_ARB_STATE 0x020e4 /* 915+ only */
1261     +#define MI_ARB_MASK_SHIFT 16 /* shift for enable bits */
1262     +
1263     +/* Make render/texture TLB fetches lower priorty than associated data
1264     + * fetches. This is not turned on by default
1265     + */
1266     +#define MI_ARB_RENDER_TLB_LOW_PRIORITY (1 << 15)
1267     +
1268     +/* Isoch request wait on GTT enable (Display A/B/C streams).
1269     + * Make isoch requests stall on the TLB update. May cause
1270     + * display underruns (test mode only)
1271     + */
1272     +#define MI_ARB_ISOCH_WAIT_GTT (1 << 14)
1273     +
1274     +/* Block grant count for isoch requests when block count is
1275     + * set to a finite value.
1276     + */
1277     +#define MI_ARB_BLOCK_GRANT_MASK (3 << 12)
1278     +#define MI_ARB_BLOCK_GRANT_8 (0 << 12) /* for 3 display planes */
1279     +#define MI_ARB_BLOCK_GRANT_4 (1 << 12) /* for 2 display planes */
1280     +#define MI_ARB_BLOCK_GRANT_2 (2 << 12) /* for 1 display plane */
1281     +#define MI_ARB_BLOCK_GRANT_0 (3 << 12) /* don't use */
1282     +
1283     +/* Enable render writes to complete in C2/C3/C4 power states.
1284     + * If this isn't enabled, render writes are prevented in low
1285     + * power states. That seems bad to me.
1286     + */
1287     +#define MI_ARB_C3_LP_WRITE_ENABLE (1 << 11)
1288     +
1289     +/* This acknowledges an async flip immediately instead
1290     + * of waiting for 2TLB fetches.
1291     + */
1292     +#define MI_ARB_ASYNC_FLIP_ACK_IMMEDIATE (1 << 10)
1293     +
1294     +/* Enables non-sequential data reads through arbiter
1295     + */
1296     +#define MI_ARB_DUAL_DATA_PHASE_DISABLE (1 << 9)
1297     +
1298     +/* Disable FSB snooping of cacheable write cycles from binner/render
1299     + * command stream
1300     + */
1301     +#define MI_ARB_CACHE_SNOOP_DISABLE (1 << 8)
1302     +
1303     +/* Arbiter time slice for non-isoch streams */
1304     +#define MI_ARB_TIME_SLICE_MASK (7 << 5)
1305     +#define MI_ARB_TIME_SLICE_1 (0 << 5)
1306     +#define MI_ARB_TIME_SLICE_2 (1 << 5)
1307     +#define MI_ARB_TIME_SLICE_4 (2 << 5)
1308     +#define MI_ARB_TIME_SLICE_6 (3 << 5)
1309     +#define MI_ARB_TIME_SLICE_8 (4 << 5)
1310     +#define MI_ARB_TIME_SLICE_10 (5 << 5)
1311     +#define MI_ARB_TIME_SLICE_14 (6 << 5)
1312     +#define MI_ARB_TIME_SLICE_16 (7 << 5)
1313     +
1314     +/* Low priority grace period page size */
1315     +#define MI_ARB_LOW_PRIORITY_GRACE_4KB (0 << 4) /* default */
1316     +#define MI_ARB_LOW_PRIORITY_GRACE_8KB (1 << 4)
1317     +
1318     +/* Disable display A/B trickle feed */
1319     +#define MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE (1 << 2)
1320     +
1321     +/* Set display plane priority */
1322     +#define MI_ARB_DISPLAY_PRIORITY_A_B (0 << 0) /* display A > display B */
1323     +#define MI_ARB_DISPLAY_PRIORITY_B_A (1 << 0) /* display B > display A */
1324     +
1325     #define CACHE_MODE_0 0x02120 /* 915+ only */
1326     #define CM0_MASK_SHIFT 16
1327     #define CM0_IZ_OPT_DISABLE (1<<6)
1328     diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
1329     index 3f00902..d63173a 100644
1330     --- a/drivers/gpu/drm/i915/intel_display.c
1331     +++ b/drivers/gpu/drm/i915/intel_display.c
1332     @@ -879,8 +879,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
1333     intel_clock_t clock;
1334     int max_n;
1335     bool found;
1336     - /* approximately equals target * 0.00488 */
1337     - int err_most = (target >> 8) + (target >> 10);
1338     + /* approximately equals target * 0.00585 */
1339     + int err_most = (target >> 8) + (target >> 9);
1340     found = false;
1341    
1342     if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
1343     diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
1344     index c0d4650..3ecd236 100644
1345     --- a/drivers/gpu/drm/radeon/r100.c
1346     +++ b/drivers/gpu/drm/radeon/r100.c
1347     @@ -1384,6 +1384,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
1348     case RADEON_TXFORMAT_RGB332:
1349     case RADEON_TXFORMAT_Y8:
1350     track->textures[i].cpp = 1;
1351     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1352     break;
1353     case RADEON_TXFORMAT_AI88:
1354     case RADEON_TXFORMAT_ARGB1555:
1355     @@ -1395,12 +1396,14 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
1356     case RADEON_TXFORMAT_LDUDV655:
1357     case RADEON_TXFORMAT_DUDV88:
1358     track->textures[i].cpp = 2;
1359     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1360     break;
1361     case RADEON_TXFORMAT_ARGB8888:
1362     case RADEON_TXFORMAT_RGBA8888:
1363     case RADEON_TXFORMAT_SHADOW32:
1364     case RADEON_TXFORMAT_LDUDUV8888:
1365     track->textures[i].cpp = 4;
1366     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1367     break;
1368     case RADEON_TXFORMAT_DXT1:
1369     track->textures[i].cpp = 1;
1370     @@ -2750,33 +2753,6 @@ static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t)
1371     DRM_ERROR("compress format %d\n", t->compress_format);
1372     }
1373    
1374     -static int r100_cs_track_cube(struct radeon_device *rdev,
1375     - struct r100_cs_track *track, unsigned idx)
1376     -{
1377     - unsigned face, w, h;
1378     - struct radeon_bo *cube_robj;
1379     - unsigned long size;
1380     -
1381     - for (face = 0; face < 5; face++) {
1382     - cube_robj = track->textures[idx].cube_info[face].robj;
1383     - w = track->textures[idx].cube_info[face].width;
1384     - h = track->textures[idx].cube_info[face].height;
1385     -
1386     - size = w * h;
1387     - size *= track->textures[idx].cpp;
1388     -
1389     - size += track->textures[idx].cube_info[face].offset;
1390     -
1391     - if (size > radeon_bo_size(cube_robj)) {
1392     - DRM_ERROR("Cube texture offset greater than object size %lu %lu\n",
1393     - size, radeon_bo_size(cube_robj));
1394     - r100_cs_track_texture_print(&track->textures[idx]);
1395     - return -1;
1396     - }
1397     - }
1398     - return 0;
1399     -}
1400     -
1401     static int r100_track_compress_size(int compress_format, int w, int h)
1402     {
1403     int block_width, block_height, block_bytes;
1404     @@ -2807,6 +2783,37 @@ static int r100_track_compress_size(int compress_format, int w, int h)
1405     return sz;
1406     }
1407    
1408     +static int r100_cs_track_cube(struct radeon_device *rdev,
1409     + struct r100_cs_track *track, unsigned idx)
1410     +{
1411     + unsigned face, w, h;
1412     + struct radeon_bo *cube_robj;
1413     + unsigned long size;
1414     + unsigned compress_format = track->textures[idx].compress_format;
1415     +
1416     + for (face = 0; face < 5; face++) {
1417     + cube_robj = track->textures[idx].cube_info[face].robj;
1418     + w = track->textures[idx].cube_info[face].width;
1419     + h = track->textures[idx].cube_info[face].height;
1420     +
1421     + if (compress_format) {
1422     + size = r100_track_compress_size(compress_format, w, h);
1423     + } else
1424     + size = w * h;
1425     + size *= track->textures[idx].cpp;
1426     +
1427     + size += track->textures[idx].cube_info[face].offset;
1428     +
1429     + if (size > radeon_bo_size(cube_robj)) {
1430     + DRM_ERROR("Cube texture offset greater than object size %lu %lu\n",
1431     + size, radeon_bo_size(cube_robj));
1432     + r100_cs_track_texture_print(&track->textures[idx]);
1433     + return -1;
1434     + }
1435     + }
1436     + return 0;
1437     +}
1438     +
1439     static int r100_cs_track_texture_check(struct radeon_device *rdev,
1440     struct r100_cs_track *track)
1441     {
1442     diff --git a/drivers/gpu/drm/radeon/r200.c b/drivers/gpu/drm/radeon/r200.c
1443     index ff1e0cd..f890fd3 100644
1444     --- a/drivers/gpu/drm/radeon/r200.c
1445     +++ b/drivers/gpu/drm/radeon/r200.c
1446     @@ -368,6 +368,8 @@ int r200_packet0_check(struct radeon_cs_parser *p,
1447     /* 2D, 3D, CUBE */
1448     switch (tmp) {
1449     case 0:
1450     + case 3:
1451     + case 4:
1452     case 5:
1453     case 6:
1454     case 7:
1455     @@ -403,6 +405,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
1456     case R200_TXFORMAT_RGB332:
1457     case R200_TXFORMAT_Y8:
1458     track->textures[i].cpp = 1;
1459     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1460     break;
1461     case R200_TXFORMAT_AI88:
1462     case R200_TXFORMAT_ARGB1555:
1463     @@ -414,6 +417,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
1464     case R200_TXFORMAT_DVDU88:
1465     case R200_TXFORMAT_AVYU4444:
1466     track->textures[i].cpp = 2;
1467     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1468     break;
1469     case R200_TXFORMAT_ARGB8888:
1470     case R200_TXFORMAT_RGBA8888:
1471     @@ -421,6 +425,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
1472     case R200_TXFORMAT_BGR111110:
1473     case R200_TXFORMAT_LDVDU8888:
1474     track->textures[i].cpp = 4;
1475     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1476     break;
1477     case R200_TXFORMAT_DXT1:
1478     track->textures[i].cpp = 1;
1479     diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
1480     index 5bdfaf2..7e9868d 100644
1481     --- a/drivers/gpu/drm/radeon/r300.c
1482     +++ b/drivers/gpu/drm/radeon/r300.c
1483     @@ -870,6 +870,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1484     case R300_TX_FORMAT_Y4X4:
1485     case R300_TX_FORMAT_Z3Y3X2:
1486     track->textures[i].cpp = 1;
1487     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1488     break;
1489     case R300_TX_FORMAT_X16:
1490     case R300_TX_FORMAT_Y8X8:
1491     @@ -881,6 +882,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1492     case R300_TX_FORMAT_B8G8_B8G8:
1493     case R300_TX_FORMAT_G8R8_G8B8:
1494     track->textures[i].cpp = 2;
1495     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1496     break;
1497     case R300_TX_FORMAT_Y16X16:
1498     case R300_TX_FORMAT_Z11Y11X10:
1499     @@ -891,14 +893,17 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1500     case R300_TX_FORMAT_FL_I32:
1501     case 0x1e:
1502     track->textures[i].cpp = 4;
1503     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1504     break;
1505     case R300_TX_FORMAT_W16Z16Y16X16:
1506     case R300_TX_FORMAT_FL_R16G16B16A16:
1507     case R300_TX_FORMAT_FL_I32A32:
1508     track->textures[i].cpp = 8;
1509     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1510     break;
1511     case R300_TX_FORMAT_FL_R32G32B32A32:
1512     track->textures[i].cpp = 16;
1513     + track->textures[i].compress_format = R100_TRACK_COMP_NONE;
1514     break;
1515     case R300_TX_FORMAT_DXT1:
1516     track->textures[i].cpp = 1;
1517     diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
1518     index ff02664..e249933 100644
1519     --- a/drivers/gpu/drm/radeon/radeon_atombios.c
1520     +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
1521     @@ -268,6 +268,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
1522     }
1523     }
1524    
1525     + /* ASUS HD 3600 board lists the DVI port as HDMI */
1526     + if ((dev->pdev->device == 0x9598) &&
1527     + (dev->pdev->subsystem_vendor == 0x1043) &&
1528     + (dev->pdev->subsystem_device == 0x01e4)) {
1529     + if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) {
1530     + *connector_type = DRM_MODE_CONNECTOR_DVII;
1531     + }
1532     + }
1533     +
1534     /* ASUS HD 3450 board lists the DVI port as HDMI */
1535     if ((dev->pdev->device == 0x95C5) &&
1536     (dev->pdev->subsystem_vendor == 0x1043) &&
1537     @@ -977,8 +986,15 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev)
1538     if (igp_info) {
1539     switch (crev) {
1540     case 1:
1541     - if (igp_info->info.ucMemoryType & 0xf0)
1542     - return true;
1543     + /* AMD IGPS */
1544     + if ((rdev->family == CHIP_RS690) ||
1545     + (rdev->family == CHIP_RS740)) {
1546     + if (igp_info->info.ulBootUpMemoryClock)
1547     + return true;
1548     + } else {
1549     + if (igp_info->info.ucMemoryType & 0xf0)
1550     + return true;
1551     + }
1552     break;
1553     case 2:
1554     if (igp_info->info_2.ucMemoryType & 0x0f)
1555     diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
1556     index 2bdfbcd..c263f8e 100644
1557     --- a/drivers/gpu/drm/radeon/radeon_connectors.c
1558     +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
1559     @@ -779,30 +779,27 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
1560     } else
1561     ret = connector_status_connected;
1562    
1563     - /* multiple connectors on the same encoder with the same ddc line
1564     - * This tends to be HDMI and DVI on the same encoder with the
1565     - * same ddc line. If the edid says HDMI, consider the HDMI port
1566     - * connected and the DVI port disconnected. If the edid doesn't
1567     - * say HDMI, vice versa.
1568     + /* This gets complicated. We have boards with VGA + HDMI with a
1569     + * shared DDC line and we have boards with DVI-D + HDMI with a shared
1570     + * DDC line. The latter is more complex because with DVI<->HDMI adapters
1571     + * you don't really know what's connected to which port as both are digital.
1572     */
1573     if (radeon_connector->shared_ddc && (ret == connector_status_connected)) {
1574     struct drm_device *dev = connector->dev;
1575     + struct radeon_device *rdev = dev->dev_private;
1576     struct drm_connector *list_connector;
1577     struct radeon_connector *list_radeon_connector;
1578     list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) {
1579     if (connector == list_connector)
1580     continue;
1581     list_radeon_connector = to_radeon_connector(list_connector);
1582     - if (radeon_connector->devices == list_radeon_connector->devices) {
1583     - if (drm_detect_hdmi_monitor(radeon_connector->edid)) {
1584     - if (connector->connector_type == DRM_MODE_CONNECTOR_DVID) {
1585     - kfree(radeon_connector->edid);
1586     - radeon_connector->edid = NULL;
1587     - ret = connector_status_disconnected;
1588     - }
1589     - } else {
1590     - if ((connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) ||
1591     - (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)) {
1592     + if (list_radeon_connector->shared_ddc &&
1593     + (list_radeon_connector->ddc_bus->rec.i2c_id ==
1594     + radeon_connector->ddc_bus->rec.i2c_id)) {
1595     + /* cases where both connectors are digital */
1596     + if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) {
1597     + /* hpd is our only option in this case */
1598     + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
1599     kfree(radeon_connector->edid);
1600     radeon_connector->edid = NULL;
1601     ret = connector_status_disconnected;
1602     diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
1603     index 38e45e2..5c2672f 100644
1604     --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
1605     +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
1606     @@ -108,6 +108,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode)
1607     udelay(panel_pwr_delay * 1000);
1608     WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
1609     WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl);
1610     + udelay(panel_pwr_delay * 1000);
1611     break;
1612     }
1613    
1614     diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
1615     index f2ed27c..0320403 100644
1616     --- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
1617     +++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
1618     @@ -642,8 +642,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
1619     }
1620     flicker_removal = (tmp + 500) / 1000;
1621    
1622     - if (flicker_removal < 2)
1623     - flicker_removal = 2;
1624     + if (flicker_removal < 3)
1625     + flicker_removal = 3;
1626     for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) {
1627     if (flicker_removal == SLOPE_limit[i])
1628     break;
1629     diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
1630     index cb4290a..5852191 100644
1631     --- a/drivers/hwmon/coretemp.c
1632     +++ b/drivers/hwmon/coretemp.c
1633     @@ -53,6 +53,7 @@ struct coretemp_data {
1634     struct mutex update_lock;
1635     const char *name;
1636     u32 id;
1637     + u16 core_id;
1638     char valid; /* zero until following fields are valid */
1639     unsigned long last_updated; /* in jiffies */
1640     int temp;
1641     @@ -75,7 +76,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute
1642     if (attr->index == SHOW_NAME)
1643     ret = sprintf(buf, "%s\n", data->name);
1644     else /* show label */
1645     - ret = sprintf(buf, "Core %d\n", data->id);
1646     + ret = sprintf(buf, "Core %d\n", data->core_id);
1647     return ret;
1648     }
1649    
1650     @@ -255,6 +256,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
1651     }
1652    
1653     data->id = pdev->id;
1654     +#ifdef CONFIG_SMP
1655     + data->core_id = c->cpu_core_id;
1656     +#endif
1657     data->name = "coretemp";
1658     mutex_init(&data->update_lock);
1659    
1660     @@ -352,6 +356,10 @@ struct pdev_entry {
1661     struct list_head list;
1662     struct platform_device *pdev;
1663     unsigned int cpu;
1664     +#ifdef CONFIG_SMP
1665     + u16 phys_proc_id;
1666     + u16 cpu_core_id;
1667     +#endif
1668     };
1669    
1670     static LIST_HEAD(pdev_list);
1671     @@ -362,6 +370,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
1672     int err;
1673     struct platform_device *pdev;
1674     struct pdev_entry *pdev_entry;
1675     +#ifdef CONFIG_SMP
1676     + struct cpuinfo_x86 *c = &cpu_data(cpu);
1677     +#endif
1678     +
1679     + mutex_lock(&pdev_list_mutex);
1680     +
1681     +#ifdef CONFIG_SMP
1682     + /* Skip second HT entry of each core */
1683     + list_for_each_entry(pdev_entry, &pdev_list, list) {
1684     + if (c->phys_proc_id == pdev_entry->phys_proc_id &&
1685     + c->cpu_core_id == pdev_entry->cpu_core_id) {
1686     + err = 0; /* Not an error */
1687     + goto exit;
1688     + }
1689     + }
1690     +#endif
1691    
1692     pdev = platform_device_alloc(DRVNAME, cpu);
1693     if (!pdev) {
1694     @@ -385,7 +409,10 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
1695    
1696     pdev_entry->pdev = pdev;
1697     pdev_entry->cpu = cpu;
1698     - mutex_lock(&pdev_list_mutex);
1699     +#ifdef CONFIG_SMP
1700     + pdev_entry->phys_proc_id = c->phys_proc_id;
1701     + pdev_entry->cpu_core_id = c->cpu_core_id;
1702     +#endif
1703     list_add_tail(&pdev_entry->list, &pdev_list);
1704     mutex_unlock(&pdev_list_mutex);
1705    
1706     @@ -396,6 +423,7 @@ exit_device_free:
1707     exit_device_put:
1708     platform_device_put(pdev);
1709     exit:
1710     + mutex_unlock(&pdev_list_mutex);
1711     return err;
1712     }
1713    
1714     diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
1715     index 0ffe84d..ec7e8a0 100644
1716     --- a/drivers/hwmon/it87.c
1717     +++ b/drivers/hwmon/it87.c
1718     @@ -80,6 +80,13 @@ superio_inb(int reg)
1719     return inb(VAL);
1720     }
1721    
1722     +static inline void
1723     +superio_outb(int reg, int val)
1724     +{
1725     + outb(reg, REG);
1726     + outb(val, VAL);
1727     +}
1728     +
1729     static int superio_inw(int reg)
1730     {
1731     int val;
1732     @@ -1064,6 +1071,21 @@ static int __init it87_find(unsigned short *address,
1733     sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
1734    
1735     reg = superio_inb(IT87_SIO_PINX2_REG);
1736     + /*
1737     + * The IT8720F has no VIN7 pin, so VCCH should always be
1738     + * routed internally to VIN7 with an internal divider.
1739     + * Curiously, there still is a configuration bit to control
1740     + * this, which means it can be set incorrectly. And even
1741     + * more curiously, many boards out there are improperly
1742     + * configured, even though the IT8720F datasheet claims
1743     + * that the internal routing of VCCH to VIN7 is the default
1744     + * setting. So we force the internal routing in this case.
1745     + */
1746     + if (sio_data->type == it8720 && !(reg & (1 << 1))) {
1747     + reg |= (1 << 1);
1748     + superio_outb(IT87_SIO_PINX2_REG, reg);
1749     + pr_notice("it87: Routing internal VCCH to in7\n");
1750     + }
1751     if (reg & (1 << 0))
1752     pr_info("it87: in3 is VCC (+5V)\n");
1753     if (reg & (1 << 1))
1754     diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
1755     index 099a213..da5a240 100644
1756     --- a/drivers/hwmon/k10temp.c
1757     +++ b/drivers/hwmon/k10temp.c
1758     @@ -112,11 +112,21 @@ static bool __devinit has_erratum_319(struct pci_dev *pdev)
1759     if (pkg_type != CPUID_PKGTYPE_AM2R2_AM3)
1760     return false;
1761    
1762     - /* Differentiate between AM2+ (bad) and AM3 (good) */
1763     + /* DDR3 memory implies socket AM3, which is good */
1764     pci_bus_read_config_dword(pdev->bus,
1765     PCI_DEVFN(PCI_SLOT(pdev->devfn), 2),
1766     REG_DCT0_CONFIG_HIGH, &reg_dram_cfg);
1767     - return !(reg_dram_cfg & DDR3_MODE);
1768     + if (reg_dram_cfg & DDR3_MODE)
1769     + return false;
1770     +
1771     + /*
1772     + * Unfortunately it is possible to run a socket AM3 CPU with DDR2
1773     + * memory. We blacklist all the cores which do exist in socket AM2+
1774     + * format. It still isn't perfect, as RB-C2 cores exist in both AM2+
1775     + * and AM3 formats, but that's the best we can do.
1776     + */
1777     + return boot_cpu_data.x86_model < 4 ||
1778     + (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2);
1779     }
1780    
1781     static int __devinit k10temp_probe(struct pci_dev *pdev,
1782     diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
1783     index 0ceb6d6..8bdf80d 100644
1784     --- a/drivers/hwmon/k8temp.c
1785     +++ b/drivers/hwmon/k8temp.c
1786     @@ -120,7 +120,7 @@ static ssize_t show_temp(struct device *dev,
1787     int temp;
1788     struct k8temp_data *data = k8temp_update_device(dev);
1789    
1790     - if (data->swap_core_select)
1791     + if (data->swap_core_select && (data->sensorsp & SEL_CORE))
1792     core = core ? 0 : 1;
1793    
1794     temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset;
1795     @@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
1796     }
1797    
1798     if ((model >= 0x69) &&
1799     - !(model == 0xc1 || model == 0x6c || model == 0x7c)) {
1800     + !(model == 0xc1 || model == 0x6c || model == 0x7c ||
1801     + model == 0x6b || model == 0x6f || model == 0x7f)) {
1802     /*
1803     - * RevG desktop CPUs (i.e. no socket S1G1 parts)
1804     - * need additional offset, otherwise reported
1805     - * temperature is below ambient temperature
1806     + * RevG desktop CPUs (i.e. no socket S1G1 or
1807     + * ASB1 parts) need additional offset,
1808     + * otherwise reported temperature is below
1809     + * ambient temperature
1810     */
1811     data->temp_offset = 21000;
1812     }
1813     diff --git a/drivers/ide/cmd640.c b/drivers/ide/cmd640.c
1814     index 1a32d62..a9c3313 100644
1815     --- a/drivers/ide/cmd640.c
1816     +++ b/drivers/ide/cmd640.c
1817     @@ -632,12 +632,10 @@ static void cmd640_init_dev(ide_drive_t *drive)
1818    
1819     static int cmd640_test_irq(ide_hwif_t *hwif)
1820     {
1821     - struct pci_dev *dev = to_pci_dev(hwif->dev);
1822     int irq_reg = hwif->channel ? ARTTIM23 : CFR;
1823     - u8 irq_stat, irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
1824     + u8 irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
1825     CFR_IDE01INTR;
1826     -
1827     - pci_read_config_byte(dev, irq_reg, &irq_stat);
1828     + u8 irq_stat = get_cmd640_reg(irq_reg);
1829    
1830     return (irq_stat & irq_mask) ? 1 : 0;
1831     }
1832     diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
1833     index cc8633c..67fb735 100644
1834     --- a/drivers/ide/ide-taskfile.c
1835     +++ b/drivers/ide/ide-taskfile.c
1836     @@ -428,13 +428,11 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
1837     {
1838     struct request *rq;
1839     int error;
1840     + int rw = !(cmd->tf_flags & IDE_TFLAG_WRITE) ? READ : WRITE;
1841    
1842     - rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
1843     + rq = blk_get_request(drive->queue, rw, __GFP_WAIT);
1844     rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
1845    
1846     - if (cmd->tf_flags & IDE_TFLAG_WRITE)
1847     - rq->cmd_flags |= REQ_RW;
1848     -
1849     /*
1850     * (ks) We transfer currently only whole sectors.
1851     * This is suffient for now. But, it would be great,
1852     diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
1853     index df3eb8c..b4b2257 100644
1854     --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
1855     +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
1856     @@ -1163,7 +1163,7 @@ static ssize_t create_child(struct device *dev,
1857    
1858     return ret ? ret : count;
1859     }
1860     -static DEVICE_ATTR(create_child, S_IWUGO, NULL, create_child);
1861     +static DEVICE_ATTR(create_child, S_IWUSR, NULL, create_child);
1862    
1863     static ssize_t delete_child(struct device *dev,
1864     struct device_attribute *attr,
1865     @@ -1183,7 +1183,7 @@ static ssize_t delete_child(struct device *dev,
1866     return ret ? ret : count;
1867    
1868     }
1869     -static DEVICE_ATTR(delete_child, S_IWUGO, NULL, delete_child);
1870     +static DEVICE_ATTR(delete_child, S_IWUSR, NULL, delete_child);
1871    
1872     int ipoib_add_pkey_attr(struct net_device *dev)
1873     {
1874     diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
1875     index 21d6184..7fa439b 100644
1876     --- a/drivers/input/keyboard/twl4030_keypad.c
1877     +++ b/drivers/input/keyboard/twl4030_keypad.c
1878     @@ -50,8 +50,12 @@
1879     */
1880     #define TWL4030_MAX_ROWS 8 /* TWL4030 hard limit */
1881     #define TWL4030_MAX_COLS 8
1882     -#define TWL4030_ROW_SHIFT 3
1883     -#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS * TWL4030_MAX_COLS)
1884     +/*
1885     + * Note that we add space for an extra column so that we can handle
1886     + * row lines connected to the gnd (see twl4030_col_xlate()).
1887     + */
1888     +#define TWL4030_ROW_SHIFT 4
1889     +#define TWL4030_KEYMAP_SIZE (TWL4030_MAX_ROWS << TWL4030_ROW_SHIFT)
1890    
1891     struct twl4030_keypad {
1892     unsigned short keymap[TWL4030_KEYMAP_SIZE];
1893     @@ -181,7 +185,7 @@ static int twl4030_read_kp_matrix_state(struct twl4030_keypad *kp, u16 *state)
1894     return ret;
1895     }
1896    
1897     -static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
1898     +static bool twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
1899     {
1900     int i;
1901     u16 check = 0;
1902     @@ -190,12 +194,12 @@ static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
1903     u16 col = key_state[i];
1904    
1905     if ((col & check) && hweight16(col) > 1)
1906     - return 1;
1907     + return true;
1908    
1909     check |= col;
1910     }
1911    
1912     - return 0;
1913     + return false;
1914     }
1915    
1916     static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
1917     @@ -224,7 +228,8 @@ static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
1918     if (!changed)
1919     continue;
1920    
1921     - for (col = 0; col < kp->n_cols; col++) {
1922     + /* Extra column handles "all gnd" rows */
1923     + for (col = 0; col < kp->n_cols + 1; col++) {
1924     int code;
1925    
1926     if (!(changed & (1 << col)))
1927     diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
1928     index 525b9b9..ba09e4d 100644
1929     --- a/drivers/input/serio/i8042-x86ia64io.h
1930     +++ b/drivers/input/serio/i8042-x86ia64io.h
1931     @@ -166,6 +166,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
1932     },
1933     },
1934     {
1935     + /* Gigabyte Spring Peak - defines wrong chassis type */
1936     + .matches = {
1937     + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
1938     + DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
1939     + },
1940     + },
1941     + {
1942     .matches = {
1943     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1944     DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
1945     diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
1946     index 5fb1ad6..da90f45 100644
1947     --- a/drivers/md/raid10.c
1948     +++ b/drivers/md/raid10.c
1949     @@ -1486,14 +1486,14 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1950     int sectors = r10_bio->sectors;
1951     mdk_rdev_t*rdev;
1952     int max_read_errors = atomic_read(&mddev->max_corr_read_errors);
1953     + int d = r10_bio->devs[r10_bio->read_slot].devnum;
1954    
1955     rcu_read_lock();
1956     - {
1957     - int d = r10_bio->devs[r10_bio->read_slot].devnum;
1958     + rdev = rcu_dereference(conf->mirrors[d].rdev);
1959     + if (rdev) { /* If rdev is not NULL */
1960     char b[BDEVNAME_SIZE];
1961     int cur_read_error_count = 0;
1962    
1963     - rdev = rcu_dereference(conf->mirrors[d].rdev);
1964     bdevname(rdev->bdev, b);
1965    
1966     if (test_bit(Faulty, &rdev->flags)) {
1967     @@ -1533,7 +1533,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1968    
1969     rcu_read_lock();
1970     do {
1971     - int d = r10_bio->devs[sl].devnum;
1972     + d = r10_bio->devs[sl].devnum;
1973     rdev = rcu_dereference(conf->mirrors[d].rdev);
1974     if (rdev &&
1975     test_bit(In_sync, &rdev->flags)) {
1976     @@ -1567,7 +1567,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1977     rcu_read_lock();
1978     while (sl != r10_bio->read_slot) {
1979     char b[BDEVNAME_SIZE];
1980     - int d;
1981     +
1982     if (sl==0)
1983     sl = conf->copies;
1984     sl--;
1985     @@ -1603,7 +1603,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1986     }
1987     sl = start;
1988     while (sl != r10_bio->read_slot) {
1989     - int d;
1990     +
1991     if (sl==0)
1992     sl = conf->copies;
1993     sl--;
1994     diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
1995     index b11533f..00ddf92 100644
1996     --- a/drivers/media/dvb/dvb-core/dvb_net.c
1997     +++ b/drivers/media/dvb/dvb-core/dvb_net.c
1998     @@ -350,6 +350,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
1999     const u8 *ts, *ts_end, *from_where = NULL;
2000     u8 ts_remain = 0, how_much = 0, new_ts = 1;
2001     struct ethhdr *ethh = NULL;
2002     + bool error = false;
2003    
2004     #ifdef ULE_DEBUG
2005     /* The code inside ULE_DEBUG keeps a history of the last 100 TS cells processed. */
2006     @@ -459,10 +460,16 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
2007    
2008     /* Drop partly decoded SNDU, reset state, resync on PUSI. */
2009     if (priv->ule_skb) {
2010     - dev_kfree_skb( priv->ule_skb );
2011     + error = true;
2012     + dev_kfree_skb(priv->ule_skb);
2013     + }
2014     +
2015     + if (error || priv->ule_sndu_remain) {
2016     dev->stats.rx_errors++;
2017     dev->stats.rx_frame_errors++;
2018     + error = false;
2019     }
2020     +
2021     reset_ule(priv);
2022     priv->need_pusi = 1;
2023     continue;
2024     @@ -534,6 +541,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
2025     from_where += 2;
2026     }
2027    
2028     + priv->ule_sndu_remain = priv->ule_sndu_len + 2;
2029     /*
2030     * State of current TS:
2031     * ts_remain (remaining bytes in the current TS cell)
2032     @@ -543,6 +551,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
2033     */
2034     switch (ts_remain) {
2035     case 1:
2036     + priv->ule_sndu_remain--;
2037     priv->ule_sndu_type = from_where[0] << 8;
2038     priv->ule_sndu_type_1 = 1; /* first byte of ule_type is set. */
2039     ts_remain -= 1; from_where += 1;
2040     @@ -556,6 +565,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
2041     default: /* complete ULE header is present in current TS. */
2042     /* Extract ULE type field. */
2043     if (priv->ule_sndu_type_1) {
2044     + priv->ule_sndu_type_1 = 0;
2045     priv->ule_sndu_type |= from_where[0];
2046     from_where += 1; /* points to payload start. */
2047     ts_remain -= 1;
2048     diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
2049     index d8d4214..32a7ec6 100644
2050     --- a/drivers/media/dvb/ttpci/Kconfig
2051     +++ b/drivers/media/dvb/ttpci/Kconfig
2052     @@ -68,13 +68,14 @@ config DVB_BUDGET
2053     select DVB_VES1820 if !DVB_FE_CUSTOMISE
2054     select DVB_L64781 if !DVB_FE_CUSTOMISE
2055     select DVB_TDA8083 if !DVB_FE_CUSTOMISE
2056     - select DVB_TDA10021 if !DVB_FE_CUSTOMISE
2057     - select DVB_TDA10023 if !DVB_FE_CUSTOMISE
2058     select DVB_S5H1420 if !DVB_FE_CUSTOMISE
2059     select DVB_TDA10086 if !DVB_FE_CUSTOMISE
2060     select DVB_TDA826X if !DVB_FE_CUSTOMISE
2061     select DVB_LNBP21 if !DVB_FE_CUSTOMISE
2062     select DVB_TDA1004X if !DVB_FE_CUSTOMISE
2063     + select DVB_ISL6423 if !DVB_FE_CUSTOMISE
2064     + select DVB_STV090x if !DVB_FE_CUSTOMISE
2065     + select DVB_STV6110x if !DVB_FE_CUSTOMISE
2066     help
2067     Support for simple SAA7146 based DVB cards (so called Budget-
2068     or Nova-PCI cards) without onboard MPEG2 decoder, and without
2069     diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c
2070     index 4172cb3..d4746e0 100644
2071     --- a/drivers/media/video/cx23885/cx23885-i2c.c
2072     +++ b/drivers/media/video/cx23885/cx23885-i2c.c
2073     @@ -365,7 +365,17 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
2074    
2075     memset(&info, 0, sizeof(struct i2c_board_info));
2076     strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
2077     - i2c_new_probed_device(&bus->i2c_adap, &info, addr_list);
2078     + /*
2079     + * We can't call i2c_new_probed_device() because it uses
2080     + * quick writes for probing and the IR receiver device only
2081     + * replies to reads.
2082     + */
2083     + if (i2c_smbus_xfer(&bus->i2c_adap, addr_list[0], 0,
2084     + I2C_SMBUS_READ, 0, I2C_SMBUS_QUICK,
2085     + NULL) >= 0) {
2086     + info.addr = addr_list[0];
2087     + i2c_new_device(&bus->i2c_adap, &info);
2088     + }
2089     }
2090    
2091     return bus->i2c_rc;
2092     diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
2093     index ee1ca39..fb39f11 100644
2094     --- a/drivers/media/video/cx88/cx88-i2c.c
2095     +++ b/drivers/media/video/cx88/cx88-i2c.c
2096     @@ -188,10 +188,24 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
2097     0x18, 0x6b, 0x71,
2098     I2C_CLIENT_END
2099     };
2100     + const unsigned short *addrp;
2101    
2102     memset(&info, 0, sizeof(struct i2c_board_info));
2103     strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
2104     - i2c_new_probed_device(&core->i2c_adap, &info, addr_list);
2105     + /*
2106     + * We can't call i2c_new_probed_device() because it uses
2107     + * quick writes for probing and at least some R receiver
2108     + * devices only reply to reads.
2109     + */
2110     + for (addrp = addr_list; *addrp != I2C_CLIENT_END; addrp++) {
2111     + if (i2c_smbus_xfer(&core->i2c_adap, *addrp, 0,
2112     + I2C_SMBUS_READ, 0,
2113     + I2C_SMBUS_QUICK, NULL) >= 0) {
2114     + info.addr = *addrp;
2115     + i2c_new_device(&core->i2c_adap, &info);
2116     + break;
2117     + }
2118     + }
2119     }
2120     return core->i2c_rc;
2121     }
2122     diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
2123     index 391cccc..b42e845 100644
2124     --- a/drivers/media/video/uvc/uvc_driver.c
2125     +++ b/drivers/media/video/uvc/uvc_driver.c
2126     @@ -59,6 +59,11 @@ static struct uvc_format_desc uvc_fmts[] = {
2127     .fcc = V4L2_PIX_FMT_YUYV,
2128     },
2129     {
2130     + .name = "YUV 4:2:2 (YUYV)",
2131     + .guid = UVC_GUID_FORMAT_YUY2_ISIGHT,
2132     + .fcc = V4L2_PIX_FMT_YUYV,
2133     + },
2134     + {
2135     .name = "YUV 4:2:0 (NV12)",
2136     .guid = UVC_GUID_FORMAT_NV12,
2137     .fcc = V4L2_PIX_FMT_NV12,
2138     @@ -84,11 +89,16 @@ static struct uvc_format_desc uvc_fmts[] = {
2139     .fcc = V4L2_PIX_FMT_UYVY,
2140     },
2141     {
2142     - .name = "Greyscale",
2143     + .name = "Greyscale (8-bit)",
2144     .guid = UVC_GUID_FORMAT_Y800,
2145     .fcc = V4L2_PIX_FMT_GREY,
2146     },
2147     {
2148     + .name = "Greyscale (16-bit)",
2149     + .guid = UVC_GUID_FORMAT_Y16,
2150     + .fcc = V4L2_PIX_FMT_Y16,
2151     + },
2152     + {
2153     .name = "RGB Bayer",
2154     .guid = UVC_GUID_FORMAT_BY8,
2155     .fcc = V4L2_PIX_FMT_SBGGR8,
2156     @@ -2059,6 +2069,15 @@ static struct usb_device_id uvc_ids[] = {
2157     .bInterfaceSubClass = 1,
2158     .bInterfaceProtocol = 0,
2159     .driver_info = UVC_QUIRK_STREAM_NO_FID },
2160     + /* Syntek (Packard Bell EasyNote MX52 */
2161     + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2162     + | USB_DEVICE_ID_MATCH_INT_INFO,
2163     + .idVendor = 0x174f,
2164     + .idProduct = 0x8a12,
2165     + .bInterfaceClass = USB_CLASS_VIDEO,
2166     + .bInterfaceSubClass = 1,
2167     + .bInterfaceProtocol = 0,
2168     + .driver_info = UVC_QUIRK_STREAM_NO_FID },
2169     /* Syntek (Asus F9SG) */
2170     { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2171     | USB_DEVICE_ID_MATCH_INT_INFO,
2172     @@ -2123,6 +2142,15 @@ static struct usb_device_id uvc_ids[] = {
2173     .bInterfaceSubClass = 1,
2174     .bInterfaceProtocol = 0,
2175     .driver_info = UVC_QUIRK_PROBE_MINMAX },
2176     + /* Arkmicro unbranded */
2177     + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2178     + | USB_DEVICE_ID_MATCH_INT_INFO,
2179     + .idVendor = 0x18ec,
2180     + .idProduct = 0x3290,
2181     + .bInterfaceClass = USB_CLASS_VIDEO,
2182     + .bInterfaceSubClass = 1,
2183     + .bInterfaceProtocol = 0,
2184     + .driver_info = UVC_QUIRK_PROBE_DEF },
2185     /* Bodelin ProScopeHR */
2186     { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2187     | USB_DEVICE_ID_MATCH_DEV_HI
2188     diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
2189     index 2337585..b6f6f38 100644
2190     --- a/drivers/media/video/uvc/uvcvideo.h
2191     +++ b/drivers/media/video/uvc/uvcvideo.h
2192     @@ -113,6 +113,9 @@ struct uvc_xu_control {
2193     #define UVC_GUID_FORMAT_YUY2 \
2194     { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \
2195     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
2196     +#define UVC_GUID_FORMAT_YUY2_ISIGHT \
2197     + { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \
2198     + 0x80, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9b, 0x71}
2199     #define UVC_GUID_FORMAT_NV12 \
2200     { 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \
2201     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
2202     @@ -128,11 +131,13 @@ struct uvc_xu_control {
2203     #define UVC_GUID_FORMAT_Y800 \
2204     { 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \
2205     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
2206     +#define UVC_GUID_FORMAT_Y16 \
2207     + { 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \
2208     + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
2209     #define UVC_GUID_FORMAT_BY8 \
2210     { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \
2211     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
2212    
2213     -
2214     /* ------------------------------------------------------------------------
2215     * Driver specific constants.
2216     */
2217     diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
2218     index 50997d2..676cd0c 100644
2219     --- a/drivers/mmc/host/sdhci-s3c.c
2220     +++ b/drivers/mmc/host/sdhci-s3c.c
2221     @@ -372,6 +372,26 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
2222    
2223     static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
2224     {
2225     + struct sdhci_host *host = platform_get_drvdata(pdev);
2226     + struct sdhci_s3c *sc = sdhci_priv(host);
2227     + int ptr;
2228     +
2229     + sdhci_remove_host(host, 1);
2230     +
2231     + for (ptr = 0; ptr < 3; ptr++) {
2232     + clk_disable(sc->clk_bus[ptr]);
2233     + clk_put(sc->clk_bus[ptr]);
2234     + }
2235     + clk_disable(sc->clk_io);
2236     + clk_put(sc->clk_io);
2237     +
2238     + iounmap(host->ioaddr);
2239     + release_resource(sc->ioarea);
2240     + kfree(sc->ioarea);
2241     +
2242     + sdhci_free_host(host);
2243     + platform_set_drvdata(pdev, NULL);
2244     +
2245     return 0;
2246     }
2247    
2248     diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
2249     index 66e0323..b74a0ea 100644
2250     --- a/drivers/net/3c503.c
2251     +++ b/drivers/net/3c503.c
2252     @@ -380,6 +380,12 @@ out:
2253     return retval;
2254     }
2255    
2256     +static irqreturn_t el2_probe_interrupt(int irq, void *seen)
2257     +{
2258     + *(bool *)seen = true;
2259     + return IRQ_HANDLED;
2260     +}
2261     +
2262     static int
2263     el2_open(struct net_device *dev)
2264     {
2265     @@ -391,23 +397,35 @@ el2_open(struct net_device *dev)
2266    
2267     outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */
2268     do {
2269     - retval = request_irq(*irqp, NULL, 0, "bogus", dev);
2270     - if (retval >= 0) {
2271     + bool seen;
2272     +
2273     + retval = request_irq(*irqp, el2_probe_interrupt, 0,
2274     + dev->name, &seen);
2275     + if (retval == -EBUSY)
2276     + continue;
2277     + if (retval < 0)
2278     + goto err_disable;
2279     +
2280     /* Twinkle the interrupt, and check if it's seen. */
2281     - unsigned long cookie = probe_irq_on();
2282     + seen = false;
2283     + smp_wmb();
2284     outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
2285     outb_p(0x00, E33G_IDCFR);
2286     - if (*irqp == probe_irq_off(cookie) && /* It's a good IRQ line! */
2287     - ((retval = request_irq(dev->irq = *irqp,
2288     - eip_interrupt, 0,
2289     - dev->name, dev)) == 0))
2290     - break;
2291     - } else {
2292     - if (retval != -EBUSY)
2293     - return retval;
2294     - }
2295     + msleep(1);
2296     + free_irq(*irqp, el2_probe_interrupt);
2297     + if (!seen)
2298     + continue;
2299     +
2300     + retval = request_irq(dev->irq = *irqp, eip_interrupt, 0,
2301     + dev->name, dev);
2302     + if (retval == -EBUSY)
2303     + continue;
2304     + if (retval < 0)
2305     + goto err_disable;
2306     } while (*++irqp);
2307     +
2308     if (*irqp == 0) {
2309     + err_disable:
2310     outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */
2311     return -EAGAIN;
2312     }
2313     diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
2314     index 8d0be26..6e739bb 100644
2315     --- a/drivers/net/cpmac.c
2316     +++ b/drivers/net/cpmac.c
2317     @@ -1174,7 +1174,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
2318     if (netif_msg_drv(priv))
2319     printk(KERN_ERR "%s: Could not attach to PHY\n",
2320     dev->name);
2321     - return PTR_ERR(priv->phy);
2322     + rc = PTR_ERR(priv->phy);
2323     + goto fail;
2324     }
2325    
2326     if ((rc = register_netdev(dev))) {
2327     diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
2328     index 5248f9e..35cd367 100644
2329     --- a/drivers/net/cxgb3/ael1002.c
2330     +++ b/drivers/net/cxgb3/ael1002.c
2331     @@ -934,7 +934,7 @@ static struct cphy_ops xaui_direct_ops = {
2332     int t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
2333     int phy_addr, const struct mdio_ops *mdio_ops)
2334     {
2335     - cphy_init(phy, adapter, MDIO_PRTAD_NONE, &xaui_direct_ops, mdio_ops,
2336     + cphy_init(phy, adapter, phy_addr, &xaui_direct_ops, mdio_ops,
2337     SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_TP,
2338     "10GBASE-CX4");
2339     return 0;
2340     diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
2341     index b377300..55cab1d 100644
2342     --- a/drivers/net/dm9000.c
2343     +++ b/drivers/net/dm9000.c
2344     @@ -475,17 +475,13 @@ static uint32_t dm9000_get_rx_csum(struct net_device *dev)
2345     return dm->rx_csum;
2346     }
2347    
2348     -static int dm9000_set_rx_csum(struct net_device *dev, uint32_t data)
2349     +static int dm9000_set_rx_csum_unlocked(struct net_device *dev, uint32_t data)
2350     {
2351     board_info_t *dm = to_dm9000_board(dev);
2352     - unsigned long flags;
2353    
2354     if (dm->can_csum) {
2355     dm->rx_csum = data;
2356     -
2357     - spin_lock_irqsave(&dm->lock, flags);
2358     iow(dm, DM9000_RCSR, dm->rx_csum ? RCSR_CSUM : 0);
2359     - spin_unlock_irqrestore(&dm->lock, flags);
2360    
2361     return 0;
2362     }
2363     @@ -493,6 +489,19 @@ static int dm9000_set_rx_csum(struct net_device *dev, uint32_t data)
2364     return -EOPNOTSUPP;
2365     }
2366    
2367     +static int dm9000_set_rx_csum(struct net_device *dev, uint32_t data)
2368     +{
2369     + board_info_t *dm = to_dm9000_board(dev);
2370     + unsigned long flags;
2371     + int ret;
2372     +
2373     + spin_lock_irqsave(&dm->lock, flags);
2374     + ret = dm9000_set_rx_csum_unlocked(dev, data);
2375     + spin_unlock_irqrestore(&dm->lock, flags);
2376     +
2377     + return ret;
2378     +}
2379     +
2380     static int dm9000_set_tx_csum(struct net_device *dev, uint32_t data)
2381     {
2382     board_info_t *dm = to_dm9000_board(dev);
2383     @@ -721,7 +730,7 @@ static unsigned char dm9000_type_to_char(enum dm9000_type type)
2384     * Set DM9000 multicast address
2385     */
2386     static void
2387     -dm9000_hash_table(struct net_device *dev)
2388     +dm9000_hash_table_unlocked(struct net_device *dev)
2389     {
2390     board_info_t *db = netdev_priv(dev);
2391     struct dev_mc_list *mcptr = dev->mc_list;
2392     @@ -730,12 +739,9 @@ dm9000_hash_table(struct net_device *dev)
2393     u32 hash_val;
2394     u16 hash_table[4];
2395     u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
2396     - unsigned long flags;
2397    
2398     dm9000_dbg(db, 1, "entering %s\n", __func__);
2399    
2400     - spin_lock_irqsave(&db->lock, flags);
2401     -
2402     for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
2403     iow(db, oft, dev->dev_addr[i]);
2404    
2405     @@ -765,6 +771,16 @@ dm9000_hash_table(struct net_device *dev)
2406     }
2407    
2408     iow(db, DM9000_RCR, rcr);
2409     +}
2410     +
2411     +static void
2412     +dm9000_hash_table(struct net_device *dev)
2413     +{
2414     + board_info_t *db = netdev_priv(dev);
2415     + unsigned long flags;
2416     +
2417     + spin_lock_irqsave(&db->lock, flags);
2418     + dm9000_hash_table_unlocked(dev);
2419     spin_unlock_irqrestore(&db->lock, flags);
2420     }
2421    
2422     @@ -784,7 +800,7 @@ dm9000_init_dm9000(struct net_device *dev)
2423     db->io_mode = ior(db, DM9000_ISR) >> 6; /* ISR bit7:6 keeps I/O mode */
2424    
2425     /* Checksum mode */
2426     - dm9000_set_rx_csum(dev, db->rx_csum);
2427     + dm9000_set_rx_csum_unlocked(dev, db->rx_csum);
2428    
2429     /* GPIO0 on pre-activate PHY */
2430     iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
2431     @@ -811,7 +827,7 @@ dm9000_init_dm9000(struct net_device *dev)
2432     iow(db, DM9000_ISR, ISR_CLR_STATUS); /* Clear interrupt status */
2433    
2434     /* Set address filter table */
2435     - dm9000_hash_table(dev);
2436     + dm9000_hash_table_unlocked(dev);
2437    
2438     imr = IMR_PAR | IMR_PTM | IMR_PRM;
2439     if (db->type != TYPE_DM9000E)
2440     diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
2441     index 3c34048..a7b5a82 100644
2442     --- a/drivers/net/forcedeth.c
2443     +++ b/drivers/net/forcedeth.c
2444     @@ -5900,7 +5900,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2445     /* Limit the number of tx's outstanding for hw bug */
2446     if (id->driver_data & DEV_NEED_TX_LIMIT) {
2447     np->tx_limit = 1;
2448     - if ((id->driver_data & DEV_NEED_TX_LIMIT2) &&
2449     + if (((id->driver_data & DEV_NEED_TX_LIMIT2) == DEV_NEED_TX_LIMIT2) &&
2450     pci_dev->revision >= 0xA2)
2451     np->tx_limit = 0;
2452     }
2453     diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
2454     index 787befc..69f84c8 100644
2455     --- a/drivers/net/r8169.c
2456     +++ b/drivers/net/r8169.c
2457     @@ -557,6 +557,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
2458     break;
2459     udelay(25);
2460     }
2461     + /*
2462     + * According to hardware specs a 20us delay is required after write
2463     + * complete indication, but before sending next command.
2464     + */
2465     + udelay(20);
2466     }
2467    
2468     static int mdio_read(void __iomem *ioaddr, int reg_addr)
2469     @@ -576,6 +581,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
2470     }
2471     udelay(25);
2472     }
2473     + /*
2474     + * According to hardware specs a 20us delay is required after read
2475     + * complete indication, but before sending next command.
2476     + */
2477     + udelay(20);
2478     +
2479     return value;
2480     }
2481    
2482     diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
2483     index 67249c3..5520f16 100644
2484     --- a/drivers/net/sky2.c
2485     +++ b/drivers/net/sky2.c
2486     @@ -716,11 +716,24 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
2487     sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
2488     }
2489    
2490     +/* Enable Rx/Tx */
2491     +static void sky2_enable_rx_tx(struct sky2_port *sky2)
2492     +{
2493     + struct sky2_hw *hw = sky2->hw;
2494     + unsigned port = sky2->port;
2495     + u16 reg;
2496     +
2497     + reg = gma_read16(hw, port, GM_GP_CTRL);
2498     + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA;
2499     + gma_write16(hw, port, GM_GP_CTRL, reg);
2500     +}
2501     +
2502     /* Force a renegotiation */
2503     static void sky2_phy_reinit(struct sky2_port *sky2)
2504     {
2505     spin_lock_bh(&sky2->phy_lock);
2506     sky2_phy_init(sky2->hw, sky2->port);
2507     + sky2_enable_rx_tx(sky2);
2508     spin_unlock_bh(&sky2->phy_lock);
2509     }
2510    
2511     @@ -1971,7 +1984,6 @@ static void sky2_link_up(struct sky2_port *sky2)
2512     {
2513     struct sky2_hw *hw = sky2->hw;
2514     unsigned port = sky2->port;
2515     - u16 reg;
2516     static const char *fc_name[] = {
2517     [FC_NONE] = "none",
2518     [FC_TX] = "tx",
2519     @@ -1979,10 +1991,7 @@ static void sky2_link_up(struct sky2_port *sky2)
2520     [FC_BOTH] = "both",
2521     };
2522    
2523     - /* enable Rx/Tx */
2524     - reg = gma_read16(hw, port, GM_GP_CTRL);
2525     - reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA;
2526     - gma_write16(hw, port, GM_GP_CTRL, reg);
2527     + sky2_enable_rx_tx(sky2);
2528    
2529     gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK);
2530    
2531     diff --git a/drivers/net/usb/pegasus.h b/drivers/net/usb/pegasus.h
2532     index 5d02f02..7d07037 100644
2533     --- a/drivers/net/usb/pegasus.h
2534     +++ b/drivers/net/usb/pegasus.h
2535     @@ -254,7 +254,7 @@ PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR_IODATA, 0x0904,
2536     DEFAULT_GPIO_RESET )
2537     PEGASUS_DEV( "IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913,
2538     DEFAULT_GPIO_RESET | PEGASUS_II )
2539     -PEGASUS_DEV( "IO DATA USB ETX-US2", VENDOR_IODATA, 0x092a,
2540     +PEGASUS_DEV( "IO DATA USB ETX-US2", VENDOR_IODATA, 0x093a,
2541     DEFAULT_GPIO_RESET | PEGASUS_II )
2542     PEGASUS_DEV( "Kingston KNU101TX Ethernet", VENDOR_KINGSTON, 0x000a,
2543     DEFAULT_GPIO_RESET)
2544     diff --git a/drivers/net/veth.c b/drivers/net/veth.c
2545     index 3a15de5..baf0b51 100644
2546     --- a/drivers/net/veth.c
2547     +++ b/drivers/net/veth.c
2548     @@ -186,7 +186,6 @@ tx_drop:
2549     return NETDEV_TX_OK;
2550    
2551     rx_drop:
2552     - kfree_skb(skb);
2553     rcv_stats->rx_dropped++;
2554     return NETDEV_TX_OK;
2555     }
2556     diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
2557     index 4228444..6b00074 100644
2558     --- a/drivers/net/wireless/ath/ath5k/attach.c
2559     +++ b/drivers/net/wireless/ath/ath5k/attach.c
2560     @@ -123,6 +123,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
2561     ah->ah_cw_min = AR5K_TUNE_CWMIN;
2562     ah->ah_limit_tx_retries = AR5K_INIT_TX_RETRY;
2563     ah->ah_software_retry = false;
2564     + ah->ah_current_channel = &sc->channels[0];
2565    
2566     /*
2567     * Find the mac version
2568     diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
2569     index d377809..e6e9587 100644
2570     --- a/drivers/net/wireless/ath/ath5k/base.c
2571     +++ b/drivers/net/wireless/ath/ath5k/base.c
2572     @@ -1851,11 +1851,6 @@ ath5k_tasklet_rx(unsigned long data)
2573     return;
2574     }
2575    
2576     - if (unlikely(rs.rs_more)) {
2577     - ATH5K_WARN(sc, "unsupported jumbo\n");
2578     - goto next;
2579     - }
2580     -
2581     if (unlikely(rs.rs_status)) {
2582     if (rs.rs_status & AR5K_RXERR_PHY)
2583     goto next;
2584     @@ -1885,6 +1880,8 @@ ath5k_tasklet_rx(unsigned long data)
2585     sc->opmode != NL80211_IFTYPE_MONITOR)
2586     goto next;
2587     }
2588     + if (unlikely(rs.rs_more))
2589     + goto next;
2590     accept:
2591     next_skb = ath5k_rx_skb_alloc(sc, &next_skb_addr);
2592    
2593     diff --git a/drivers/net/wireless/ath/ath9k/initvals.h b/drivers/net/wireless/ath/ath9k/initvals.h
2594     index 8a3bf3a..7203f00 100644
2595     --- a/drivers/net/wireless/ath/ath9k/initvals.h
2596     +++ b/drivers/net/wireless/ath/ath9k/initvals.h
2597     @@ -246,7 +246,7 @@ static const u32 ar5416Common[][2] = {
2598     { 0x00008258, 0x00000000 },
2599     { 0x0000825c, 0x400000ff },
2600     { 0x00008260, 0x00080922 },
2601     - { 0x00008264, 0xa8000010 },
2602     + { 0x00008264, 0x88000010 },
2603     { 0x00008270, 0x00000000 },
2604     { 0x00008274, 0x40000000 },
2605     { 0x00008278, 0x003e4180 },
2606     @@ -2766,7 +2766,7 @@ static const u32 ar9280Common_9280_2[][2] = {
2607     { 0x00008258, 0x00000000 },
2608     { 0x0000825c, 0x400000ff },
2609     { 0x00008260, 0x00080922 },
2610     - { 0x00008264, 0xa8a00010 },
2611     + { 0x00008264, 0x88a00010 },
2612     { 0x00008270, 0x00000000 },
2613     { 0x00008274, 0x40000000 },
2614     { 0x00008278, 0x003e4180 },
2615     @@ -3936,7 +3936,7 @@ static const u_int32_t ar9285Common_9285[][2] = {
2616     { 0x00008258, 0x00000000 },
2617     { 0x0000825c, 0x400000ff },
2618     { 0x00008260, 0x00080922 },
2619     - { 0x00008264, 0xa8a00010 },
2620     + { 0x00008264, 0x88a00010 },
2621     { 0x00008270, 0x00000000 },
2622     { 0x00008274, 0x40000000 },
2623     { 0x00008278, 0x003e4180 },
2624     @@ -5073,7 +5073,7 @@ static const u_int32_t ar9287Common_9287_1_0[][2] = {
2625     { 0x00008258, 0x00000000 },
2626     { 0x0000825c, 0x400000ff },
2627     { 0x00008260, 0x00080922 },
2628     - { 0x00008264, 0xa8a00010 },
2629     + { 0x00008264, 0x88a00010 },
2630     { 0x00008270, 0x00000000 },
2631     { 0x00008274, 0x40000000 },
2632     { 0x00008278, 0x003e4180 },
2633     diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
2634     index c9640a3..b2db902 100644
2635     --- a/drivers/net/wireless/hostap/hostap_cs.c
2636     +++ b/drivers/net/wireless/hostap/hostap_cs.c
2637     @@ -602,6 +602,7 @@ static int prism2_config(struct pcmcia_device *link)
2638     local_info_t *local;
2639     int ret = 1;
2640     struct hostap_cs_priv *hw_priv;
2641     + unsigned long flags;
2642    
2643     PDEBUG(DEBUG_FLOW, "prism2_config()\n");
2644    
2645     @@ -636,6 +637,12 @@ static int prism2_config(struct pcmcia_device *link)
2646     link->dev_node = &hw_priv->node;
2647    
2648     /*
2649     + * Make sure the IRQ handler cannot proceed until at least
2650     + * dev->base_addr is initialized.
2651     + */
2652     + spin_lock_irqsave(&local->irq_init_lock, flags);
2653     +
2654     + /*
2655     * Allocate an interrupt line. Note that this does not assign a
2656     * handler to the interrupt, unless the 'Handler' member of the
2657     * irq structure is initialized.
2658     @@ -645,7 +652,7 @@ static int prism2_config(struct pcmcia_device *link)
2659     link->irq.Handler = prism2_interrupt;
2660     ret = pcmcia_request_irq(link, &link->irq);
2661     if (ret)
2662     - goto failed;
2663     + goto failed_unlock;
2664     }
2665    
2666     /*
2667     @@ -655,11 +662,13 @@ static int prism2_config(struct pcmcia_device *link)
2668     */
2669     ret = pcmcia_request_configuration(link, &link->conf);
2670     if (ret)
2671     - goto failed;
2672     + goto failed_unlock;
2673    
2674     dev->irq = link->irq.AssignedIRQ;
2675     dev->base_addr = link->io.BasePort1;
2676    
2677     + spin_unlock_irqrestore(&local->irq_init_lock, flags);
2678     +
2679     /* Finally, report what we've done */
2680     printk(KERN_INFO "%s: index 0x%02x: ",
2681     dev_info, link->conf.ConfigIndex);
2682     @@ -688,6 +697,8 @@ static int prism2_config(struct pcmcia_device *link)
2683     }
2684     return ret;
2685    
2686     + failed_unlock:
2687     + spin_unlock_irqrestore(&local->irq_init_lock, flags);
2688     failed:
2689     kfree(hw_priv);
2690     prism2_release((u_long)link);
2691     diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
2692     index ff9b5c8..2f999fc 100644
2693     --- a/drivers/net/wireless/hostap/hostap_hw.c
2694     +++ b/drivers/net/wireless/hostap/hostap_hw.c
2695     @@ -2621,6 +2621,18 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
2696     iface = netdev_priv(dev);
2697     local = iface->local;
2698    
2699     + /* Detect early interrupt before driver is fully configued */
2700     + spin_lock(&local->irq_init_lock);
2701     + if (!dev->base_addr) {
2702     + if (net_ratelimit()) {
2703     + printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n",
2704     + dev->name);
2705     + }
2706     + spin_unlock(&local->irq_init_lock);
2707     + return IRQ_HANDLED;
2708     + }
2709     + spin_unlock(&local->irq_init_lock);
2710     +
2711     prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INTERRUPT, 0, 0);
2712    
2713     if (local->func->card_present && !local->func->card_present(local)) {
2714     @@ -3138,6 +3150,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
2715     spin_lock_init(&local->cmdlock);
2716     spin_lock_init(&local->baplock);
2717     spin_lock_init(&local->lock);
2718     + spin_lock_init(&local->irq_init_lock);
2719     mutex_init(&local->rid_bap_mtx);
2720    
2721     if (card_idx < 0 || card_idx >= MAX_PARM_DEVICES)
2722     diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
2723     index 3d23891..1ba33be 100644
2724     --- a/drivers/net/wireless/hostap/hostap_wlan.h
2725     +++ b/drivers/net/wireless/hostap/hostap_wlan.h
2726     @@ -654,7 +654,7 @@ struct local_info {
2727     rwlock_t iface_lock; /* hostap_interfaces read lock; use write lock
2728     * when removing entries from the list.
2729     * TX and RX paths can use read lock. */
2730     - spinlock_t cmdlock, baplock, lock;
2731     + spinlock_t cmdlock, baplock, lock, irq_init_lock;
2732     struct mutex rid_bap_mtx;
2733     u16 infofid; /* MAC buffer id for info frame */
2734     /* txfid, intransmitfid, next_txtid, and next_alloc are protected by
2735     diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
2736     index 8f1b850..8bc2105 100644
2737     --- a/drivers/net/wireless/iwlwifi/iwl-scan.c
2738     +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
2739     @@ -812,6 +812,7 @@ void iwl_bg_abort_scan(struct work_struct *work)
2740    
2741     mutex_lock(&priv->mutex);
2742    
2743     + cancel_delayed_work_sync(&priv->scan_check);
2744     set_bit(STATUS_SCAN_ABORTING, &priv->status);
2745     iwl_send_scan_abort(priv);
2746    
2747     diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
2748     index e0ce039..2f53121 100644
2749     --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
2750     +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
2751     @@ -1553,6 +1553,11 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
2752     sta_id = ba_resp->sta_id;
2753     tid = ba_resp->tid;
2754     agg = &priv->stations[sta_id].tid[tid].agg;
2755     + if (unlikely(agg->txq_id != scd_flow)) {
2756     + IWL_ERR(priv, "BA scd_flow %d does not match txq_id %d\n",
2757     + scd_flow, agg->txq_id);
2758     + return;
2759     + }
2760    
2761     /* Find index just before block-ack window */
2762     index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);
2763     diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
2764     index 7a73f62..33206a9 100644
2765     --- a/drivers/net/wireless/libertas/if_sdio.c
2766     +++ b/drivers/net/wireless/libertas/if_sdio.c
2767     @@ -34,6 +34,8 @@
2768     #include <linux/mmc/card.h>
2769     #include <linux/mmc/sdio_func.h>
2770     #include <linux/mmc/sdio_ids.h>
2771     +#include <linux/mmc/sdio.h>
2772     +#include <linux/mmc/host.h>
2773    
2774     #include "host.h"
2775     #include "decl.h"
2776     @@ -942,6 +944,7 @@ static int if_sdio_probe(struct sdio_func *func,
2777     int ret, i;
2778     unsigned int model;
2779     struct if_sdio_packet *packet;
2780     + struct mmc_host *host = func->card->host;
2781    
2782     lbs_deb_enter(LBS_DEB_SDIO);
2783    
2784     @@ -1022,6 +1025,25 @@ static int if_sdio_probe(struct sdio_func *func,
2785     if (ret)
2786     goto disable;
2787    
2788     + /* For 1-bit transfers to the 8686 model, we need to enable the
2789     + * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0
2790     + * bit to allow access to non-vendor registers. */
2791     + if ((card->model == IF_SDIO_MODEL_8686) &&
2792     + (host->caps & MMC_CAP_SDIO_IRQ) &&
2793     + (host->ios.bus_width == MMC_BUS_WIDTH_1)) {
2794     + u8 reg;
2795     +
2796     + func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
2797     + reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret);
2798     + if (ret)
2799     + goto release_int;
2800     +
2801     + reg |= SDIO_BUS_ECSI;
2802     + sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret);
2803     + if (ret)
2804     + goto release_int;
2805     + }
2806     +
2807     card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
2808     if (ret)
2809     goto release_int;
2810     diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
2811     index 41d33cd..7ff033e 100644
2812     --- a/drivers/net/wireless/p54/p54pci.c
2813     +++ b/drivers/net/wireless/p54/p54pci.c
2814     @@ -40,6 +40,8 @@ static struct pci_device_id p54p_table[] __devinitdata = {
2815     { PCI_DEVICE(0x1260, 0x3877) },
2816     /* Intersil PRISM Javelin/Xbow Wireless LAN adapter */
2817     { PCI_DEVICE(0x1260, 0x3886) },
2818     + /* Intersil PRISM Xbow Wireless LAN adapter (Symbol AP-300) */
2819     + { PCI_DEVICE(0x1260, 0xffff) },
2820     { },
2821     };
2822    
2823     diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
2824     index c4ec5c1..a01bbe2 100644
2825     --- a/drivers/rtc/rtc-ds1307.c
2826     +++ b/drivers/rtc/rtc-ds1307.c
2827     @@ -775,7 +775,7 @@ static int __devinit ds1307_probe(struct i2c_client *client,
2828    
2829     read_rtc:
2830     /* read RTC registers */
2831     - tmp = ds1307->read_block_data(ds1307->client, 0, 8, buf);
2832     + tmp = ds1307->read_block_data(ds1307->client, ds1307->offset, 8, buf);
2833     if (tmp != 8) {
2834     pr_debug("read error %d\n", tmp);
2835     err = -EIO;
2836     @@ -860,7 +860,7 @@ read_rtc:
2837     if (ds1307->regs[DS1307_REG_HOUR] & DS1307_BIT_PM)
2838     tmp += 12;
2839     i2c_smbus_write_byte_data(client,
2840     - DS1307_REG_HOUR,
2841     + ds1307->offset + DS1307_REG_HOUR,
2842     bin2bcd(tmp));
2843     }
2844    
2845     diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
2846     index 9c0c911..1a5bf57 100644
2847     --- a/drivers/scsi/aacraid/commctrl.c
2848     +++ b/drivers/scsi/aacraid/commctrl.c
2849     @@ -655,9 +655,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
2850     /* Does this really need to be GFP_DMA? */
2851     p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA);
2852     if(!p) {
2853     - kfree (usg);
2854     - dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
2855     + dprintk((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
2856     usg->sg[i].count,i,usg->count));
2857     + kfree(usg);
2858     rcode = -ENOMEM;
2859     goto cleanup;
2860     }
2861     diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
2862     index 300cea7..7feb902 100644
2863     --- a/drivers/serial/cpm_uart/cpm_uart_core.c
2864     +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
2865     @@ -930,6 +930,83 @@ static void cpm_uart_config_port(struct uart_port *port, int flags)
2866     }
2867     }
2868    
2869     +#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_CPM_CONSOLE)
2870     +/*
2871     + * Write a string to the serial port
2872     + * Note that this is called with interrupts already disabled
2873     + */
2874     +static void cpm_uart_early_write(struct uart_cpm_port *pinfo,
2875     + const char *string, u_int count)
2876     +{
2877     + unsigned int i;
2878     + cbd_t __iomem *bdp, *bdbase;
2879     + unsigned char *cpm_outp_addr;
2880     +
2881     + /* Get the address of the host memory buffer.
2882     + */
2883     + bdp = pinfo->tx_cur;
2884     + bdbase = pinfo->tx_bd_base;
2885     +
2886     + /*
2887     + * Now, do each character. This is not as bad as it looks
2888     + * since this is a holding FIFO and not a transmitting FIFO.
2889     + * We could add the complexity of filling the entire transmit
2890     + * buffer, but we would just wait longer between accesses......
2891     + */
2892     + for (i = 0; i < count; i++, string++) {
2893     + /* Wait for transmitter fifo to empty.
2894     + * Ready indicates output is ready, and xmt is doing
2895     + * that, not that it is ready for us to send.
2896     + */
2897     + while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
2898     + ;
2899     +
2900     + /* Send the character out.
2901     + * If the buffer address is in the CPM DPRAM, don't
2902     + * convert it.
2903     + */
2904     + cpm_outp_addr = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr),
2905     + pinfo);
2906     + *cpm_outp_addr = *string;
2907     +
2908     + out_be16(&bdp->cbd_datlen, 1);
2909     + setbits16(&bdp->cbd_sc, BD_SC_READY);
2910     +
2911     + if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
2912     + bdp = bdbase;
2913     + else
2914     + bdp++;
2915     +
2916     + /* if a LF, also do CR... */
2917     + if (*string == 10) {
2918     + while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
2919     + ;
2920     +
2921     + cpm_outp_addr = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr),
2922     + pinfo);
2923     + *cpm_outp_addr = 13;
2924     +
2925     + out_be16(&bdp->cbd_datlen, 1);
2926     + setbits16(&bdp->cbd_sc, BD_SC_READY);
2927     +
2928     + if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
2929     + bdp = bdbase;
2930     + else
2931     + bdp++;
2932     + }
2933     + }
2934     +
2935     + /*
2936     + * Finally, Wait for transmitter & holding register to empty
2937     + * and restore the IER
2938     + */
2939     + while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
2940     + ;
2941     +
2942     + pinfo->tx_cur = bdp;
2943     +}
2944     +#endif
2945     +
2946     #ifdef CONFIG_CONSOLE_POLL
2947     /* Serial polling routines for writing and reading from the uart while
2948     * in an interrupt or debug context.
2949     @@ -999,7 +1076,7 @@ static void cpm_put_poll_char(struct uart_port *port,
2950     static char ch[2];
2951    
2952     ch[0] = (char)c;
2953     - cpm_uart_early_write(pinfo->port.line, ch, 1);
2954     + cpm_uart_early_write(pinfo, ch, 1);
2955     }
2956     #endif /* CONFIG_CONSOLE_POLL */
2957    
2958     @@ -1130,9 +1207,6 @@ static void cpm_uart_console_write(struct console *co, const char *s,
2959     u_int count)
2960     {
2961     struct uart_cpm_port *pinfo = &cpm_uart_ports[co->index];
2962     - unsigned int i;
2963     - cbd_t __iomem *bdp, *bdbase;
2964     - unsigned char *cp;
2965     unsigned long flags;
2966     int nolock = oops_in_progress;
2967    
2968     @@ -1142,66 +1216,7 @@ static void cpm_uart_console_write(struct console *co, const char *s,
2969     spin_lock_irqsave(&pinfo->port.lock, flags);
2970     }
2971    
2972     - /* Get the address of the host memory buffer.
2973     - */
2974     - bdp = pinfo->tx_cur;
2975     - bdbase = pinfo->tx_bd_base;
2976     -
2977     - /*
2978     - * Now, do each character. This is not as bad as it looks
2979     - * since this is a holding FIFO and not a transmitting FIFO.
2980     - * We could add the complexity of filling the entire transmit
2981     - * buffer, but we would just wait longer between accesses......
2982     - */
2983     - for (i = 0; i < count; i++, s++) {
2984     - /* Wait for transmitter fifo to empty.
2985     - * Ready indicates output is ready, and xmt is doing
2986     - * that, not that it is ready for us to send.
2987     - */
2988     - while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
2989     - ;
2990     -
2991     - /* Send the character out.
2992     - * If the buffer address is in the CPM DPRAM, don't
2993     - * convert it.
2994     - */
2995     - cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
2996     - *cp = *s;
2997     -
2998     - out_be16(&bdp->cbd_datlen, 1);
2999     - setbits16(&bdp->cbd_sc, BD_SC_READY);
3000     -
3001     - if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
3002     - bdp = bdbase;
3003     - else
3004     - bdp++;
3005     -
3006     - /* if a LF, also do CR... */
3007     - if (*s == 10) {
3008     - while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
3009     - ;
3010     -
3011     - cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
3012     - *cp = 13;
3013     -
3014     - out_be16(&bdp->cbd_datlen, 1);
3015     - setbits16(&bdp->cbd_sc, BD_SC_READY);
3016     -
3017     - if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
3018     - bdp = bdbase;
3019     - else
3020     - bdp++;
3021     - }
3022     - }
3023     -
3024     - /*
3025     - * Finally, Wait for transmitter & holding register to empty
3026     - * and restore the IER
3027     - */
3028     - while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
3029     - ;
3030     -
3031     - pinfo->tx_cur = bdp;
3032     + cpm_uart_early_write(pinfo, s, count);
3033    
3034     if (unlikely(nolock)) {
3035     local_irq_restore(flags);
3036     diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c
3037     index 1fb2a6e..3fc4103 100644
3038     --- a/drivers/spi/spi_mpc8xxx.c
3039     +++ b/drivers/spi/spi_mpc8xxx.c
3040     @@ -65,28 +65,6 @@ struct mpc8xxx_spi_reg {
3041     __be32 receive;
3042     };
3043    
3044     -/* SPI Parameter RAM */
3045     -struct spi_pram {
3046     - __be16 rbase; /* Rx Buffer descriptor base address */
3047     - __be16 tbase; /* Tx Buffer descriptor base address */
3048     - u8 rfcr; /* Rx function code */
3049     - u8 tfcr; /* Tx function code */
3050     - __be16 mrblr; /* Max receive buffer length */
3051     - __be32 rstate; /* Internal */
3052     - __be32 rdp; /* Internal */
3053     - __be16 rbptr; /* Internal */
3054     - __be16 rbc; /* Internal */
3055     - __be32 rxtmp; /* Internal */
3056     - __be32 tstate; /* Internal */
3057     - __be32 tdp; /* Internal */
3058     - __be16 tbptr; /* Internal */
3059     - __be16 tbc; /* Internal */
3060     - __be32 txtmp; /* Internal */
3061     - __be32 res; /* Tx temp. */
3062     - __be16 rpbase; /* Relocation pointer (CPM1 only) */
3063     - __be16 res1; /* Reserved */
3064     -};
3065     -
3066     /* SPI Controller mode register definitions */
3067     #define SPMODE_LOOP (1 << 30)
3068     #define SPMODE_CI_INACTIVEHIGH (1 << 29)
3069     diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c
3070     index 9681536..bbf1cb2 100644
3071     --- a/drivers/ssb/driver_chipcommon.c
3072     +++ b/drivers/ssb/driver_chipcommon.c
3073     @@ -233,6 +233,9 @@ void ssb_chipcommon_init(struct ssb_chipcommon *cc)
3074     {
3075     if (!cc->dev)
3076     return; /* We don't have a ChipCommon */
3077     + if (cc->dev->id.revision >= 11)
3078     + cc->status = chipco_read32(cc, SSB_CHIPCO_CHIPSTAT);
3079     + ssb_dprintk(KERN_INFO PFX "chipcommon status is 0x%x\n", cc->status);
3080     ssb_pmu_init(cc);
3081     chipco_powercontrol_init(cc);
3082     ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
3083     diff --git a/drivers/ssb/driver_chipcommon_pmu.c b/drivers/ssb/driver_chipcommon_pmu.c
3084     index 64abd11..8e194d5 100644
3085     --- a/drivers/ssb/driver_chipcommon_pmu.c
3086     +++ b/drivers/ssb/driver_chipcommon_pmu.c
3087     @@ -495,9 +495,9 @@ static void ssb_pmu_resources_init(struct ssb_chipcommon *cc)
3088     chipco_write32(cc, SSB_CHIPCO_PMU_MAXRES_MSK, max_msk);
3089     }
3090    
3091     +/* http://bcm-v4.sipsolutions.net/802.11/SSB/PmuInit */
3092     void ssb_pmu_init(struct ssb_chipcommon *cc)
3093     {
3094     - struct ssb_bus *bus = cc->dev->bus;
3095     u32 pmucap;
3096    
3097     if (!(cc->capabilities & SSB_CHIPCO_CAP_PMU))
3098     @@ -509,15 +509,12 @@ void ssb_pmu_init(struct ssb_chipcommon *cc)
3099     ssb_dprintk(KERN_DEBUG PFX "Found rev %u PMU (capabilities 0x%08X)\n",
3100     cc->pmu.rev, pmucap);
3101    
3102     - if (cc->pmu.rev >= 1) {
3103     - if ((bus->chip_id == 0x4325) && (bus->chip_rev < 2)) {
3104     - chipco_mask32(cc, SSB_CHIPCO_PMU_CTL,
3105     - ~SSB_CHIPCO_PMU_CTL_NOILPONW);
3106     - } else {
3107     - chipco_set32(cc, SSB_CHIPCO_PMU_CTL,
3108     - SSB_CHIPCO_PMU_CTL_NOILPONW);
3109     - }
3110     - }
3111     + if (cc->pmu.rev == 1)
3112     + chipco_mask32(cc, SSB_CHIPCO_PMU_CTL,
3113     + ~SSB_CHIPCO_PMU_CTL_NOILPONW);
3114     + else
3115     + chipco_set32(cc, SSB_CHIPCO_PMU_CTL,
3116     + SSB_CHIPCO_PMU_CTL_NOILPONW);
3117     ssb_pmu_pll_init(cc);
3118     ssb_pmu_resources_init(cc);
3119     }
3120     diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
3121     index 9e50896..17a1781 100644
3122     --- a/drivers/ssb/pci.c
3123     +++ b/drivers/ssb/pci.c
3124     @@ -22,6 +22,7 @@
3125    
3126     #include "ssb_private.h"
3127    
3128     +bool ssb_is_sprom_available(struct ssb_bus *bus);
3129    
3130     /* Define the following to 1 to enable a printk on each coreswitch. */
3131     #define SSB_VERBOSE_PCICORESWITCH_DEBUG 0
3132     @@ -167,7 +168,7 @@ err_pci:
3133     }
3134    
3135     /* Get the word-offset for a SSB_SPROM_XXX define. */
3136     -#define SPOFF(offset) (((offset) - SSB_SPROM_BASE) / sizeof(u16))
3137     +#define SPOFF(offset) ((offset) / sizeof(u16))
3138     /* Helper to extract some _offset, which is one of the SSB_SPROM_XXX defines. */
3139     #define SPEX16(_outvar, _offset, _mask, _shift) \
3140     out->_outvar = ((in[SPOFF(_offset)] & (_mask)) >> (_shift))
3141     @@ -252,8 +253,13 @@ static int sprom_do_read(struct ssb_bus *bus, u16 *sprom)
3142     {
3143     int i;
3144    
3145     + /* Check if SPROM can be read */
3146     + if (ioread16(bus->mmio + bus->sprom_offset) == 0xFFFF) {
3147     + ssb_printk(KERN_ERR PFX "Unable to read SPROM\n");
3148     + return -ENODEV;
3149     + }
3150     for (i = 0; i < bus->sprom_size; i++)
3151     - sprom[i] = ioread16(bus->mmio + SSB_SPROM_BASE + (i * 2));
3152     + sprom[i] = ioread16(bus->mmio + bus->sprom_offset + (i * 2));
3153    
3154     return 0;
3155     }
3156     @@ -284,7 +290,7 @@ static int sprom_do_write(struct ssb_bus *bus, const u16 *sprom)
3157     ssb_printk("75%%");
3158     else if (i % 2)
3159     ssb_printk(".");
3160     - writew(sprom[i], bus->mmio + SSB_SPROM_BASE + (i * 2));
3161     + writew(sprom[i], bus->mmio + bus->sprom_offset + (i * 2));
3162     mmiowb();
3163     msleep(20);
3164     }
3165     @@ -620,21 +626,49 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
3166     int err = -ENOMEM;
3167     u16 *buf;
3168    
3169     + if (!ssb_is_sprom_available(bus)) {
3170     + ssb_printk(KERN_ERR PFX "No SPROM available!\n");
3171     + return -ENODEV;
3172     + }
3173     + if (bus->chipco.dev) { /* can be unavailible! */
3174     + /*
3175     + * get SPROM offset: SSB_SPROM_BASE1 except for
3176     + * chipcommon rev >= 31 or chip ID is 0x4312 and
3177     + * chipcommon status & 3 == 2
3178     + */
3179     + if (bus->chipco.dev->id.revision >= 31)
3180     + bus->sprom_offset = SSB_SPROM_BASE31;
3181     + else if (bus->chip_id == 0x4312 &&
3182     + (bus->chipco.status & 0x03) == 2)
3183     + bus->sprom_offset = SSB_SPROM_BASE31;
3184     + else
3185     + bus->sprom_offset = SSB_SPROM_BASE1;
3186     + } else {
3187     + bus->sprom_offset = SSB_SPROM_BASE1;
3188     + }
3189     + ssb_dprintk(KERN_INFO PFX "SPROM offset is 0x%x\n", bus->sprom_offset);
3190     +
3191     buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL);
3192     if (!buf)
3193     goto out;
3194     bus->sprom_size = SSB_SPROMSIZE_WORDS_R123;
3195     - sprom_do_read(bus, buf);
3196     + err = sprom_do_read(bus, buf);
3197     + if (err)
3198     + goto out_free;
3199     err = sprom_check_crc(buf, bus->sprom_size);
3200     if (err) {
3201     /* try for a 440 byte SPROM - revision 4 and higher */
3202     kfree(buf);
3203     buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
3204     GFP_KERNEL);
3205     - if (!buf)
3206     + if (!buf) {
3207     + err = -ENOMEM;
3208     goto out;
3209     + }
3210     bus->sprom_size = SSB_SPROMSIZE_WORDS_R4;
3211     - sprom_do_read(bus, buf);
3212     + err = sprom_do_read(bus, buf);
3213     + if (err)
3214     + goto out_free;
3215     err = sprom_check_crc(buf, bus->sprom_size);
3216     if (err) {
3217     /* All CRC attempts failed.
3218     diff --git a/drivers/ssb/sprom.c b/drivers/ssb/sprom.c
3219     index d0e6762..7249f26 100644
3220     --- a/drivers/ssb/sprom.c
3221     +++ b/drivers/ssb/sprom.c
3222     @@ -175,3 +175,18 @@ const struct ssb_sprom *ssb_get_fallback_sprom(void)
3223     {
3224     return fallback_sprom;
3225     }
3226     +
3227     +/* http://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */
3228     +bool ssb_is_sprom_available(struct ssb_bus *bus)
3229     +{
3230     + /* status register only exists on chipcomon rev >= 11 and we need check
3231     + for >= 31 only */
3232     + /* this routine differs from specs as we do not access SPROM directly
3233     + on PCMCIA */
3234     + if (bus->bustype == SSB_BUSTYPE_PCI &&
3235     + bus->chipco.dev && /* can be unavailible! */
3236     + bus->chipco.dev->id.revision >= 31)
3237     + return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM;
3238     +
3239     + return true;
3240     +}
3241     diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
3242     index 55337c8..8ff9fed 100644
3243     --- a/drivers/staging/rtl8192su/r8192U_core.c
3244     +++ b/drivers/staging/rtl8192su/r8192U_core.c
3245     @@ -118,6 +118,7 @@ static struct usb_device_id rtl8192_usb_id_tbl[] = {
3246     {USB_DEVICE(0x07aa, 0x0043)},
3247     /* Belkin */
3248     {USB_DEVICE(0x050d, 0x805E)},
3249     + {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 */
3250     /* Sitecom */
3251     {USB_DEVICE(0x0df6, 0x0031)},
3252     {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */
3253     diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
3254     index d9d0bf5..ce99d8b 100644
3255     --- a/drivers/usb/core/driver.c
3256     +++ b/drivers/usb/core/driver.c
3257     @@ -1790,9 +1790,6 @@ int usb_external_resume_device(struct usb_device *udev, pm_message_t msg)
3258    
3259     static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
3260     {
3261     - int w, i;
3262     - struct usb_interface *intf;
3263     -
3264     /* Remote wakeup is needed only when we actually go to sleep.
3265     * For things like FREEZE and QUIESCE, if the device is already
3266     * autosuspended then its current wakeup setting is okay.
3267     @@ -1802,18 +1799,10 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
3268     return;
3269     }
3270    
3271     - /* If remote wakeup is permitted, see whether any interface drivers
3272     + /* Allow remote wakeup if it is enabled, even if no interface drivers
3273     * actually want it.
3274     */
3275     - w = 0;
3276     - if (device_may_wakeup(&udev->dev) && udev->actconfig) {
3277     - for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
3278     - intf = udev->actconfig->interface[i];
3279     - w |= intf->needs_remote_wakeup;
3280     - }
3281     - }
3282     -
3283     - udev->do_remote_wakeup = w;
3284     + udev->do_remote_wakeup = device_may_wakeup(&udev->dev);
3285     }
3286    
3287     int usb_suspend(struct device *dev, pm_message_t msg)
3288     diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
3289     index ab93918..a61f160 100644
3290     --- a/drivers/usb/core/quirks.c
3291     +++ b/drivers/usb/core/quirks.c
3292     @@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = {
3293     /* Philips PSC805 audio device */
3294     { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
3295    
3296     + /* Artisman Watchdog Dongle */
3297     + { USB_DEVICE(0x04b4, 0x0526), .driver_info =
3298     + USB_QUIRK_CONFIG_INTF_STRINGS },
3299     +
3300     /* Roland SC-8820 */
3301     { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
3302    
3303     @@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = {
3304     /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
3305     { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
3306    
3307     + /* Broadcom BCM92035DGROM BT dongle */
3308     + { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
3309     +
3310     /* Action Semiconductor flash disk */
3311     { USB_DEVICE(0x10d6, 0x2200), .driver_info =
3312     USB_QUIRK_STRING_FETCH_255 },
3313     diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
3314     index adf8260..9e5f9f1 100644
3315     --- a/drivers/usb/gadget/u_serial.c
3316     +++ b/drivers/usb/gadget/u_serial.c
3317     @@ -535,17 +535,11 @@ recycle:
3318     list_move(&req->list, &port->read_pool);
3319     }
3320    
3321     - /* Push from tty to ldisc; this is immediate with low_latency, and
3322     - * may trigger callbacks to this driver ... so drop the spinlock.
3323     + /* Push from tty to ldisc; without low_latency set this is handled by
3324     + * a workqueue, so we won't get callbacks and can hold port_lock
3325     */
3326     if (tty && do_push) {
3327     - spin_unlock_irq(&port->port_lock);
3328     tty_flip_buffer_push(tty);
3329     - wake_up_interruptible(&tty->read_wait);
3330     - spin_lock_irq(&port->port_lock);
3331     -
3332     - /* tty may have been closed */
3333     - tty = port->port_tty;
3334     }
3335    
3336    
3337     @@ -783,11 +777,6 @@ static int gs_open(struct tty_struct *tty, struct file *file)
3338     port->open_count = 1;
3339     port->openclose = false;
3340    
3341     - /* low_latency means ldiscs work in tasklet context, without
3342     - * needing a workqueue schedule ... easier to keep up.
3343     - */
3344     - tty->low_latency = 1;
3345     -
3346     /* if connected, start the I/O stream */
3347     if (port->port_usb) {
3348     struct gserial *gser = port->port_usb;
3349     @@ -1194,6 +1183,7 @@ void gserial_cleanup(void)
3350     n_ports = 0;
3351    
3352     tty_unregister_driver(gs_tty_driver);
3353     + put_tty_driver(gs_tty_driver);
3354     gs_tty_driver = NULL;
3355    
3356     pr_debug("%s: cleaned up ttyGS* support\n", __func__);
3357     diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
3358     index 35c56f4..798b407 100644
3359     --- a/drivers/usb/host/ehci-mxc.c
3360     +++ b/drivers/usb/host/ehci-mxc.c
3361     @@ -207,10 +207,17 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
3362     /* Initialize the transceiver */
3363     if (pdata->otg) {
3364     pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET;
3365     - if (otg_init(pdata->otg) != 0)
3366     - dev_err(dev, "unable to init transceiver\n");
3367     - else if (otg_set_vbus(pdata->otg, 1) != 0)
3368     + ret = otg_init(pdata->otg);
3369     + if (ret) {
3370     + dev_err(dev, "unable to init transceiver, probably missing\n");
3371     + ret = -ENODEV;
3372     + goto err_add;
3373     + }
3374     + ret = otg_set_vbus(pdata->otg, 1);
3375     + if (ret) {
3376     dev_err(dev, "unable to enable vbus on transceiver\n");
3377     + goto err_add;
3378     + }
3379     }
3380    
3381     priv->hcd = hcd;
3382     diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
3383     index 8b37a4b..be41ec3 100644
3384     --- a/drivers/usb/misc/sisusbvga/sisusb.c
3385     +++ b/drivers/usb/misc/sisusbvga/sisusb.c
3386     @@ -2435,7 +2435,8 @@ sisusb_open(struct inode *inode, struct file *file)
3387     }
3388    
3389     if (!sisusb->devinit) {
3390     - if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) {
3391     + if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH ||
3392     + sisusb->sisusb_dev->speed == USB_SPEED_SUPER) {
3393     if (sisusb_init_gfxdevice(sisusb, 0)) {
3394     mutex_unlock(&sisusb->lock);
3395     dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n");
3396     @@ -3167,7 +3168,7 @@ static int sisusb_probe(struct usb_interface *intf,
3397    
3398     sisusb->present = 1;
3399    
3400     - if (dev->speed == USB_SPEED_HIGH) {
3401     + if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
3402     int initscreen = 1;
3403     #ifdef INCL_SISUSB_CON
3404     if (sisusb_first_vc > 0 &&
3405     diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
3406     index 8c19ad5..bc11d0c 100644
3407     --- a/drivers/usb/serial/ftdi_sio.c
3408     +++ b/drivers/usb/serial/ftdi_sio.c
3409     @@ -697,6 +697,7 @@ static struct usb_device_id id_table_combined [] = {
3410     { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
3411     .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
3412     { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
3413     + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) },
3414     { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
3415     { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
3416     { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
3417     @@ -743,6 +744,14 @@ static struct usb_device_id id_table_combined [] = {
3418     { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
3419     { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) },
3420     { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) },
3421     + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID),
3422     + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
3423     + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID),
3424     + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
3425     + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID),
3426     + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
3427     + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
3428     + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
3429     { }, /* Optional parameter entry */
3430     { } /* Terminating entry */
3431     };
3432     diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
3433     index 8f9e805..ffdcec7 100644
3434     --- a/drivers/usb/serial/ftdi_sio_ids.h
3435     +++ b/drivers/usb/serial/ftdi_sio_ids.h
3436     @@ -703,6 +703,12 @@
3437     #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */
3438    
3439     /*
3440     + * RT Systems programming cables for various ham radios
3441     + */
3442     +#define RTSYSTEMS_VID 0x2100 /* Vendor ID */
3443     +#define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */
3444     +
3445     +/*
3446     * Bayer Ascensia Contour blood glucose meter USB-converter cable.
3447     * http://winglucofacts.com/cables/
3448     */
3449     @@ -1024,3 +1030,12 @@
3450     #define MJSG_SR_RADIO_PID 0x9379
3451     #define MJSG_XM_RADIO_PID 0x937A
3452     #define MJSG_HD_RADIO_PID 0x937C
3453     +
3454     +/*
3455     + * Xverve Signalyzer tools (http://www.signalyzer.com/)
3456     + */
3457     +#define XVERVE_SIGNALYZER_ST_PID 0xBCA0
3458     +#define XVERVE_SIGNALYZER_SLITE_PID 0xBCA1
3459     +#define XVERVE_SIGNALYZER_SH2_PID 0xBCA2
3460     +#define XVERVE_SIGNALYZER_SH4_PID 0xBCA4
3461     +
3462     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
3463     index 64b50f6..c5def6d 100644
3464     --- a/drivers/usb/serial/option.c
3465     +++ b/drivers/usb/serial/option.c
3466     @@ -226,6 +226,7 @@ static int option_resume(struct usb_serial *serial);
3467     #define AMOI_PRODUCT_H01 0x0800
3468     #define AMOI_PRODUCT_H01A 0x7002
3469     #define AMOI_PRODUCT_H02 0x0802
3470     +#define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407
3471    
3472     #define DELL_VENDOR_ID 0x413C
3473    
3474     @@ -316,6 +317,7 @@ static int option_resume(struct usb_serial *serial);
3475     #define QISDA_PRODUCT_H21_4512 0x4512
3476     #define QISDA_PRODUCT_H21_4523 0x4523
3477     #define QISDA_PRODUCT_H20_4515 0x4515
3478     +#define QISDA_PRODUCT_H20_4518 0x4518
3479     #define QISDA_PRODUCT_H20_4519 0x4519
3480    
3481     /* TLAYTECH PRODUCTS */
3482     @@ -503,6 +505,7 @@ static struct usb_device_id option_ids[] = {
3483     { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
3484     { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
3485     { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
3486     + { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) },
3487    
3488     { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
3489     { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
3490     @@ -836,6 +839,7 @@ static struct usb_device_id option_ids[] = {
3491     { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
3492     { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
3493     { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
3494     + { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) },
3495     { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) },
3496     { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) },
3497     { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
3498     diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
3499     index a442989..6435b26 100644
3500     --- a/drivers/usb/serial/sierra.c
3501     +++ b/drivers/usb/serial/sierra.c
3502     @@ -244,6 +244,7 @@ static struct usb_device_id id_table [] = {
3503     { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
3504     { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
3505     { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
3506     + { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */
3507     /* Sierra Wireless C597 */
3508     { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },
3509     /* Sierra Wireless T598 */
3510     diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
3511     index 2c6ee6a..0bc5776 100644
3512     --- a/fs/btrfs/ioctl.c
3513     +++ b/fs/btrfs/ioctl.c
3514     @@ -952,7 +952,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
3515     */
3516    
3517     /* the destination must be opened for writing */
3518     - if (!(file->f_mode & FMODE_WRITE))
3519     + if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND))
3520     return -EINVAL;
3521    
3522     ret = mnt_want_write(file->f_path.mnt);
3523     @@ -1005,7 +1005,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
3524    
3525     /* determine range to clone */
3526     ret = -EINVAL;
3527     - if (off >= src->i_size || off + len > src->i_size)
3528     + if (off + len > src->i_size || off + len < off)
3529     goto out_unlock;
3530     if (len == 0)
3531     olen = len = src->i_size - off;
3532     diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
3533     index 8c6a036..7fb871a 100644
3534     --- a/fs/cifs/cifsfs.c
3535     +++ b/fs/cifs/cifsfs.c
3536     @@ -1034,7 +1034,7 @@ init_cifs(void)
3537     goto out_unregister_filesystem;
3538     #endif
3539     #ifdef CONFIG_CIFS_DFS_UPCALL
3540     - rc = register_key_type(&key_type_dns_resolver);
3541     + rc = cifs_init_dns_resolver();
3542     if (rc)
3543     goto out_unregister_key_type;
3544     #endif
3545     @@ -1046,7 +1046,7 @@ init_cifs(void)
3546    
3547     out_unregister_resolver_key:
3548     #ifdef CONFIG_CIFS_DFS_UPCALL
3549     - unregister_key_type(&key_type_dns_resolver);
3550     + cifs_exit_dns_resolver();
3551     out_unregister_key_type:
3552     #endif
3553     #ifdef CONFIG_CIFS_UPCALL
3554     @@ -1072,7 +1072,7 @@ exit_cifs(void)
3555     cifs_proc_clean();
3556     #ifdef CONFIG_CIFS_DFS_UPCALL
3557     cifs_dfs_release_automount_timer();
3558     - unregister_key_type(&key_type_dns_resolver);
3559     + cifs_exit_dns_resolver();
3560     #endif
3561     #ifdef CONFIG_CIFS_UPCALL
3562     unregister_key_type(&cifs_spnego_key_type);
3563     diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
3564     index 8794814..16f31c1 100644
3565     --- a/fs/cifs/dns_resolve.c
3566     +++ b/fs/cifs/dns_resolve.c
3567     @@ -23,12 +23,16 @@
3568     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3569     */
3570    
3571     +#include <linux/keyctl.h>
3572     +#include <linux/key-type.h>
3573     #include <keys/user-type.h>
3574     #include "dns_resolve.h"
3575     #include "cifsglob.h"
3576     #include "cifsproto.h"
3577     #include "cifs_debug.h"
3578    
3579     +static const struct cred *dns_resolver_cache;
3580     +
3581     /* Checks if supplied name is IP address
3582     * returns:
3583     * 1 - name is IP
3584     @@ -93,6 +97,7 @@ struct key_type key_type_dns_resolver = {
3585     int
3586     dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
3587     {
3588     + const struct cred *saved_cred;
3589     int rc = -EAGAIN;
3590     struct key *rkey = ERR_PTR(-EAGAIN);
3591     char *name;
3592     @@ -132,8 +137,15 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
3593     goto skip_upcall;
3594     }
3595    
3596     + saved_cred = override_creds(dns_resolver_cache);
3597     rkey = request_key(&key_type_dns_resolver, name, "");
3598     + revert_creds(saved_cred);
3599     if (!IS_ERR(rkey)) {
3600     + if (!(rkey->perm & KEY_USR_VIEW)) {
3601     + down_read(&rkey->sem);
3602     + rkey->perm |= KEY_USR_VIEW;
3603     + up_read(&rkey->sem);
3604     + }
3605     len = rkey->type_data.x[0];
3606     data = rkey->payload.data;
3607     } else {
3608     @@ -164,4 +176,61 @@ out:
3609     return rc;
3610     }
3611    
3612     +int __init cifs_init_dns_resolver(void)
3613     +{
3614     + struct cred *cred;
3615     + struct key *keyring;
3616     + int ret;
3617     +
3618     + printk(KERN_NOTICE "Registering the %s key type\n",
3619     + key_type_dns_resolver.name);
3620     +
3621     + /* create an override credential set with a special thread keyring in
3622     + * which DNS requests are cached
3623     + *
3624     + * this is used to prevent malicious redirections from being installed
3625     + * with add_key().
3626     + */
3627     + cred = prepare_kernel_cred(NULL);
3628     + if (!cred)
3629     + return -ENOMEM;
3630     +
3631     + keyring = key_alloc(&key_type_keyring, ".dns_resolver", 0, 0, cred,
3632     + (KEY_POS_ALL & ~KEY_POS_SETATTR) |
3633     + KEY_USR_VIEW | KEY_USR_READ,
3634     + KEY_ALLOC_NOT_IN_QUOTA);
3635     + if (IS_ERR(keyring)) {
3636     + ret = PTR_ERR(keyring);
3637     + goto failed_put_cred;
3638     + }
3639     +
3640     + ret = key_instantiate_and_link(keyring, NULL, 0, NULL, NULL);
3641     + if (ret < 0)
3642     + goto failed_put_key;
3643     +
3644     + ret = register_key_type(&key_type_dns_resolver);
3645     + if (ret < 0)
3646     + goto failed_put_key;
3647     +
3648     + /* instruct request_key() to use this special keyring as a cache for
3649     + * the results it looks up */
3650     + cred->thread_keyring = keyring;
3651     + cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
3652     + dns_resolver_cache = cred;
3653     + return 0;
3654     +
3655     +failed_put_key:
3656     + key_put(keyring);
3657     +failed_put_cred:
3658     + put_cred(cred);
3659     + return ret;
3660     +}
3661    
3662     +void __exit cifs_exit_dns_resolver(void)
3663     +{
3664     + key_revoke(dns_resolver_cache->thread_keyring);
3665     + unregister_key_type(&key_type_dns_resolver);
3666     + put_cred(dns_resolver_cache);
3667     + printk(KERN_NOTICE "Unregistered %s key type\n",
3668     + key_type_dns_resolver.name);
3669     +}
3670     diff --git a/fs/cifs/dns_resolve.h b/fs/cifs/dns_resolve.h
3671     index 966e928..26b9eaa 100644
3672     --- a/fs/cifs/dns_resolve.h
3673     +++ b/fs/cifs/dns_resolve.h
3674     @@ -24,8 +24,8 @@
3675     #define _DNS_RESOLVE_H
3676    
3677     #ifdef __KERNEL__
3678     -#include <linux/key-type.h>
3679     -extern struct key_type key_type_dns_resolver;
3680     +extern int __init cifs_init_dns_resolver(void);
3681     +extern void __exit cifs_exit_dns_resolver(void);
3682     extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
3683     #endif /* KERNEL */
3684    
3685     diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
3686     index 7ec8555..91be319 100644
3687     --- a/fs/cifs/inode.c
3688     +++ b/fs/cifs/inode.c
3689     @@ -1284,6 +1284,10 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath,
3690     if (rc == 0 || rc != -ETXTBSY)
3691     return rc;
3692    
3693     + /* open-file renames don't work across directories */
3694     + if (to_dentry->d_parent != from_dentry->d_parent)
3695     + return rc;
3696     +
3697     /* open the file to be renamed -- we need DELETE perms */
3698     rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE,
3699     CREATE_NOT_DIR, &srcfid, &oplock, NULL,
3700     diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
3701     index aaa9c1c..7ca42eb 100644
3702     --- a/fs/cifs/sess.c
3703     +++ b/fs/cifs/sess.c
3704     @@ -722,15 +722,7 @@ ssetup_ntlmssp_authenticate:
3705    
3706     /* calculate session key */
3707     setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp);
3708     - if (first_time) /* should this be moved into common code
3709     - with similar ntlmv2 path? */
3710     - /* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key,
3711     - response BB FIXME, v2_sess_key); */
3712     -
3713     - /* copy session key */
3714     -
3715     - /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
3716     - bcc_ptr += LM2_SESS_KEY_SIZE; */
3717     + /* FIXME: calculate MAC key */
3718     memcpy(bcc_ptr, (char *)v2_sess_key,
3719     sizeof(struct ntlmv2_resp));
3720     bcc_ptr += sizeof(struct ntlmv2_resp);
3721     diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
3722     index f1c17e8..3dfe7ce 100644
3723     --- a/fs/ecryptfs/messaging.c
3724     +++ b/fs/ecryptfs/messaging.c
3725     @@ -30,9 +30,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux;
3726    
3727     static struct hlist_head *ecryptfs_daemon_hash;
3728     struct mutex ecryptfs_daemon_hash_mux;
3729     -static int ecryptfs_hash_buckets;
3730     +static int ecryptfs_hash_bits;
3731     #define ecryptfs_uid_hash(uid) \
3732     - hash_long((unsigned long)uid, ecryptfs_hash_buckets)
3733     + hash_long((unsigned long)uid, ecryptfs_hash_bits)
3734    
3735     static u32 ecryptfs_msg_counter;
3736     static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
3737     @@ -485,18 +485,19 @@ int ecryptfs_init_messaging(void)
3738     }
3739     mutex_init(&ecryptfs_daemon_hash_mux);
3740     mutex_lock(&ecryptfs_daemon_hash_mux);
3741     - ecryptfs_hash_buckets = 1;
3742     - while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
3743     - ecryptfs_hash_buckets++;
3744     + ecryptfs_hash_bits = 1;
3745     + while (ecryptfs_number_of_users >> ecryptfs_hash_bits)
3746     + ecryptfs_hash_bits++;
3747     ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head)
3748     - * ecryptfs_hash_buckets), GFP_KERNEL);
3749     + * (1 << ecryptfs_hash_bits)),
3750     + GFP_KERNEL);
3751     if (!ecryptfs_daemon_hash) {
3752     rc = -ENOMEM;
3753     printk(KERN_ERR "%s: Failed to allocate memory\n", __func__);
3754     mutex_unlock(&ecryptfs_daemon_hash_mux);
3755     goto out;
3756     }
3757     - for (i = 0; i < ecryptfs_hash_buckets; i++)
3758     + for (i = 0; i < (1 << ecryptfs_hash_bits); i++)
3759     INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]);
3760     mutex_unlock(&ecryptfs_daemon_hash_mux);
3761     ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
3762     @@ -553,7 +554,7 @@ void ecryptfs_release_messaging(void)
3763     int i;
3764    
3765     mutex_lock(&ecryptfs_daemon_hash_mux);
3766     - for (i = 0; i < ecryptfs_hash_buckets; i++) {
3767     + for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
3768     int rc;
3769    
3770     hlist_for_each_entry(daemon, elem,
3771     diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
3772     index 5cd5184..d741e0e 100644
3773     --- a/fs/nfs/nfs4xdr.c
3774     +++ b/fs/nfs/nfs4xdr.c
3775     @@ -863,8 +863,8 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
3776     bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET;
3777     *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME);
3778     *p++ = cpu_to_be32(0);
3779     - *p++ = cpu_to_be32(iap->ia_mtime.tv_sec);
3780     - *p++ = cpu_to_be32(iap->ia_mtime.tv_nsec);
3781     + *p++ = cpu_to_be32(iap->ia_atime.tv_sec);
3782     + *p++ = cpu_to_be32(iap->ia_atime.tv_nsec);
3783     }
3784     else if (iap->ia_valid & ATTR_ATIME) {
3785     bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET;
3786     diff --git a/fs/nfs/super.c b/fs/nfs/super.c
3787     index f1afee4..912e61f 100644
3788     --- a/fs/nfs/super.c
3789     +++ b/fs/nfs/super.c
3790     @@ -565,6 +565,22 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
3791     nfs_show_mountd_netid(m, nfss, showdefaults);
3792     }
3793    
3794     +#ifdef CONFIG_NFS_V4
3795     +static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
3796     + int showdefaults)
3797     +{
3798     + struct nfs_client *clp = nfss->nfs_client;
3799     +
3800     + seq_printf(m, ",clientaddr=%s", clp->cl_ipaddr);
3801     + seq_printf(m, ",minorversion=%u", clp->cl_minorversion);
3802     +}
3803     +#else
3804     +static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
3805     + int showdefaults)
3806     +{
3807     +}
3808     +#endif
3809     +
3810     /*
3811     * Describe the mount options in force on this server representation
3812     */
3813     @@ -626,11 +642,9 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
3814    
3815     if (version != 4)
3816     nfs_show_mountd_options(m, nfss, showdefaults);
3817     + else
3818     + nfs_show_nfsv4_options(m, nfss, showdefaults);
3819    
3820     -#ifdef CONFIG_NFS_V4
3821     - if (clp->rpc_ops->version == 4)
3822     - seq_printf(m, ",clientaddr=%s", clp->cl_ipaddr);
3823     -#endif
3824     if (nfss->options & NFS_OPTION_FSCACHE)
3825     seq_printf(m, ",fsc");
3826     }
3827     diff --git a/include/acpi/processor.h b/include/acpi/processor.h
3828     index 0ea5ef4..dcd0cb0 100644
3829     --- a/include/acpi/processor.h
3830     +++ b/include/acpi/processor.h
3831     @@ -48,7 +48,7 @@ struct acpi_power_register {
3832     u8 space_id;
3833     u8 bit_width;
3834     u8 bit_offset;
3835     - u8 reserved;
3836     + u8 access_size;
3837     u64 address;
3838     } __attribute__ ((packed));
3839    
3840     @@ -74,6 +74,7 @@ struct acpi_processor_cx {
3841     u32 power;
3842     u32 usage;
3843     u64 time;
3844     + u8 bm_sts_skip;
3845     struct acpi_processor_cx_policy promotion;
3846     struct acpi_processor_cx_policy demotion;
3847     char desc[ACPI_CX_DESC_LEN];
3848     diff --git a/include/linux/acpi.h b/include/linux/acpi.h
3849     index b926afe..87ca491 100644
3850     --- a/include/linux/acpi.h
3851     +++ b/include/linux/acpi.h
3852     @@ -251,7 +251,6 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,
3853     void __init acpi_no_s4_hw_signature(void);
3854     void __init acpi_old_suspend_ordering(void);
3855     void __init acpi_s4_no_nvs(void);
3856     -void __init acpi_set_sci_en_on_resume(void);
3857     #endif /* CONFIG_PM_SLEEP */
3858    
3859     struct acpi_osc_context {
3860     diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
3861     index ef4a2d8..03c52fa 100644
3862     --- a/include/linux/ethtool.h
3863     +++ b/include/linux/ethtool.h
3864     @@ -358,6 +358,8 @@ struct ethtool_rxnfc {
3865     __u32 flow_type;
3866     /* The rx flow hash value or the rule DB size */
3867     __u64 data;
3868     + /* The following fields are not valid and must not be used for
3869     + * the ETHTOOL_{G,X}RXFH commands. */
3870     struct ethtool_rx_flow_spec fs;
3871     __u32 rule_cnt;
3872     __u32 rule_locs[0];
3873     diff --git a/include/linux/fb.h b/include/linux/fb.h
3874     index 369767b..74d67ca 100644
3875     --- a/include/linux/fb.h
3876     +++ b/include/linux/fb.h
3877     @@ -785,8 +785,6 @@ struct fb_tile_ops {
3878     #define FBINFO_MISC_USEREVENT 0x10000 /* event request
3879     from userspace */
3880     #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */
3881     -#define FBINFO_MISC_FIRMWARE 0x40000 /* a replaceable firmware
3882     - inited framebuffer */
3883    
3884     /* A driver may set this flag to indicate that it does want a set_par to be
3885     * called every time when fbcon_switch is executed. The advantage is that with
3886     @@ -800,6 +798,8 @@ struct fb_tile_ops {
3887     */
3888     #define FBINFO_MISC_ALWAYS_SETPAR 0x40000
3889    
3890     +/* where the fb is a firmware driver, and can be replaced with a proper one */
3891     +#define FBINFO_MISC_FIRMWARE 0x80000
3892     /*
3893     * Host and GPU endianness differ.
3894     */
3895     diff --git a/include/linux/firmware.h b/include/linux/firmware.h
3896     index 043811f..53d1e6c 100644
3897     --- a/include/linux/firmware.h
3898     +++ b/include/linux/firmware.h
3899     @@ -12,6 +12,7 @@
3900     struct firmware {
3901     size_t size;
3902     const u8 *data;
3903     + struct page **pages;
3904     };
3905    
3906     struct device;
3907     diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
3908     index 163c840..047e449 100644
3909     --- a/include/linux/ieee80211.h
3910     +++ b/include/linux/ieee80211.h
3911     @@ -1137,6 +1137,8 @@ enum ieee80211_category {
3912     WLAN_CATEGORY_SA_QUERY = 8,
3913     WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
3914     WLAN_CATEGORY_WMM = 17,
3915     + WLAN_CATEGORY_MESH_PLINK = 30, /* Pending ANA approval */
3916     + WLAN_CATEGORY_MESH_PATH_SEL = 32, /* Pending ANA approval */
3917     WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
3918     WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
3919     };
3920     diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
3921     index 47ba464..118f029 100644
3922     --- a/include/linux/mmc/sdio.h
3923     +++ b/include/linux/mmc/sdio.h
3924     @@ -94,6 +94,8 @@
3925    
3926     #define SDIO_BUS_WIDTH_1BIT 0x00
3927     #define SDIO_BUS_WIDTH_4BIT 0x02
3928     +#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
3929     +#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
3930    
3931     #define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */
3932    
3933     diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
3934     index be29806..f0bcfbc 100644
3935     --- a/include/linux/pci_ids.h
3936     +++ b/include/linux/pci_ids.h
3937     @@ -1262,6 +1262,7 @@
3938     #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759
3939     #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_SMBUS 0x07D8
3940     #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS 0x0AA2
3941     +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA 0x0D85
3942    
3943     #define PCI_VENDOR_ID_IMS 0x10e0
3944     #define PCI_DEVICE_ID_IMS_TT128 0x9128
3945     diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
3946     index 24f9885..732ba9a 100644
3947     --- a/include/linux/ssb/ssb.h
3948     +++ b/include/linux/ssb/ssb.h
3949     @@ -306,6 +306,7 @@ struct ssb_bus {
3950     u16 chip_id;
3951     u16 chip_rev;
3952     u16 sprom_size; /* number of words in sprom */
3953     + u16 sprom_offset;
3954     u8 chip_package;
3955    
3956     /* List of devices (cores) on the backplane. */
3957     diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
3958     index 4e27acf..7600f38 100644
3959     --- a/include/linux/ssb/ssb_driver_chipcommon.h
3960     +++ b/include/linux/ssb/ssb_driver_chipcommon.h
3961     @@ -46,6 +46,7 @@
3962     #define SSB_PLLTYPE_7 0x00038000 /* 25Mhz, 4 dividers */
3963     #define SSB_CHIPCO_CAP_PCTL 0x00040000 /* Power Control */
3964     #define SSB_CHIPCO_CAP_OTPS 0x00380000 /* OTP size */
3965     +#define SSB_CHIPCO_CAP_SPROM 0x40000000 /* SPROM present */
3966     #define SSB_CHIPCO_CAP_OTPS_SHIFT 19
3967     #define SSB_CHIPCO_CAP_OTPS_BASE 5
3968     #define SSB_CHIPCO_CAP_JTAGM 0x00400000 /* JTAG master present */
3969     @@ -564,6 +565,7 @@ struct ssb_chipcommon_pmu {
3970     struct ssb_chipcommon {
3971     struct ssb_device *dev;
3972     u32 capabilities;
3973     + u32 status;
3974     /* Fast Powerup Delay constant */
3975     u16 fast_pwrup_delay;
3976     struct ssb_chipcommon_pmu pmu;
3977     diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
3978     index 9ae9082..b8be23c 100644
3979     --- a/include/linux/ssb/ssb_regs.h
3980     +++ b/include/linux/ssb/ssb_regs.h
3981     @@ -170,7 +170,8 @@
3982     #define SSB_SPROMSIZE_WORDS_R4 220
3983     #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16))
3984     #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16))
3985     -#define SSB_SPROM_BASE 0x1000
3986     +#define SSB_SPROM_BASE1 0x1000
3987     +#define SSB_SPROM_BASE31 0x0800
3988     #define SSB_SPROM_REVISION 0x107E
3989     #define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */
3990     #define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */
3991     diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
3992     index f456534..3e2576d 100644
3993     --- a/include/math-emu/op-common.h
3994     +++ b/include/math-emu/op-common.h
3995     @@ -799,7 +799,7 @@ do { \
3996     X##_e -= (_FP_W_TYPE_SIZE - rsize); \
3997     X##_e = rsize - X##_e - 1; \
3998     \
3999     - if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \
4000     + if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e) \
4001     __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\
4002     _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \
4003     if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \
4004     diff --git a/include/net/sock.h b/include/net/sock.h
4005     index 86f2da1b..e45305d 100644
4006     --- a/include/net/sock.h
4007     +++ b/include/net/sock.h
4008     @@ -1130,12 +1130,7 @@ static inline void sk_tx_queue_clear(struct sock *sk)
4009    
4010     static inline int sk_tx_queue_get(const struct sock *sk)
4011     {
4012     - return sk->sk_tx_queue_mapping;
4013     -}
4014     -
4015     -static inline bool sk_tx_queue_recorded(const struct sock *sk)
4016     -{
4017     - return (sk && sk->sk_tx_queue_mapping >= 0);
4018     + return sk ? sk->sk_tx_queue_mapping : -1;
4019     }
4020    
4021     static inline void sk_set_socket(struct sock *sk, struct socket *sock)
4022     diff --git a/kernel/futex.c b/kernel/futex.c
4023     index e7a35f1..6a3a5fa 100644
4024     --- a/kernel/futex.c
4025     +++ b/kernel/futex.c
4026     @@ -429,20 +429,11 @@ static void free_pi_state(struct futex_pi_state *pi_state)
4027     static struct task_struct * futex_find_get_task(pid_t pid)
4028     {
4029     struct task_struct *p;
4030     - const struct cred *cred = current_cred(), *pcred;
4031    
4032     rcu_read_lock();
4033     p = find_task_by_vpid(pid);
4034     - if (!p) {
4035     - p = ERR_PTR(-ESRCH);
4036     - } else {
4037     - pcred = __task_cred(p);
4038     - if (cred->euid != pcred->euid &&
4039     - cred->euid != pcred->uid)
4040     - p = ERR_PTR(-ESRCH);
4041     - else
4042     - get_task_struct(p);
4043     - }
4044     + if (p)
4045     + get_task_struct(p);
4046    
4047     rcu_read_unlock();
4048    
4049     @@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
4050     if (!pid)
4051     return -ESRCH;
4052     p = futex_find_get_task(pid);
4053     - if (IS_ERR(p))
4054     - return PTR_ERR(p);
4055     + if (!p)
4056     + return -ESRCH;
4057    
4058     /*
4059     * We need to look at the task state flags to figure out,
4060     diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
4061     index 0b23ff7..918c618 100644
4062     --- a/kernel/irq/manage.c
4063     +++ b/kernel/irq/manage.c
4064     @@ -436,6 +436,9 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
4065     /* note that IRQF_TRIGGER_MASK == IRQ_TYPE_SENSE_MASK */
4066     desc->status &= ~(IRQ_LEVEL | IRQ_TYPE_SENSE_MASK);
4067     desc->status |= flags;
4068     +
4069     + if (chip != desc->chip)
4070     + irq_chip_set_defaults(desc->chip);
4071     }
4072    
4073     return ret;
4074     diff --git a/kernel/module.c b/kernel/module.c
4075     index 5b6ce39..3d1df51 100644
4076     --- a/kernel/module.c
4077     +++ b/kernel/module.c
4078     @@ -720,7 +720,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
4079     mutex_lock(&module_mutex);
4080     /* Store the name of the last unloaded module for diagnostic purposes */
4081     strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
4082     - ddebug_remove_module(mod->name);
4083     free_module(mod);
4084    
4085     out:
4086     @@ -1383,6 +1382,9 @@ static void free_module(struct module *mod)
4087     remove_sect_attrs(mod);
4088     mod_kobject_remove(mod);
4089    
4090     + /* Remove dynamic debug info */
4091     + ddebug_remove_module(mod->name);
4092     +
4093     /* Arch-specific cleanup. */
4094     module_arch_cleanup(mod);
4095    
4096     diff --git a/kernel/sched.c b/kernel/sched.c
4097     index da19c1e..12b9e73 100644
4098     --- a/kernel/sched.c
4099     +++ b/kernel/sched.c
4100     @@ -1259,6 +1259,12 @@ static void sched_avg_update(struct rq *rq)
4101     s64 period = sched_avg_period();
4102    
4103     while ((s64)(rq->clock - rq->age_stamp) > period) {
4104     + /*
4105     + * Inline assembly required to prevent the compiler
4106     + * optimising this loop into a divmod call.
4107     + * See __iter_div_u64_rem() for another example of this.
4108     + */
4109     + asm("" : "+rm" (rq->age_stamp));
4110     rq->age_stamp += period;
4111     rq->rt_avg /= 2;
4112     }
4113     @@ -1713,9 +1719,6 @@ static void update_shares_locked(struct rq *rq, struct sched_domain *sd)
4114    
4115     static void update_h_load(long cpu)
4116     {
4117     - if (root_task_group_empty())
4118     - return;
4119     -
4120     walk_tg_tree(tg_load_down, tg_nop, (void *)cpu);
4121     }
4122    
4123     diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
4124     index 3b8e038..900431c 100644
4125     --- a/net/bridge/br_fdb.c
4126     +++ b/net/bridge/br_fdb.c
4127     @@ -127,7 +127,7 @@ void br_fdb_cleanup(unsigned long _data)
4128     {
4129     struct net_bridge *br = (struct net_bridge *)_data;
4130     unsigned long delay = hold_time(br);
4131     - unsigned long next_timer = jiffies + br->forward_delay;
4132     + unsigned long next_timer = jiffies + br->ageing_time;
4133     int i;
4134    
4135     spin_lock_bh(&br->hash_lock);
4136     @@ -148,9 +148,7 @@ void br_fdb_cleanup(unsigned long _data)
4137     }
4138     spin_unlock_bh(&br->hash_lock);
4139    
4140     - /* Add HZ/4 to ensure we round the jiffies upwards to be after the next
4141     - * timer, otherwise we might round down and will have no-op run. */
4142     - mod_timer(&br->gc_timer, round_jiffies(next_timer + HZ/4));
4143     + mod_timer(&br->gc_timer, round_jiffies_up(next_timer));
4144     }
4145    
4146     /* Completely flush all dynamic entries in forwarding database.*/
4147     diff --git a/net/core/dev.c b/net/core/dev.c
4148     index f51f940..7eb7c1d 100644
4149     --- a/net/core/dev.c
4150     +++ b/net/core/dev.c
4151     @@ -1428,7 +1428,7 @@ static inline void net_timestamp(struct sk_buff *skb)
4152     *
4153     * return values:
4154     * NET_RX_SUCCESS (no congestion)
4155     - * NET_RX_DROP (packet was dropped)
4156     + * NET_RX_DROP (packet was dropped, but freed)
4157     *
4158     * dev_forward_skb can be used for injecting an skb from the
4159     * start_xmit function of one device into the receive queue
4160     @@ -1442,11 +1442,11 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
4161     {
4162     skb_orphan(skb);
4163    
4164     - if (!(dev->flags & IFF_UP))
4165     - return NET_RX_DROP;
4166     -
4167     - if (skb->len > (dev->mtu + dev->hard_header_len))
4168     + if (!(dev->flags & IFF_UP) ||
4169     + (skb->len > (dev->mtu + dev->hard_header_len))) {
4170     + kfree_skb(skb);
4171     return NET_RX_DROP;
4172     + }
4173    
4174     skb_dst_drop(skb);
4175     skb->tstamp.tv64 = 0;
4176     @@ -1915,12 +1915,11 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
4177     static struct netdev_queue *dev_pick_tx(struct net_device *dev,
4178     struct sk_buff *skb)
4179     {
4180     - u16 queue_index;
4181     + int queue_index;
4182     struct sock *sk = skb->sk;
4183    
4184     - if (sk_tx_queue_recorded(sk)) {
4185     - queue_index = sk_tx_queue_get(sk);
4186     - } else {
4187     + queue_index = sk_tx_queue_get(sk);
4188     + if (queue_index < 0) {
4189     const struct net_device_ops *ops = dev->netdev_ops;
4190    
4191     if (ops->ndo_select_queue) {
4192     diff --git a/net/core/ethtool.c b/net/core/ethtool.c
4193     index 236a998..ed2fb75 100644
4194     --- a/net/core/ethtool.c
4195     +++ b/net/core/ethtool.c
4196     @@ -209,22 +209,34 @@ static int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr)
4197     return 0;
4198     }
4199    
4200     -static int ethtool_set_rxnfc(struct net_device *dev, void __user *useraddr)
4201     +static int ethtool_set_rxnfc(struct net_device *dev,
4202     + u32 cmd, void __user *useraddr)
4203     {
4204     - struct ethtool_rxnfc cmd;
4205     + struct ethtool_rxnfc info;
4206     + size_t info_size = sizeof(info);
4207    
4208     if (!dev->ethtool_ops->set_rxnfc)
4209     return -EOPNOTSUPP;
4210    
4211     - if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
4212     + /* struct ethtool_rxnfc was originally defined for
4213     + * ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data
4214     + * members. User-space might still be using that
4215     + * definition. */
4216     + if (cmd == ETHTOOL_SRXFH)
4217     + info_size = (offsetof(struct ethtool_rxnfc, data) +
4218     + sizeof(info.data));
4219     +
4220     + if (copy_from_user(&info, useraddr, info_size))
4221     return -EFAULT;
4222    
4223     - return dev->ethtool_ops->set_rxnfc(dev, &cmd);
4224     + return dev->ethtool_ops->set_rxnfc(dev, &info);
4225     }
4226    
4227     -static int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr)
4228     +static int ethtool_get_rxnfc(struct net_device *dev,
4229     + u32 cmd, void __user *useraddr)
4230     {
4231     struct ethtool_rxnfc info;
4232     + size_t info_size = sizeof(info);
4233     const struct ethtool_ops *ops = dev->ethtool_ops;
4234     int ret;
4235     void *rule_buf = NULL;
4236     @@ -232,13 +244,22 @@ static int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr)
4237     if (!ops->get_rxnfc)
4238     return -EOPNOTSUPP;
4239    
4240     - if (copy_from_user(&info, useraddr, sizeof(info)))
4241     + /* struct ethtool_rxnfc was originally defined for
4242     + * ETHTOOL_{G,S}RXFH with only the cmd, flow_type and data
4243     + * members. User-space might still be using that
4244     + * definition. */
4245     + if (cmd == ETHTOOL_GRXFH)
4246     + info_size = (offsetof(struct ethtool_rxnfc, data) +
4247     + sizeof(info.data));
4248     +
4249     + if (copy_from_user(&info, useraddr, info_size))
4250     return -EFAULT;
4251    
4252     if (info.cmd == ETHTOOL_GRXCLSRLALL) {
4253     if (info.rule_cnt > 0) {
4254     - rule_buf = kmalloc(info.rule_cnt * sizeof(u32),
4255     - GFP_USER);
4256     + if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32))
4257     + rule_buf = kmalloc(info.rule_cnt * sizeof(u32),
4258     + GFP_USER);
4259     if (!rule_buf)
4260     return -ENOMEM;
4261     }
4262     @@ -249,7 +270,7 @@ static int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr)
4263     goto err_out;
4264    
4265     ret = -EFAULT;
4266     - if (copy_to_user(useraddr, &info, sizeof(info)))
4267     + if (copy_to_user(useraddr, &info, info_size))
4268     goto err_out;
4269    
4270     if (rule_buf) {
4271     @@ -1094,12 +1115,12 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
4272     case ETHTOOL_GRXCLSRLCNT:
4273     case ETHTOOL_GRXCLSRULE:
4274     case ETHTOOL_GRXCLSRLALL:
4275     - rc = ethtool_get_rxnfc(dev, useraddr);
4276     + rc = ethtool_get_rxnfc(dev, ethcmd, useraddr);
4277     break;
4278     case ETHTOOL_SRXFH:
4279     case ETHTOOL_SRXCLSRLDEL:
4280     case ETHTOOL_SRXCLSRLINS:
4281     - rc = ethtool_set_rxnfc(dev, useraddr);
4282     + rc = ethtool_set_rxnfc(dev, ethcmd, useraddr);
4283     break;
4284     case ETHTOOL_GGRO:
4285     rc = ethtool_get_gro(dev, useraddr);
4286     diff --git a/net/core/neighbour.c b/net/core/neighbour.c
4287     index f35377b..3fdffe0 100644
4288     --- a/net/core/neighbour.c
4289     +++ b/net/core/neighbour.c
4290     @@ -945,7 +945,10 @@ static void neigh_update_hhs(struct neighbour *neigh)
4291     {
4292     struct hh_cache *hh;
4293     void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
4294     - = neigh->dev->header_ops->cache_update;
4295     + = NULL;
4296     +
4297     + if (neigh->dev->header_ops)
4298     + update = neigh->dev->header_ops->cache_update;
4299    
4300     if (update) {
4301     for (hh = neigh->hh; hh; hh = hh->hh_next) {
4302     diff --git a/net/core/skbuff.c b/net/core/skbuff.c
4303     index 93c4e06..cad8e97 100644
4304     --- a/net/core/skbuff.c
4305     +++ b/net/core/skbuff.c
4306     @@ -2729,6 +2729,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
4307     *NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p);
4308     skb_shinfo(nskb)->frag_list = p;
4309     skb_shinfo(nskb)->gso_size = pinfo->gso_size;
4310     + pinfo->gso_size = 0;
4311     skb_header_release(p);
4312     nskb->prev = p;
4313    
4314     diff --git a/net/dccp/input.c b/net/dccp/input.c
4315     index 7648f31..071b64e 100644
4316     --- a/net/dccp/input.c
4317     +++ b/net/dccp/input.c
4318     @@ -123,9 +123,9 @@ static int dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
4319     return queued;
4320     }
4321    
4322     -static u8 dccp_reset_code_convert(const u8 code)
4323     +static u16 dccp_reset_code_convert(const u8 code)
4324     {
4325     - const u8 error_code[] = {
4326     + const u16 error_code[] = {
4327     [DCCP_RESET_CODE_CLOSED] = 0, /* normal termination */
4328     [DCCP_RESET_CODE_UNSPECIFIED] = 0, /* nothing known */
4329     [DCCP_RESET_CODE_ABORTED] = ECONNRESET,
4330     @@ -147,7 +147,7 @@ static u8 dccp_reset_code_convert(const u8 code)
4331    
4332     static void dccp_rcv_reset(struct sock *sk, struct sk_buff *skb)
4333     {
4334     - u8 err = dccp_reset_code_convert(dccp_hdr_reset(skb)->dccph_reset_code);
4335     + u16 err = dccp_reset_code_convert(dccp_hdr_reset(skb)->dccph_reset_code);
4336    
4337     sk->sk_err = err;
4338    
4339     diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
4340     index c95cd93..d8d2bc6 100644
4341     --- a/net/ipv4/arp.c
4342     +++ b/net/ipv4/arp.c
4343     @@ -619,13 +619,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
4344     #endif
4345     #endif
4346    
4347     -#ifdef CONFIG_FDDI
4348     +#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE)
4349     case ARPHRD_FDDI:
4350     arp->ar_hrd = htons(ARPHRD_ETHER);
4351     arp->ar_pro = htons(ETH_P_IP);
4352     break;
4353     #endif
4354     -#ifdef CONFIG_TR
4355     +#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
4356     case ARPHRD_IEEE802_TR:
4357     arp->ar_hrd = htons(ARPHRD_IEEE802);
4358     arp->ar_pro = htons(ETH_P_IP);
4359     @@ -1005,7 +1005,7 @@ static int arp_req_set(struct net *net, struct arpreq *r,
4360     return -EINVAL;
4361     }
4362     switch (dev->type) {
4363     -#ifdef CONFIG_FDDI
4364     +#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE)
4365     case ARPHRD_FDDI:
4366     /*
4367     * According to RFC 1390, FDDI devices should accept ARP
4368     diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
4369     index 66fd80e..214a2f6 100644
4370     --- a/net/ipv4/syncookies.c
4371     +++ b/net/ipv4/syncookies.c
4372     @@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
4373     { .sport = th->dest,
4374     .dport = th->source } } };
4375     security_req_classify_flow(req, &fl);
4376     - if (ip_route_output_key(&init_net, &rt, &fl)) {
4377     + if (ip_route_output_key(sock_net(sk), &rt, &fl)) {
4378     reqsk_free(req);
4379     goto out;
4380     }
4381     diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
4382     index dc26654..1d04fa0 100644
4383     --- a/net/ipv4/tcp_output.c
4384     +++ b/net/ipv4/tcp_output.c
4385     @@ -659,7 +659,6 @@ static unsigned tcp_synack_options(struct sock *sk,
4386     u8 cookie_plus = (xvp != NULL && !xvp->cookie_out_never) ?
4387     xvp->cookie_plus :
4388     0;
4389     - bool doing_ts = ireq->tstamp_ok;
4390    
4391     #ifdef CONFIG_TCP_MD5SIG
4392     *md5 = tcp_rsk(req)->af_specific->md5_lookup(sk, req);
4393     @@ -672,7 +671,7 @@ static unsigned tcp_synack_options(struct sock *sk,
4394     * rather than TS in order to fit in better with old,
4395     * buggy kernels, but that was deemed to be unnecessary.
4396     */
4397     - doing_ts &= !ireq->sack_ok;
4398     + ireq->tstamp_ok &= !ireq->sack_ok;
4399     }
4400     #else
4401     *md5 = NULL;
4402     @@ -687,7 +686,7 @@ static unsigned tcp_synack_options(struct sock *sk,
4403     opts->options |= OPTION_WSCALE;
4404     remaining -= TCPOLEN_WSCALE_ALIGNED;
4405     }
4406     - if (likely(doing_ts)) {
4407     + if (likely(ireq->tstamp_ok)) {
4408     opts->options |= OPTION_TS;
4409     opts->tsval = TCP_SKB_CB(skb)->when;
4410     opts->tsecr = req->ts_recent;
4411     @@ -695,7 +694,7 @@ static unsigned tcp_synack_options(struct sock *sk,
4412     }
4413     if (likely(ireq->sack_ok)) {
4414     opts->options |= OPTION_SACK_ADVERTISE;
4415     - if (unlikely(!doing_ts))
4416     + if (unlikely(!ireq->tstamp_ok))
4417     remaining -= TCPOLEN_SACKPERM_ALIGNED;
4418     }
4419    
4420     @@ -703,7 +702,7 @@ static unsigned tcp_synack_options(struct sock *sk,
4421     * If the <SYN> options fit, the same options should fit now!
4422     */
4423     if (*md5 == NULL &&
4424     - doing_ts &&
4425     + ireq->tstamp_ok &&
4426     cookie_plus > TCPOLEN_COOKIE_BASE) {
4427     int need = cookie_plus; /* has TCPOLEN_COOKIE_BASE */
4428    
4429     @@ -2204,6 +2203,9 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
4430     int mib_idx;
4431     int fwd_rexmitting = 0;
4432    
4433     + if (!tp->packets_out)
4434     + return;
4435     +
4436     if (!tp->lost_out)
4437     tp->retransmit_high = tp->snd_una;
4438    
4439     diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
4440     index 12e69d3..3c11913 100644
4441     --- a/net/ipv6/af_inet6.c
4442     +++ b/net/ipv6/af_inet6.c
4443     @@ -199,7 +199,7 @@ lookup_protocol:
4444    
4445     inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk);
4446     np->hop_limit = -1;
4447     - np->mcast_hops = -1;
4448     + np->mcast_hops = IPV6_DEFAULT_MCASTHOPS;
4449     np->mc_loop = 1;
4450     np->pmtudisc = IPV6_PMTUDISC_WANT;
4451     np->ipv6only = net->ipv6.sysctl.bindv6only;
4452     diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
4453     index c458527..d6c3652 100644
4454     --- a/net/ipv6/ndisc.c
4455     +++ b/net/ipv6/ndisc.c
4456     @@ -585,6 +585,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
4457     src_addr = solicited_addr;
4458     if (ifp->flags & IFA_F_OPTIMISTIC)
4459     override = 0;
4460     + inc_opt |= ifp->idev->cnf.force_tllao;
4461     in6_ifa_put(ifp);
4462     } else {
4463     if (ipv6_dev_get_saddr(dev_net(dev), dev, daddr,
4464     @@ -598,7 +599,6 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
4465     icmp6h.icmp6_solicited = solicited;
4466     icmp6h.icmp6_override = override;
4467    
4468     - inc_opt |= ifp->idev->cnf.force_tllao;
4469     __ndisc_send(dev, neigh, daddr, src_addr,
4470     &icmp6h, solicited_addr,
4471     inc_opt ? ND_OPT_TARGET_LL_ADDR : 0);
4472     diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
4473     index 8311ca3..35ae554 100644
4474     --- a/net/ipv6/netfilter/ip6t_REJECT.c
4475     +++ b/net/ipv6/netfilter/ip6t_REJECT.c
4476     @@ -95,9 +95,11 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
4477     fl.fl_ip_dport = otcph.source;
4478     security_skb_classify_flow(oldskb, &fl);
4479     dst = ip6_route_output(net, NULL, &fl);
4480     - if (dst == NULL)
4481     + if (dst == NULL || dst->error) {
4482     + dst_release(dst);
4483     return;
4484     - if (dst->error || xfrm_lookup(net, &dst, &fl, NULL, 0))
4485     + }
4486     + if (xfrm_lookup(net, &dst, &fl, NULL, 0))
4487     return;
4488    
4489     hh_len = (dst->dev->hard_header_len + 15)&~15;
4490     diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
4491     index 008de1f..2facbe3 100644
4492     --- a/net/llc/llc_sap.c
4493     +++ b/net/llc/llc_sap.c
4494     @@ -30,7 +30,7 @@ static int llc_mac_header_len(unsigned short devtype)
4495     case ARPHRD_ETHER:
4496     case ARPHRD_LOOPBACK:
4497     return sizeof(struct ethhdr);
4498     -#ifdef CONFIG_TR
4499     +#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
4500     case ARPHRD_IEEE802_TR:
4501     return sizeof(struct trh_hdr);
4502     #endif
4503     diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
4504     index 1a209ac..ecc1e4f 100644
4505     --- a/net/mac80211/mlme.c
4506     +++ b/net/mac80211/mlme.c
4507     @@ -270,12 +270,6 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
4508     if (wk->bss->wmm_used)
4509     wmm = 1;
4510    
4511     - /* get all rates supported by the device and the AP as
4512     - * some APs don't like getting a superset of their rates
4513     - * in the association request (e.g. D-Link DAP 1353 in
4514     - * b-only mode) */
4515     - rates_len = ieee80211_compatible_rates(wk->bss, sband, &rates);
4516     -
4517     if ((wk->bss->cbss.capability & WLAN_CAPABILITY_SPECTRUM_MGMT) &&
4518     (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT))
4519     capab |= WLAN_CAPABILITY_SPECTRUM_MGMT;
4520     @@ -310,6 +304,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
4521     *pos++ = wk->ssid_len;
4522     memcpy(pos, wk->ssid, wk->ssid_len);
4523    
4524     + if (wk->bss->supp_rates_len) {
4525     + /* get all rates supported by the device and the AP as
4526     + * some APs don't like getting a superset of their rates
4527     + * in the association request (e.g. D-Link DAP 1353 in
4528     + * b-only mode) */
4529     + rates_len = ieee80211_compatible_rates(wk->bss, sband, &rates);
4530     + } else {
4531     + rates = ~0;
4532     + rates_len = sband->n_bitrates;
4533     + }
4534     +
4535     /* add all rates which were marked to be used above */
4536     supp_rates_len = rates_len;
4537     if (supp_rates_len > 8)
4538     diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
4539     index 48d8fdf..701e63a 100644
4540     --- a/net/mac80211/rx.c
4541     +++ b/net/mac80211/rx.c
4542     @@ -2023,6 +2023,11 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
4543     return RX_CONTINUE;
4544     }
4545     break;
4546     + case WLAN_CATEGORY_MESH_PLINK:
4547     + case WLAN_CATEGORY_MESH_PATH_SEL:
4548     + if (ieee80211_vif_is_mesh(&sdata->vif))
4549     + return ieee80211_mesh_rx_mgmt(sdata, rx->skb);
4550     + break;
4551     default:
4552     /* do not process rejected action frames */
4553     if (mgmt->u.action.category & 0x80)
4554     diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
4555     index bc17cf7..697dc54 100644
4556     --- a/net/mac80211/scan.c
4557     +++ b/net/mac80211/scan.c
4558     @@ -60,7 +60,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
4559     bool beacon)
4560     {
4561     struct ieee80211_bss *bss;
4562     - int clen;
4563     + int clen, srlen;
4564     s32 signal = 0;
4565    
4566     if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
4567     @@ -92,23 +92,24 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
4568     if (bss->dtim_period == 0)
4569     bss->dtim_period = 1;
4570    
4571     - bss->supp_rates_len = 0;
4572     + /* replace old supported rates if we get new values */
4573     + srlen = 0;
4574     if (elems->supp_rates) {
4575     - clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len;
4576     + clen = IEEE80211_MAX_SUPP_RATES;
4577     if (clen > elems->supp_rates_len)
4578     clen = elems->supp_rates_len;
4579     - memcpy(&bss->supp_rates[bss->supp_rates_len], elems->supp_rates,
4580     - clen);
4581     - bss->supp_rates_len += clen;
4582     + memcpy(bss->supp_rates, elems->supp_rates, clen);
4583     + srlen += clen;
4584     }
4585     if (elems->ext_supp_rates) {
4586     - clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len;
4587     + clen = IEEE80211_MAX_SUPP_RATES - srlen;
4588     if (clen > elems->ext_supp_rates_len)
4589     clen = elems->ext_supp_rates_len;
4590     - memcpy(&bss->supp_rates[bss->supp_rates_len],
4591     - elems->ext_supp_rates, clen);
4592     - bss->supp_rates_len += clen;
4593     + memcpy(bss->supp_rates + srlen, elems->ext_supp_rates, clen);
4594     + srlen += clen;
4595     }
4596     + if (srlen)
4597     + bss->supp_rates_len = srlen;
4598    
4599     bss->wmm_used = elems->wmm_param || elems->wmm_info;
4600    
4601     diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
4602     index 27c30cf..95682e5 100644
4603     --- a/net/netfilter/ipvs/ip_vs_conn.c
4604     +++ b/net/netfilter/ipvs/ip_vs_conn.c
4605     @@ -146,6 +146,7 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
4606     hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
4607    
4608     ct_write_lock(hash);
4609     + spin_lock(&cp->lock);
4610    
4611     if (!(cp->flags & IP_VS_CONN_F_HASHED)) {
4612     list_add(&cp->c_list, &ip_vs_conn_tab[hash]);
4613     @@ -158,6 +159,7 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
4614     ret = 0;
4615     }
4616    
4617     + spin_unlock(&cp->lock);
4618     ct_write_unlock(hash);
4619    
4620     return ret;
4621     @@ -177,6 +179,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
4622     hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
4623    
4624     ct_write_lock(hash);
4625     + spin_lock(&cp->lock);
4626    
4627     if (cp->flags & IP_VS_CONN_F_HASHED) {
4628     list_del(&cp->c_list);
4629     @@ -186,6 +189,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
4630     } else
4631     ret = 0;
4632    
4633     + spin_unlock(&cp->lock);
4634     ct_write_unlock(hash);
4635    
4636     return ret;
4637     diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
4638     index 4df801d..2334279 100644
4639     --- a/net/sunrpc/xprtsock.c
4640     +++ b/net/sunrpc/xprtsock.c
4641     @@ -224,7 +224,8 @@ struct sock_xprt {
4642     * State of TCP reply receive
4643     */
4644     __be32 tcp_fraghdr,
4645     - tcp_xid;
4646     + tcp_xid,
4647     + tcp_calldir;
4648    
4649     u32 tcp_offset,
4650     tcp_reclen;
4651     @@ -947,7 +948,7 @@ static inline void xs_tcp_read_calldir(struct sock_xprt *transport,
4652     {
4653     size_t len, used;
4654     u32 offset;
4655     - __be32 calldir;
4656     + char *p;
4657    
4658     /*
4659     * We want transport->tcp_offset to be 8 at the end of this routine
4660     @@ -956,26 +957,33 @@ static inline void xs_tcp_read_calldir(struct sock_xprt *transport,
4661     * transport->tcp_offset is 4 (after having already read the xid).
4662     */
4663     offset = transport->tcp_offset - sizeof(transport->tcp_xid);
4664     - len = sizeof(calldir) - offset;
4665     + len = sizeof(transport->tcp_calldir) - offset;
4666     dprintk("RPC: reading CALL/REPLY flag (%Zu bytes)\n", len);
4667     - used = xdr_skb_read_bits(desc, &calldir, len);
4668     + p = ((char *) &transport->tcp_calldir) + offset;
4669     + used = xdr_skb_read_bits(desc, p, len);
4670     transport->tcp_offset += used;
4671     if (used != len)
4672     return;
4673     transport->tcp_flags &= ~TCP_RCV_READ_CALLDIR;
4674     - transport->tcp_flags |= TCP_RCV_COPY_CALLDIR;
4675     - transport->tcp_flags |= TCP_RCV_COPY_DATA;
4676     /*
4677     * We don't yet have the XDR buffer, so we will write the calldir
4678     * out after we get the buffer from the 'struct rpc_rqst'
4679     */
4680     - if (ntohl(calldir) == RPC_REPLY)
4681     + switch (ntohl(transport->tcp_calldir)) {
4682     + case RPC_REPLY:
4683     + transport->tcp_flags |= TCP_RCV_COPY_CALLDIR;
4684     + transport->tcp_flags |= TCP_RCV_COPY_DATA;
4685     transport->tcp_flags |= TCP_RPC_REPLY;
4686     - else
4687     + break;
4688     + case RPC_CALL:
4689     + transport->tcp_flags |= TCP_RCV_COPY_CALLDIR;
4690     + transport->tcp_flags |= TCP_RCV_COPY_DATA;
4691     transport->tcp_flags &= ~TCP_RPC_REPLY;
4692     - dprintk("RPC: reading %s CALL/REPLY flag %08x\n",
4693     - (transport->tcp_flags & TCP_RPC_REPLY) ?
4694     - "reply for" : "request with", calldir);
4695     + break;
4696     + default:
4697     + dprintk("RPC: invalid request message type\n");
4698     + xprt_force_disconnect(&transport->xprt);
4699     + }
4700     xs_tcp_check_fraghdr(transport);
4701     }
4702    
4703     @@ -995,12 +1003,10 @@ static inline void xs_tcp_read_common(struct rpc_xprt *xprt,
4704     /*
4705     * Save the RPC direction in the XDR buffer
4706     */
4707     - __be32 calldir = transport->tcp_flags & TCP_RPC_REPLY ?
4708     - htonl(RPC_REPLY) : 0;
4709     -
4710     memcpy(rcvbuf->head[0].iov_base + transport->tcp_copied,
4711     - &calldir, sizeof(calldir));
4712     - transport->tcp_copied += sizeof(calldir);
4713     + &transport->tcp_calldir,
4714     + sizeof(transport->tcp_calldir));
4715     + transport->tcp_copied += sizeof(transport->tcp_calldir);
4716     transport->tcp_flags &= ~TCP_RCV_COPY_CALLDIR;
4717     }
4718    
4719     diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
4720     index 2092361..17c95a3 100644
4721     --- a/scripts/mod/modpost.c
4722     +++ b/scripts/mod/modpost.c
4723     @@ -1318,7 +1318,7 @@ static unsigned int *reloc_location(struct elf_info *elf,
4724     int section = sechdr->sh_info;
4725    
4726     return (void *)elf->hdr + sechdrs[section].sh_offset +
4727     - (r->r_offset - sechdrs[section].sh_addr);
4728     + r->r_offset - sechdrs[section].sh_addr;
4729     }
4730    
4731     static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
4732     diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
4733     index 1305f7c..641d7f0 100644
4734     --- a/sound/pci/echoaudio/echoaudio.c
4735     +++ b/sound/pci/echoaudio/echoaudio.c
4736     @@ -1821,7 +1821,9 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id)
4737     /* The hardware doesn't tell us which substream caused the irq,
4738     thus we have to check all running substreams. */
4739     for (ss = 0; ss < DSP_MAXPIPES; ss++) {
4740     - if ((substream = chip->substream[ss])) {
4741     + substream = chip->substream[ss];
4742     + if (substream && ((struct audiopipe *)substream->runtime->
4743     + private_data)->state == PIPE_STATE_STARTED) {
4744     period = pcm_pointer(substream) /
4745     substream->runtime->period_size;
4746     if (period != chip->last_period[ss]) {
4747     diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
4748     index 187a467..dea03d9 100644
4749     --- a/sound/pci/hda/patch_realtek.c
4750     +++ b/sound/pci/hda/patch_realtek.c
4751     @@ -9122,6 +9122,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
4752     SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
4753     SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
4754     SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
4755     + SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
4756     /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
4757     * so apparently no perfect solution yet
4758     */
4759     diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
4760     index ab2c0da..ae54f7e 100644
4761     --- a/sound/soc/codecs/wm8776.c
4762     +++ b/sound/soc/codecs/wm8776.c
4763     @@ -93,7 +93,6 @@ SOC_DAPM_SINGLE("Bypass Switch", WM8776_OUTMUX, 2, 1, 0),
4764    
4765     static const struct snd_soc_dapm_widget wm8776_dapm_widgets[] = {
4766     SND_SOC_DAPM_INPUT("AUX"),
4767     -SND_SOC_DAPM_INPUT("AUX"),
4768    
4769     SND_SOC_DAPM_INPUT("AIN1"),
4770     SND_SOC_DAPM_INPUT("AIN2"),
4771     diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
4772     index ad4626d..1b7a389 100644
4773     --- a/tools/perf/util/callchain.h
4774     +++ b/tools/perf/util/callchain.h
4775     @@ -48,6 +48,9 @@ static inline void callchain_init(struct callchain_node *node)
4776     INIT_LIST_HEAD(&node->brothers);
4777     INIT_LIST_HEAD(&node->children);
4778     INIT_LIST_HEAD(&node->val);
4779     +
4780     + node->parent = NULL;
4781     + node->hit = 0;
4782     }
4783    
4784     static inline u64 cumul_hits(struct callchain_node *node)
4785     diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
4786     index 38a2d20..fc4a7e3 100644
4787     --- a/virt/kvm/ioapic.c
4788     +++ b/virt/kvm/ioapic.c
4789     @@ -177,12 +177,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
4790    
4791     int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
4792     {
4793     - u32 old_irr = ioapic->irr;
4794     + u32 old_irr;
4795     u32 mask = 1 << irq;
4796     union kvm_ioapic_redirect_entry entry;
4797     int ret = 1;
4798    
4799     mutex_lock(&ioapic->lock);
4800     + old_irr = ioapic->irr;
4801     if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
4802     entry = ioapic->redirtbl[irq];
4803     level ^= entry.fields.polarity;