/[linux-patches]/genpatches-2.6/tags/3.0-30/1012_linux-3.0.13.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1012_linux-3.0.13.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years, 2 months ago) by mpagano
File size: 85654 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 993fe05..5ccc962 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 12
9 +SUBLEVEL = 13
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
14 index 91c84cb..2456bad 100644
15 --- a/arch/arm/Kconfig
16 +++ b/arch/arm/Kconfig
17 @@ -1312,6 +1312,18 @@ config ARM_ERRATA_764369
18 relevant cache maintenance functions and sets a specific bit
19 in the diagnostic control register of the SCU.
20
21 +config PL310_ERRATA_769419
22 + bool "PL310 errata: no automatic Store Buffer drain"
23 + depends on CACHE_L2X0
24 + help
25 + On revisions of the PL310 prior to r3p2, the Store Buffer does
26 + not automatically drain. This can cause normal, non-cacheable
27 + writes to be retained when the memory system is idle, leading
28 + to suboptimal I/O performance for drivers using coherent DMA.
29 + This option adds a write barrier to the cpu_idle loop so that,
30 + on systems with an outer cache, the store buffer is drained
31 + explicitly.
32 +
33 endmenu
34
35 menu "Kernel Features"
36 diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
37 index 227a477..d95763d 100644
38 --- a/arch/arm/configs/ezx_defconfig
39 +++ b/arch/arm/configs/ezx_defconfig
40 @@ -287,7 +287,7 @@ CONFIG_USB=y
41 # CONFIG_USB_DEVICE_CLASS is not set
42 CONFIG_USB_OHCI_HCD=y
43 CONFIG_USB_GADGET=y
44 -CONFIG_USB_GADGET_PXA27X=y
45 +CONFIG_USB_PXA27X=y
46 CONFIG_USB_ETH=m
47 # CONFIG_USB_ETH_RNDIS is not set
48 CONFIG_MMC=y
49 diff --git a/arch/arm/configs/imote2_defconfig b/arch/arm/configs/imote2_defconfig
50 index 176ec22..fd996bb 100644
51 --- a/arch/arm/configs/imote2_defconfig
52 +++ b/arch/arm/configs/imote2_defconfig
53 @@ -263,7 +263,7 @@ CONFIG_USB=y
54 # CONFIG_USB_DEVICE_CLASS is not set
55 CONFIG_USB_OHCI_HCD=y
56 CONFIG_USB_GADGET=y
57 -CONFIG_USB_GADGET_PXA27X=y
58 +CONFIG_USB_PXA27X=y
59 CONFIG_USB_ETH=m
60 # CONFIG_USB_ETH_RNDIS is not set
61 CONFIG_MMC=y
62 diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
63 index a88e64d..443675d 100644
64 --- a/arch/arm/configs/magician_defconfig
65 +++ b/arch/arm/configs/magician_defconfig
66 @@ -132,7 +132,7 @@ CONFIG_USB_MON=m
67 CONFIG_USB_OHCI_HCD=y
68 CONFIG_USB_GADGET=y
69 CONFIG_USB_GADGET_VBUS_DRAW=500
70 -CONFIG_USB_GADGET_PXA27X=y
71 +CONFIG_USB_PXA27X=y
72 CONFIG_USB_ETH=m
73 # CONFIG_USB_ETH_RNDIS is not set
74 CONFIG_USB_GADGETFS=m
75 diff --git a/arch/arm/configs/zeus_defconfig b/arch/arm/configs/zeus_defconfig
76 index 59577ad..547a3c1 100644
77 --- a/arch/arm/configs/zeus_defconfig
78 +++ b/arch/arm/configs/zeus_defconfig
79 @@ -140,7 +140,7 @@ CONFIG_USB_SERIAL=m
80 CONFIG_USB_SERIAL_GENERIC=y
81 CONFIG_USB_SERIAL_MCT_U232=m
82 CONFIG_USB_GADGET=m
83 -CONFIG_USB_GADGET_PXA27X=y
84 +CONFIG_USB_PXA27X=y
85 CONFIG_USB_ETH=m
86 CONFIG_USB_GADGETFS=m
87 CONFIG_USB_FILE_STORAGE=m
88 diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
89 index 5e1e541..74ae833 100644
90 --- a/arch/arm/kernel/process.c
91 +++ b/arch/arm/kernel/process.c
92 @@ -191,6 +191,9 @@ void cpu_idle(void)
93 #endif
94
95 local_irq_disable();
96 +#ifdef CONFIG_PL310_ERRATA_769419
97 + wmb();
98 +#endif
99 if (hlt_counter) {
100 local_irq_enable();
101 cpu_relax();
102 diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
103 index 5dcc59d..b3a7124 100644
104 --- a/arch/arm/mach-mxs/clock-mx28.c
105 +++ b/arch/arm/mach-mxs/clock-mx28.c
106 @@ -404,7 +404,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
107 reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \
108 reg &= ~BM_CLKCTRL_##dr##_DIV; \
109 reg |= div << BP_CLKCTRL_##dr##_DIV; \
110 - if (reg | (1 << clk->enable_shift)) { \
111 + if (reg & (1 << clk->enable_shift)) { \
112 pr_err("%s: clock is gated\n", __func__); \
113 return -EINVAL; \
114 } \
115 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
116 index 19d5891..841ae21 100644
117 --- a/arch/arm/mach-omap2/Kconfig
118 +++ b/arch/arm/mach-omap2/Kconfig
119 @@ -326,6 +326,7 @@ config MACH_OMAP4_PANDA
120 config OMAP3_EMU
121 bool "OMAP3 debugging peripherals"
122 depends on ARCH_OMAP3
123 + select ARM_AMBA
124 select OC_ETM
125 help
126 Say Y here to enable debugging hardware of omap3
127 diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
128 index fb7dc52..f5a6bc1 100644
129 --- a/arch/arm/mach-omap2/smartreflex.c
130 +++ b/arch/arm/mach-omap2/smartreflex.c
131 @@ -137,7 +137,7 @@ static irqreturn_t sr_interrupt(int irq, void *data)
132 sr_write_reg(sr_info, ERRCONFIG_V1, status);
133 } else if (sr_info->ip_type == SR_TYPE_V2) {
134 /* Read the status bits */
135 - sr_read_reg(sr_info, IRQSTATUS);
136 + status = sr_read_reg(sr_info, IRQSTATUS);
137
138 /* Clear them by writing back */
139 sr_write_reg(sr_info, IRQSTATUS, status);
140 diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
141 index 810a982..6ca327d 100644
142 --- a/arch/arm/mach-pxa/balloon3.c
143 +++ b/arch/arm/mach-pxa/balloon3.c
144 @@ -307,7 +307,7 @@ static inline void balloon3_mmc_init(void) {}
145 /******************************************************************************
146 * USB Gadget
147 ******************************************************************************/
148 -#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
149 +#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
150 static void balloon3_udc_command(int cmd)
151 {
152 if (cmd == PXA2XX_UDC_CMD_CONNECT)
153 diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
154 index ff9ff5f..fdf611c 100644
155 --- a/arch/arm/mach-pxa/colibri-pxa320.c
156 +++ b/arch/arm/mach-pxa/colibri-pxa320.c
157 @@ -147,7 +147,7 @@ static void __init colibri_pxa320_init_eth(void)
158 static inline void __init colibri_pxa320_init_eth(void) {}
159 #endif /* CONFIG_AX88796 */
160
161 -#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
162 +#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
163 static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
164 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96),
165 .gpio_pullup = -1,
166 diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
167 index d65e4bd..b9e8233 100644
168 --- a/arch/arm/mach-pxa/gumstix.c
169 +++ b/arch/arm/mach-pxa/gumstix.c
170 @@ -106,7 +106,7 @@ static void __init gumstix_mmc_init(void)
171 }
172 #endif
173
174 -#ifdef CONFIG_USB_GADGET_PXA25X
175 +#ifdef CONFIG_USB_PXA25X
176 static struct gpio_vbus_mach_info gumstix_udc_info = {
177 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn,
178 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx,
179 diff --git a/arch/arm/mach-pxa/include/mach/palm27x.h b/arch/arm/mach-pxa/include/mach/palm27x.h
180 index 0a5e5ea..8d56043 100644
181 --- a/arch/arm/mach-pxa/include/mach/palm27x.h
182 +++ b/arch/arm/mach-pxa/include/mach/palm27x.h
183 @@ -37,8 +37,8 @@ extern void __init palm27x_lcd_init(int power,
184 static inline void palm27x_lcd_init(int power, struct pxafb_mode_info *mode) {}
185 #endif
186
187 -#if defined(CONFIG_USB_GADGET_PXA27X) || \
188 - defined(CONFIG_USB_GADGET_PXA27X_MODULE)
189 +#if defined(CONFIG_USB_PXA27X) || \
190 + defined(CONFIG_USB_PXA27X_MODULE)
191 extern void __init palm27x_udc_init(int vbus, int pullup,
192 int vbus_inverted);
193 #else
194 diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
195 index 325c245..fbc10d7 100644
196 --- a/arch/arm/mach-pxa/palm27x.c
197 +++ b/arch/arm/mach-pxa/palm27x.c
198 @@ -164,8 +164,8 @@ void __init palm27x_lcd_init(int power, struct pxafb_mode_info *mode)
199 /******************************************************************************
200 * USB Gadget
201 ******************************************************************************/
202 -#if defined(CONFIG_USB_GADGET_PXA27X) || \
203 - defined(CONFIG_USB_GADGET_PXA27X_MODULE)
204 +#if defined(CONFIG_USB_PXA27X) || \
205 + defined(CONFIG_USB_PXA27X_MODULE)
206 static struct gpio_vbus_mach_info palm27x_udc_info = {
207 .gpio_vbus_inverted = 1,
208 };
209 diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
210 index fb06bd0..5193ce2 100644
211 --- a/arch/arm/mach-pxa/palmtc.c
212 +++ b/arch/arm/mach-pxa/palmtc.c
213 @@ -339,7 +339,7 @@ static inline void palmtc_mkp_init(void) {}
214 /******************************************************************************
215 * UDC
216 ******************************************************************************/
217 -#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE)
218 +#if defined(CONFIG_USB_PXA25X)||defined(CONFIG_USB_PXA25X_MODULE)
219 static struct gpio_vbus_mach_info palmtc_udc_info = {
220 .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N,
221 .gpio_vbus_inverted = 1,
222 diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
223 index 67bd414..10b80d4 100644
224 --- a/arch/arm/mach-pxa/vpac270.c
225 +++ b/arch/arm/mach-pxa/vpac270.c
226 @@ -343,7 +343,7 @@ static inline void vpac270_uhc_init(void) {}
227 /******************************************************************************
228 * USB Gadget
229 ******************************************************************************/
230 -#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
231 +#if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
232 static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
233 .gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
234 .gpio_pullup = -1,
235 diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
236 index ae0e14b..5804cfa 100644
237 --- a/arch/s390/kernel/ptrace.c
238 +++ b/arch/s390/kernel/ptrace.c
239 @@ -897,6 +897,14 @@ static int s390_last_break_get(struct task_struct *target,
240 return 0;
241 }
242
243 +static int s390_last_break_set(struct task_struct *target,
244 + const struct user_regset *regset,
245 + unsigned int pos, unsigned int count,
246 + const void *kbuf, const void __user *ubuf)
247 +{
248 + return 0;
249 +}
250 +
251 #endif
252
253 static const struct user_regset s390_regsets[] = {
254 @@ -923,6 +931,7 @@ static const struct user_regset s390_regsets[] = {
255 .size = sizeof(long),
256 .align = sizeof(long),
257 .get = s390_last_break_get,
258 + .set = s390_last_break_set,
259 },
260 #endif
261 };
262 @@ -1080,6 +1089,14 @@ static int s390_compat_last_break_get(struct task_struct *target,
263 return 0;
264 }
265
266 +static int s390_compat_last_break_set(struct task_struct *target,
267 + const struct user_regset *regset,
268 + unsigned int pos, unsigned int count,
269 + const void *kbuf, const void __user *ubuf)
270 +{
271 + return 0;
272 +}
273 +
274 static const struct user_regset s390_compat_regsets[] = {
275 [REGSET_GENERAL] = {
276 .core_note_type = NT_PRSTATUS,
277 @@ -1103,6 +1120,7 @@ static const struct user_regset s390_compat_regsets[] = {
278 .size = sizeof(long),
279 .align = sizeof(long),
280 .get = s390_compat_last_break_get,
281 + .set = s390_compat_last_break_set,
282 },
283 [REGSET_GENERAL_EXTENDED] = {
284 .core_note_type = NT_S390_HIGH_GPRS,
285 diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
286 index fa7b917..431793e 100644
287 --- a/arch/x86/include/asm/timer.h
288 +++ b/arch/x86/include/asm/timer.h
289 @@ -32,6 +32,22 @@ extern int no_timer_check;
290 * (mathieu.desnoyers@polymtl.ca)
291 *
292 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
293 + *
294 + * In:
295 + *
296 + * ns = cycles * cyc2ns_scale / SC
297 + *
298 + * Although we may still have enough bits to store the value of ns,
299 + * in some cases, we may not have enough bits to store cycles * cyc2ns_scale,
300 + * leading to an incorrect result.
301 + *
302 + * To avoid this, we can decompose 'cycles' into quotient and remainder
303 + * of division by SC. Then,
304 + *
305 + * ns = (quot * SC + rem) * cyc2ns_scale / SC
306 + * = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC
307 + *
308 + * - sqazi@google.com
309 */
310
311 DECLARE_PER_CPU(unsigned long, cyc2ns);
312 @@ -41,9 +57,14 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);
313
314 static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
315 {
316 + unsigned long long quot;
317 + unsigned long long rem;
318 int cpu = smp_processor_id();
319 unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
320 - ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR;
321 + quot = (cyc >> CYC2NS_SCALE_FACTOR);
322 + rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
323 + ns += quot * per_cpu(cyc2ns, cpu) +
324 + ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
325 return ns;
326 }
327
328 diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
329 index bab491b..d812fe2 100644
330 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
331 +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
332 @@ -508,6 +508,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
333 unsigned long from = cpuc->lbr_entries[0].from;
334 unsigned long old_to, to = cpuc->lbr_entries[0].to;
335 unsigned long ip = regs->ip;
336 + int is_64bit = 0;
337
338 /*
339 * We don't need to fixup if the PEBS assist is fault like
340 @@ -559,7 +560,10 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
341 } else
342 kaddr = (void *)to;
343
344 - kernel_insn_init(&insn, kaddr);
345 +#ifdef CONFIG_X86_64
346 + is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32);
347 +#endif
348 + insn_init(&insn, kaddr, is_64bit);
349 insn_get_length(&insn);
350 to += insn.length;
351 } while (to < ip);
352 diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
353 index 9103b89..0741b062 100644
354 --- a/arch/x86/kernel/mpparse.c
355 +++ b/arch/x86/kernel/mpparse.c
356 @@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_bus *m)
357 }
358 #endif
359
360 + set_bit(m->busid, mp_bus_not_pci);
361 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
362 - set_bit(m->busid, mp_bus_not_pci);
363 #if defined(CONFIG_EISA) || defined(CONFIG_MCA)
364 mp_bus_id_to_type[m->busid] = MP_BUS_ISA;
365 #endif
366 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
367 index 9242436..d4a705f 100644
368 --- a/arch/x86/kernel/reboot.c
369 +++ b/arch/x86/kernel/reboot.c
370 @@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup);
371 */
372
373 /*
374 - * Some machines require the "reboot=b" commandline option,
375 + * Some machines require the "reboot=b" or "reboot=k" commandline options,
376 * this quirk makes that automatic.
377 */
378 static int __init set_bios_reboot(const struct dmi_system_id *d)
379 @@ -136,6 +136,15 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
380 return 0;
381 }
382
383 +static int __init set_kbd_reboot(const struct dmi_system_id *d)
384 +{
385 + if (reboot_type != BOOT_KBD) {
386 + reboot_type = BOOT_KBD;
387 + printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident);
388 + }
389 + return 0;
390 +}
391 +
392 static struct dmi_system_id __initdata reboot_dmi_table[] = {
393 { /* Handle problems with rebooting on Dell E520's */
394 .callback = set_bios_reboot,
395 @@ -295,7 +304,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
396 },
397 },
398 { /* Handle reboot issue on Acer Aspire one */
399 - .callback = set_bios_reboot,
400 + .callback = set_kbd_reboot,
401 .ident = "Acer Aspire One A110",
402 .matches = {
403 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
404 diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
405 index b499626..f4f29b1 100644
406 --- a/arch/x86/mm/highmem_32.c
407 +++ b/arch/x86/mm/highmem_32.c
408 @@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
409 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
410 BUG_ON(!pte_none(*(kmap_pte-idx)));
411 set_pte(kmap_pte-idx, mk_pte(page, prot));
412 + arch_flush_lazy_mmu_mode();
413
414 return (void *)vaddr;
415 }
416 @@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr)
417 */
418 kpte_clear_flush(kmap_pte-idx, vaddr);
419 kmap_atomic_idx_pop();
420 + arch_flush_lazy_mmu_mode();
421 }
422 #ifdef CONFIG_DEBUG_HIGHMEM
423 else {
424 diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c
425 index cdfe4c5..f148cf6 100644
426 --- a/arch/x86/oprofile/init.c
427 +++ b/arch/x86/oprofile/init.c
428 @@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct oprofile_operations *ops);
429 extern void op_nmi_exit(void);
430 extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
431
432 +static int nmi_timer;
433
434 int __init oprofile_arch_init(struct oprofile_operations *ops)
435 {
436 @@ -31,8 +32,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
437 #ifdef CONFIG_X86_LOCAL_APIC
438 ret = op_nmi_init(ops);
439 #endif
440 + nmi_timer = (ret != 0);
441 #ifdef CONFIG_X86_IO_APIC
442 - if (ret < 0)
443 + if (nmi_timer)
444 ret = op_nmi_timer_init(ops);
445 #endif
446 ops->backtrace = x86_backtrace;
447 @@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
448 void oprofile_arch_exit(void)
449 {
450 #ifdef CONFIG_X86_LOCAL_APIC
451 - op_nmi_exit();
452 + if (!nmi_timer)
453 + op_nmi_exit();
454 #endif
455 }
456 diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
457 index 3cf303e..38a3297 100644
458 --- a/drivers/crypto/mv_cesa.c
459 +++ b/drivers/crypto/mv_cesa.c
460 @@ -342,11 +342,13 @@ static void mv_process_hash_current(int first_block)
461 else
462 op.config |= CFG_MID_FRAG;
463
464 - writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
465 - writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
466 - writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
467 - writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
468 - writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
469 + if (first_block) {
470 + writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
471 + writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
472 + writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
473 + writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
474 + writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
475 + }
476 }
477
478 memcpy(cpg->sram + SRAM_CONFIG, &op, sizeof(struct sec_accel_config));
479 diff --git a/drivers/firmware/sigma.c b/drivers/firmware/sigma.c
480 index f10fc52..1eedb6f 100644
481 --- a/drivers/firmware/sigma.c
482 +++ b/drivers/firmware/sigma.c
483 @@ -14,13 +14,34 @@
484 #include <linux/module.h>
485 #include <linux/sigma.h>
486
487 -/* Return: 0==OK, <0==error, =1 ==no more actions */
488 +static size_t sigma_action_size(struct sigma_action *sa)
489 +{
490 + size_t payload = 0;
491 +
492 + switch (sa->instr) {
493 + case SIGMA_ACTION_WRITEXBYTES:
494 + case SIGMA_ACTION_WRITESINGLE:
495 + case SIGMA_ACTION_WRITESAFELOAD:
496 + payload = sigma_action_len(sa);
497 + break;
498 + default:
499 + break;
500 + }
501 +
502 + payload = ALIGN(payload, 2);
503 +
504 + return payload + sizeof(struct sigma_action);
505 +}
506 +
507 +/*
508 + * Returns a negative error value in case of an error, 0 if processing of
509 + * the firmware should be stopped after this action, 1 otherwise.
510 + */
511 static int
512 -process_sigma_action(struct i2c_client *client, struct sigma_firmware *ssfw)
513 +process_sigma_action(struct i2c_client *client, struct sigma_action *sa)
514 {
515 - struct sigma_action *sa = (void *)(ssfw->fw->data + ssfw->pos);
516 size_t len = sigma_action_len(sa);
517 - int ret = 0;
518 + int ret;
519
520 pr_debug("%s: instr:%i addr:%#x len:%zu\n", __func__,
521 sa->instr, sa->addr, len);
522 @@ -29,44 +50,50 @@ process_sigma_action(struct i2c_client *client, struct sigma_firmware *ssfw)
523 case SIGMA_ACTION_WRITEXBYTES:
524 case SIGMA_ACTION_WRITESINGLE:
525 case SIGMA_ACTION_WRITESAFELOAD:
526 - if (ssfw->fw->size < ssfw->pos + len)
527 - return -EINVAL;
528 ret = i2c_master_send(client, (void *)&sa->addr, len);
529 if (ret < 0)
530 return -EINVAL;
531 break;
532 -
533 case SIGMA_ACTION_DELAY:
534 - ret = 0;
535 udelay(len);
536 len = 0;
537 break;
538 -
539 case SIGMA_ACTION_END:
540 - return 1;
541 -
542 + return 0;
543 default:
544 return -EINVAL;
545 }
546
547 - /* when arrive here ret=0 or sent data */
548 - ssfw->pos += sigma_action_size(sa, len);
549 - return ssfw->pos == ssfw->fw->size;
550 + return 1;
551 }
552
553 static int
554 process_sigma_actions(struct i2c_client *client, struct sigma_firmware *ssfw)
555 {
556 - pr_debug("%s: processing %p\n", __func__, ssfw);
557 + struct sigma_action *sa;
558 + size_t size;
559 + int ret;
560 +
561 + while (ssfw->pos + sizeof(*sa) <= ssfw->fw->size) {
562 + sa = (struct sigma_action *)(ssfw->fw->data + ssfw->pos);
563 +
564 + size = sigma_action_size(sa);
565 + ssfw->pos += size;
566 + if (ssfw->pos > ssfw->fw->size || size == 0)
567 + break;
568 +
569 + ret = process_sigma_action(client, sa);
570
571 - while (1) {
572 - int ret = process_sigma_action(client, ssfw);
573 pr_debug("%s: action returned %i\n", __func__, ret);
574 - if (ret == 1)
575 - return 0;
576 - else if (ret)
577 +
578 + if (ret <= 0)
579 return ret;
580 }
581 +
582 + if (ssfw->pos != ssfw->fw->size)
583 + return -EINVAL;
584 +
585 + return 0;
586 }
587
588 int process_sigma_firmware(struct i2c_client *client, const char *name)
589 @@ -89,16 +116,24 @@ int process_sigma_firmware(struct i2c_client *client, const char *name)
590
591 /* then verify the header */
592 ret = -EINVAL;
593 - if (fw->size < sizeof(*ssfw_head))
594 +
595 + /*
596 + * Reject too small or unreasonable large files. The upper limit has been
597 + * chosen a bit arbitrarily, but it should be enough for all practical
598 + * purposes and having the limit makes it easier to avoid integer
599 + * overflows later in the loading process.
600 + */
601 + if (fw->size < sizeof(*ssfw_head) || fw->size >= 0x4000000)
602 goto done;
603
604 ssfw_head = (void *)fw->data;
605 if (memcmp(ssfw_head->magic, SIGMA_MAGIC, ARRAY_SIZE(ssfw_head->magic)))
606 goto done;
607
608 - crc = crc32(0, fw->data, fw->size);
609 + crc = crc32(0, fw->data + sizeof(*ssfw_head),
610 + fw->size - sizeof(*ssfw_head));
611 pr_debug("%s: crc=%x\n", __func__, crc);
612 - if (crc != ssfw_head->crc)
613 + if (crc != le32_to_cpu(ssfw_head->crc))
614 goto done;
615
616 ssfw.pos = sizeof(*ssfw_head);
617 diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
618 index 82db185..1367ced 100644
619 --- a/drivers/gpu/drm/drm_crtc.c
620 +++ b/drivers/gpu/drm/drm_crtc.c
621 @@ -1866,6 +1866,10 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
622 }
623
624 if (num_clips && clips_ptr) {
625 + if (num_clips < 0 || num_clips > DRM_MODE_FB_DIRTY_MAX_CLIPS) {
626 + ret = -EINVAL;
627 + goto out_err1;
628 + }
629 clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);
630 if (!clips) {
631 ret = -ENOMEM;
632 diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
633 index 9b1d669..3635647 100644
634 --- a/drivers/gpu/drm/i915/i915_irq.c
635 +++ b/drivers/gpu/drm/i915/i915_irq.c
636 @@ -820,6 +820,7 @@ static void i915_gem_record_fences(struct drm_device *dev,
637
638 /* Fences */
639 switch (INTEL_INFO(dev)->gen) {
640 + case 7:
641 case 6:
642 for (i = 0; i < 16; i++)
643 error->fence[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
644 diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
645 index 8936d40..673f0d2 100644
646 --- a/drivers/gpu/drm/i915/i915_reg.h
647 +++ b/drivers/gpu/drm/i915/i915_reg.h
648 @@ -3370,6 +3370,10 @@
649
650 #define GT_FIFO_FREE_ENTRIES 0x120008
651
652 +#define GEN6_UCGCTL2 0x9404
653 +# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
654 +# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
655 +
656 #define GEN6_RPNSWREQ 0xA008
657 #define GEN6_TURBO_DISABLE (1<<31)
658 #define GEN6_FREQUENCY(x) ((x)<<25)
659 diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
660 index 27693c0..cf15533 100644
661 --- a/drivers/gpu/drm/i915/i915_suspend.c
662 +++ b/drivers/gpu/drm/i915/i915_suspend.c
663 @@ -370,6 +370,7 @@ static void i915_save_modeset_reg(struct drm_device *dev)
664
665 /* Fences */
666 switch (INTEL_INFO(dev)->gen) {
667 + case 7:
668 case 6:
669 for (i = 0; i < 16; i++)
670 dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
671 @@ -404,6 +405,7 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
672
673 /* Fences */
674 switch (INTEL_INFO(dev)->gen) {
675 + case 7:
676 case 6:
677 for (i = 0; i < 16; i++)
678 I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]);
679 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
680 index 853bddb..fed87d6 100644
681 --- a/drivers/gpu/drm/i915/intel_display.c
682 +++ b/drivers/gpu/drm/i915/intel_display.c
683 @@ -4972,7 +4972,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
684 } else if (is_sdvo && is_tv)
685 factor = 20;
686
687 - if (clock.m1 < factor * clock.n)
688 + if (clock.m < factor * clock.n)
689 fp |= FP_CB_TUNE;
690
691 dpll = 0;
692 @@ -7405,6 +7405,20 @@ static void gen6_init_clock_gating(struct drm_device *dev)
693 I915_WRITE(WM2_LP_ILK, 0);
694 I915_WRITE(WM1_LP_ILK, 0);
695
696 + /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
697 + * gating disable must be set. Failure to set it results in
698 + * flickering pixels due to Z write ordering failures after
699 + * some amount of runtime in the Mesa "fire" demo, and Unigine
700 + * Sanctuary and Tropics, and apparently anything else with
701 + * alpha test or pixel discard.
702 + *
703 + * According to the spec, bit 11 (RCCUNIT) must also be set,
704 + * but we didn't debug actual testcases to find it out.
705 + */
706 + I915_WRITE(GEN6_UCGCTL2,
707 + GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
708 + GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
709 +
710 /*
711 * According to the spec the following bits should be
712 * set in order to enable memory self-refresh and fbc:
713 diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
714 index f1bdb58..21c5aa0 100644
715 --- a/drivers/gpu/drm/radeon/evergreen.c
716 +++ b/drivers/gpu/drm/radeon/evergreen.c
717 @@ -82,6 +82,7 @@ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
718 {
719 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
720 u32 tmp = RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset);
721 + int i;
722
723 /* Lock the graphics update lock */
724 tmp |= EVERGREEN_GRPH_UPDATE_LOCK;
725 @@ -99,7 +100,11 @@ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
726 (u32)crtc_base);
727
728 /* Wait for update_pending to go high. */
729 - while (!(RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset) & EVERGREEN_GRPH_SURFACE_UPDATE_PENDING));
730 + for (i = 0; i < rdev->usec_timeout; i++) {
731 + if (RREG32(EVERGREEN_GRPH_UPDATE + radeon_crtc->crtc_offset) & EVERGREEN_GRPH_SURFACE_UPDATE_PENDING)
732 + break;
733 + udelay(1);
734 + }
735 DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
736
737 /* Unlock the lock, so double-buffering can take place inside vblank */
738 diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
739 index c9a0dae..b94d871 100644
740 --- a/drivers/gpu/drm/radeon/r100.c
741 +++ b/drivers/gpu/drm/radeon/r100.c
742 @@ -84,13 +84,18 @@ u32 r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
743 {
744 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
745 u32 tmp = ((u32)crtc_base) | RADEON_CRTC_OFFSET__OFFSET_LOCK;
746 + int i;
747
748 /* Lock the graphics update lock */
749 /* update the scanout addresses */
750 WREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, tmp);
751
752 /* Wait for update_pending to go high. */
753 - while (!(RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET));
754 + for (i = 0; i < rdev->usec_timeout; i++) {
755 + if (RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET)
756 + break;
757 + udelay(1);
758 + }
759 DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
760
761 /* Unlock the lock, so double-buffering can take place inside vblank */
762 diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
763 index bf2b615..285acc4 100644
764 --- a/drivers/gpu/drm/radeon/radeon_atombios.c
765 +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
766 @@ -85,6 +85,18 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev
767 for (i = 0; i < num_indices; i++) {
768 gpio = &i2c_info->asGPIO_Info[i];
769
770 + /* r4xx mask is technically not used by the hw, so patch in the legacy mask bits */
771 + if ((rdev->family == CHIP_R420) ||
772 + (rdev->family == CHIP_R423) ||
773 + (rdev->family == CHIP_RV410)) {
774 + if ((le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0018) ||
775 + (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0019) ||
776 + (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x001a)) {
777 + gpio->ucClkMaskShift = 0x19;
778 + gpio->ucDataMaskShift = 0x18;
779 + }
780 + }
781 +
782 /* some evergreen boards have bad data for this entry */
783 if (ASIC_IS_DCE4(rdev)) {
784 if ((i == 7) &&
785 @@ -169,6 +181,18 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev)
786 gpio = &i2c_info->asGPIO_Info[i];
787 i2c.valid = false;
788
789 + /* r4xx mask is technically not used by the hw, so patch in the legacy mask bits */
790 + if ((rdev->family == CHIP_R420) ||
791 + (rdev->family == CHIP_R423) ||
792 + (rdev->family == CHIP_RV410)) {
793 + if ((le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0018) ||
794 + (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0019) ||
795 + (le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x001a)) {
796 + gpio->ucClkMaskShift = 0x19;
797 + gpio->ucDataMaskShift = 0x18;
798 + }
799 + }
800 +
801 /* some evergreen boards have bad data for this entry */
802 if (ASIC_IS_DCE4(rdev)) {
803 if ((i == 7) &&
804 diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
805 index aea28c3..a37a1ef 100644
806 --- a/drivers/gpu/drm/radeon/rs600.c
807 +++ b/drivers/gpu/drm/radeon/rs600.c
808 @@ -62,6 +62,7 @@ u32 rs600_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
809 {
810 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
811 u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);
812 + int i;
813
814 /* Lock the graphics update lock */
815 tmp |= AVIVO_D1GRPH_UPDATE_LOCK;
816 @@ -74,7 +75,11 @@ u32 rs600_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
817 (u32)crtc_base);
818
819 /* Wait for update_pending to go high. */
820 - while (!(RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING));
821 + for (i = 0; i < rdev->usec_timeout; i++) {
822 + if (RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING)
823 + break;
824 + udelay(1);
825 + }
826 DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
827
828 /* Unlock the lock, so double-buffering can take place inside vblank */
829 diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
830 index f2516e6..84cf82f 100644
831 --- a/drivers/gpu/drm/radeon/rv770.c
832 +++ b/drivers/gpu/drm/radeon/rv770.c
833 @@ -47,6 +47,7 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
834 {
835 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
836 u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);
837 + int i;
838
839 /* Lock the graphics update lock */
840 tmp |= AVIVO_D1GRPH_UPDATE_LOCK;
841 @@ -66,7 +67,11 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base)
842 (u32)crtc_base);
843
844 /* Wait for update_pending to go high. */
845 - while (!(RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING));
846 + for (i = 0; i < rdev->usec_timeout; i++) {
847 + if (RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING)
848 + break;
849 + udelay(1);
850 + }
851 DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n");
852
853 /* Unlock the lock, so double-buffering can take place inside vblank */
854 diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
855 index e2b2d78..81b6850 100644
856 --- a/drivers/gpu/drm/ttm/ttm_bo.c
857 +++ b/drivers/gpu/drm/ttm/ttm_bo.c
858 @@ -394,7 +394,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
859
860 if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) {
861 if (bo->ttm == NULL) {
862 - ret = ttm_bo_add_ttm(bo, false);
863 + bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED);
864 + ret = ttm_bo_add_ttm(bo, zero);
865 if (ret)
866 goto out_err;
867 }
868 diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
869 index 4f81d20..763797d 100644
870 --- a/drivers/hid/hid-core.c
871 +++ b/drivers/hid/hid-core.c
872 @@ -1721,8 +1721,8 @@ static const struct hid_device_id hid_ignore_list[] = {
873 { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
874 { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
875 { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
876 + { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) },
877 { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) },
878 - { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) },
879 { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0004) },
880 { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30) },
881 { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30) },
882 diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
883 index c97003c..206f750 100644
884 --- a/drivers/hid/hid-ids.h
885 +++ b/drivers/hid/hid-ids.h
886 @@ -266,7 +266,7 @@
887 #define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR 0x0002
888
889 #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc
890 -#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0001
891 +#define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003
892
893 #define USB_VENDOR_ID_GLAB 0x06c2
894 #define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038
895 diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
896 index f642194..835ae42 100644
897 --- a/drivers/hwmon/coretemp.c
898 +++ b/drivers/hwmon/coretemp.c
899 @@ -539,6 +539,8 @@ static void coretemp_add_core(unsigned int cpu, int pkg_flag)
900 return;
901
902 pdata = platform_get_drvdata(pdev);
903 + if (!pdata)
904 + return;
905
906 err = create_core_data(pdata, pdev, cpu, pkg_flag);
907 if (err)
908 diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
909 index d6d5868..eca3bcc 100644
910 --- a/drivers/i2c/algos/i2c-algo-bit.c
911 +++ b/drivers/i2c/algos/i2c-algo-bit.c
912 @@ -486,7 +486,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
913
914 if (flags & I2C_M_TEN) {
915 /* a ten bit address */
916 - addr = 0xf0 | ((msg->addr >> 7) & 0x03);
917 + addr = 0xf0 | ((msg->addr >> 7) & 0x06);
918 bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr);
919 /* try extended address code...*/
920 ret = try_address(i2c_adap, addr, retries);
921 @@ -496,7 +496,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
922 return -EREMOTEIO;
923 }
924 /* the remaining 8 bit address */
925 - ret = i2c_outb(i2c_adap, msg->addr & 0x7f);
926 + ret = i2c_outb(i2c_adap, msg->addr & 0xff);
927 if ((ret != 1) && !nak_ok) {
928 /* the chip did not ack / xmission error occurred */
929 dev_err(&i2c_adap->dev, "died at 2nd address code\n");
930 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
931 index b9188a2..b8f2a4e 100644
932 --- a/drivers/mfd/twl-core.c
933 +++ b/drivers/mfd/twl-core.c
934 @@ -109,7 +109,7 @@
935 #define twl_has_watchdog() false
936 #endif
937
938 -#if defined(CONFIG_MFD_TWL4030_AUDIO) || defined(CONFIG_MFD_TWL4030_AUDIO_MODULE) ||\
939 +#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
940 defined(CONFIG_SND_SOC_TWL6040) || defined(CONFIG_SND_SOC_TWL6040_MODULE)
941 #define twl_has_codec() true
942 #else
943 diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
944 index 6d9204fe..b33ceb1 100644
945 --- a/drivers/net/wireless/p54/p54spi.c
946 +++ b/drivers/net/wireless/p54/p54spi.c
947 @@ -589,8 +589,6 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
948
949 WARN_ON(priv->fw_state != FW_STATE_READY);
950
951 - cancel_work_sync(&priv->work);
952 -
953 p54spi_power_off(priv);
954 spin_lock_irqsave(&priv->tx_lock, flags);
955 INIT_LIST_HEAD(&priv->tx_pending);
956 @@ -598,6 +596,8 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
957
958 priv->fw_state = FW_STATE_OFF;
959 mutex_unlock(&priv->mutex);
960 +
961 + cancel_work_sync(&priv->work);
962 }
963
964 static int __devinit p54spi_probe(struct spi_device *spi)
965 @@ -657,6 +657,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
966 init_completion(&priv->fw_comp);
967 INIT_LIST_HEAD(&priv->tx_pending);
968 mutex_init(&priv->mutex);
969 + spin_lock_init(&priv->tx_lock);
970 SET_IEEE80211_DEV(hw, &spi->dev);
971 priv->common.open = p54spi_op_start;
972 priv->common.stop = p54spi_op_stop;
973 diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
974 index 3f7ea1c..e6e174c 100644
975 --- a/drivers/net/wireless/rt2x00/rt2800lib.c
976 +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
977 @@ -3514,7 +3514,7 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i)
978 /* Apparently the data is read from end to start */
979 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, &reg);
980 /* The returned value is in CPU order, but eeprom is le */
981 - rt2x00dev->eeprom[i] = cpu_to_le32(reg);
982 + *(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg);
983 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, &reg);
984 *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
985 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, &reg);
986 diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
987 index dccd863..f8c752e 100644
988 --- a/drivers/oprofile/oprof.c
989 +++ b/drivers/oprofile/oprof.c
990 @@ -239,26 +239,45 @@ int oprofile_set_ulong(unsigned long *addr, unsigned long val)
991 return err;
992 }
993
994 +static int timer_mode;
995 +
996 static int __init oprofile_init(void)
997 {
998 int err;
999
1000 + /* always init architecture to setup backtrace support */
1001 err = oprofile_arch_init(&oprofile_ops);
1002 - if (err < 0 || timer) {
1003 - printk(KERN_INFO "oprofile: using timer interrupt.\n");
1004 +
1005 + timer_mode = err || timer; /* fall back to timer mode on errors */
1006 + if (timer_mode) {
1007 + if (!err)
1008 + oprofile_arch_exit();
1009 err = oprofile_timer_init(&oprofile_ops);
1010 if (err)
1011 return err;
1012 }
1013 - return oprofilefs_register();
1014 +
1015 + err = oprofilefs_register();
1016 + if (!err)
1017 + return 0;
1018 +
1019 + /* failed */
1020 + if (timer_mode)
1021 + oprofile_timer_exit();
1022 + else
1023 + oprofile_arch_exit();
1024 +
1025 + return err;
1026 }
1027
1028
1029 static void __exit oprofile_exit(void)
1030 {
1031 - oprofile_timer_exit();
1032 oprofilefs_unregister();
1033 - oprofile_arch_exit();
1034 + if (timer_mode)
1035 + oprofile_timer_exit();
1036 + else
1037 + oprofile_arch_exit();
1038 }
1039
1040
1041 diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c
1042 index 3ef4462..878fba1 100644
1043 --- a/drivers/oprofile/timer_int.c
1044 +++ b/drivers/oprofile/timer_int.c
1045 @@ -110,6 +110,7 @@ int oprofile_timer_init(struct oprofile_operations *ops)
1046 ops->start = oprofile_hrtimer_start;
1047 ops->stop = oprofile_hrtimer_stop;
1048 ops->cpu_type = "timer";
1049 + printk(KERN_INFO "oprofile: using timer interrupt.\n");
1050 return 0;
1051 }
1052
1053 diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
1054 index aca972b..dd7e0c5 100644
1055 --- a/drivers/pci/hotplug/shpchp_core.c
1056 +++ b/drivers/pci/hotplug/shpchp_core.c
1057 @@ -278,8 +278,8 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
1058
1059 static int is_shpc_capable(struct pci_dev *dev)
1060 {
1061 - if ((dev->vendor == PCI_VENDOR_ID_AMD) || (dev->device ==
1062 - PCI_DEVICE_ID_AMD_GOLAM_7450))
1063 + if (dev->vendor == PCI_VENDOR_ID_AMD &&
1064 + dev->device == PCI_DEVICE_ID_AMD_GOLAM_7450)
1065 return 1;
1066 if (!pci_find_capability(dev, PCI_CAP_ID_SHPC))
1067 return 0;
1068 diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
1069 index 36547f0..75ba231 100644
1070 --- a/drivers/pci/hotplug/shpchp_hpc.c
1071 +++ b/drivers/pci/hotplug/shpchp_hpc.c
1072 @@ -944,8 +944,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev)
1073 ctrl->pci_dev = pdev; /* pci_dev of the P2P bridge */
1074 ctrl_dbg(ctrl, "Hotplug Controller:\n");
1075
1076 - if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device ==
1077 - PCI_DEVICE_ID_AMD_GOLAM_7450)) {
1078 + if (pdev->vendor == PCI_VENDOR_ID_AMD &&
1079 + pdev->device == PCI_DEVICE_ID_AMD_GOLAM_7450) {
1080 /* amd shpc driver doesn't use Base Offset; assume 0 */
1081 ctrl->mmio_base = pci_resource_start(pdev, 0);
1082 ctrl->mmio_size = pci_resource_len(pdev, 0);
1083 diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
1084 index eb4c883..bbb6f85 100644
1085 --- a/drivers/rtc/interface.c
1086 +++ b/drivers/rtc/interface.c
1087 @@ -318,6 +318,20 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
1088 }
1089 EXPORT_SYMBOL_GPL(rtc_read_alarm);
1090
1091 +static int ___rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
1092 +{
1093 + int err;
1094 +
1095 + if (!rtc->ops)
1096 + err = -ENODEV;
1097 + else if (!rtc->ops->set_alarm)
1098 + err = -EINVAL;
1099 + else
1100 + err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
1101 +
1102 + return err;
1103 +}
1104 +
1105 static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
1106 {
1107 struct rtc_time tm;
1108 @@ -341,14 +355,7 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
1109 * over right here, before we set the alarm.
1110 */
1111
1112 - if (!rtc->ops)
1113 - err = -ENODEV;
1114 - else if (!rtc->ops->set_alarm)
1115 - err = -EINVAL;
1116 - else
1117 - err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
1118 -
1119 - return err;
1120 + return ___rtc_set_alarm(rtc, alarm);
1121 }
1122
1123 int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
1124 @@ -762,6 +769,20 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
1125 return 0;
1126 }
1127
1128 +static void rtc_alarm_disable(struct rtc_device *rtc)
1129 +{
1130 + struct rtc_wkalrm alarm;
1131 + struct rtc_time tm;
1132 +
1133 + __rtc_read_time(rtc, &tm);
1134 +
1135 + alarm.time = rtc_ktime_to_tm(ktime_add(rtc_tm_to_ktime(tm),
1136 + ktime_set(300, 0)));
1137 + alarm.enabled = 0;
1138 +
1139 + ___rtc_set_alarm(rtc, &alarm);
1140 +}
1141 +
1142 /**
1143 * rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
1144 * @rtc rtc device
1145 @@ -783,8 +804,10 @@ static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer)
1146 struct rtc_wkalrm alarm;
1147 int err;
1148 next = timerqueue_getnext(&rtc->timerqueue);
1149 - if (!next)
1150 + if (!next) {
1151 + rtc_alarm_disable(rtc);
1152 return;
1153 + }
1154 alarm.time = rtc_ktime_to_tm(next->expires);
1155 alarm.enabled = 1;
1156 err = __rtc_set_alarm(rtc, &alarm);
1157 @@ -846,7 +869,8 @@ again:
1158 err = __rtc_set_alarm(rtc, &alarm);
1159 if (err == -ETIME)
1160 goto again;
1161 - }
1162 + } else
1163 + rtc_alarm_disable(rtc);
1164
1165 mutex_unlock(&rtc->ops_lock);
1166 }
1167 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
1168 index f97acff..72ab1e6 100644
1169 --- a/drivers/scsi/scsi_lib.c
1170 +++ b/drivers/scsi/scsi_lib.c
1171 @@ -1407,6 +1407,8 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
1172
1173 blk_start_request(req);
1174
1175 + scmd_printk(KERN_INFO, cmd, "killing request\n");
1176 +
1177 sdev = cmd->device;
1178 starget = scsi_target(sdev);
1179 shost = sdev->host;
1180 @@ -1488,7 +1490,6 @@ static void scsi_request_fn(struct request_queue *q)
1181 struct request *req;
1182
1183 if (!sdev) {
1184 - printk("scsi: killing requests for dead queue\n");
1185 while ((req = blk_peek_request(q)) != NULL)
1186 scsi_kill_request(req, q);
1187 return;
1188 diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
1189 index c20694e..63e50f7 100644
1190 --- a/drivers/staging/comedi/comedi_fops.c
1191 +++ b/drivers/staging/comedi/comedi_fops.c
1192 @@ -1432,7 +1432,21 @@ static int do_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
1193 return ret;
1194 }
1195
1196 -static void comedi_unmap(struct vm_area_struct *area)
1197 +
1198 +static void comedi_vm_open(struct vm_area_struct *area)
1199 +{
1200 + struct comedi_async *async;
1201 + struct comedi_device *dev;
1202 +
1203 + async = area->vm_private_data;
1204 + dev = async->subdevice->device;
1205 +
1206 + mutex_lock(&dev->mutex);
1207 + async->mmap_count++;
1208 + mutex_unlock(&dev->mutex);
1209 +}
1210 +
1211 +static void comedi_vm_close(struct vm_area_struct *area)
1212 {
1213 struct comedi_async *async;
1214 struct comedi_device *dev;
1215 @@ -1446,15 +1460,13 @@ static void comedi_unmap(struct vm_area_struct *area)
1216 }
1217
1218 static struct vm_operations_struct comedi_vm_ops = {
1219 - .close = comedi_unmap,
1220 + .open = comedi_vm_open,
1221 + .close = comedi_vm_close,
1222 };
1223
1224 static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
1225 {
1226 const unsigned minor = iminor(file->f_dentry->d_inode);
1227 - struct comedi_device_file_info *dev_file_info =
1228 - comedi_get_device_file_info(minor);
1229 - struct comedi_device *dev = dev_file_info->device;
1230 struct comedi_async *async = NULL;
1231 unsigned long start = vma->vm_start;
1232 unsigned long size;
1233 @@ -1462,6 +1474,15 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
1234 int i;
1235 int retval;
1236 struct comedi_subdevice *s;
1237 + struct comedi_device_file_info *dev_file_info;
1238 + struct comedi_device *dev;
1239 +
1240 + dev_file_info = comedi_get_device_file_info(minor);
1241 + if (dev_file_info == NULL)
1242 + return -ENODEV;
1243 + dev = dev_file_info->device;
1244 + if (dev == NULL)
1245 + return -ENODEV;
1246
1247 mutex_lock(&dev->mutex);
1248 if (!dev->attached) {
1249 @@ -1528,11 +1549,17 @@ static unsigned int comedi_poll(struct file *file, poll_table * wait)
1250 {
1251 unsigned int mask = 0;
1252 const unsigned minor = iminor(file->f_dentry->d_inode);
1253 - struct comedi_device_file_info *dev_file_info =
1254 - comedi_get_device_file_info(minor);
1255 - struct comedi_device *dev = dev_file_info->device;
1256 struct comedi_subdevice *read_subdev;
1257 struct comedi_subdevice *write_subdev;
1258 + struct comedi_device_file_info *dev_file_info;
1259 + struct comedi_device *dev;
1260 + dev_file_info = comedi_get_device_file_info(minor);
1261 +
1262 + if (dev_file_info == NULL)
1263 + return -ENODEV;
1264 + dev = dev_file_info->device;
1265 + if (dev == NULL)
1266 + return -ENODEV;
1267
1268 mutex_lock(&dev->mutex);
1269 if (!dev->attached) {
1270 @@ -1578,9 +1605,15 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
1271 int n, m, count = 0, retval = 0;
1272 DECLARE_WAITQUEUE(wait, current);
1273 const unsigned minor = iminor(file->f_dentry->d_inode);
1274 - struct comedi_device_file_info *dev_file_info =
1275 - comedi_get_device_file_info(minor);
1276 - struct comedi_device *dev = dev_file_info->device;
1277 + struct comedi_device_file_info *dev_file_info;
1278 + struct comedi_device *dev;
1279 + dev_file_info = comedi_get_device_file_info(minor);
1280 +
1281 + if (dev_file_info == NULL)
1282 + return -ENODEV;
1283 + dev = dev_file_info->device;
1284 + if (dev == NULL)
1285 + return -ENODEV;
1286
1287 if (!dev->attached) {
1288 DPRINTK("no driver configured on comedi%i\n", dev->minor);
1289 @@ -1640,11 +1673,11 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
1290 retval = -EAGAIN;
1291 break;
1292 }
1293 + schedule();
1294 if (signal_pending(current)) {
1295 retval = -ERESTARTSYS;
1296 break;
1297 }
1298 - schedule();
1299 if (!s->busy)
1300 break;
1301 if (s->busy != file) {
1302 @@ -1683,9 +1716,15 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
1303 int n, m, count = 0, retval = 0;
1304 DECLARE_WAITQUEUE(wait, current);
1305 const unsigned minor = iminor(file->f_dentry->d_inode);
1306 - struct comedi_device_file_info *dev_file_info =
1307 - comedi_get_device_file_info(minor);
1308 - struct comedi_device *dev = dev_file_info->device;
1309 + struct comedi_device_file_info *dev_file_info;
1310 + struct comedi_device *dev;
1311 + dev_file_info = comedi_get_device_file_info(minor);
1312 +
1313 + if (dev_file_info == NULL)
1314 + return -ENODEV;
1315 + dev = dev_file_info->device;
1316 + if (dev == NULL)
1317 + return -ENODEV;
1318
1319 if (!dev->attached) {
1320 DPRINTK("no driver configured on comedi%i\n", dev->minor);
1321 @@ -1741,11 +1780,11 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
1322 retval = -EAGAIN;
1323 break;
1324 }
1325 + schedule();
1326 if (signal_pending(current)) {
1327 retval = -ERESTARTSYS;
1328 break;
1329 }
1330 - schedule();
1331 if (!s->busy) {
1332 retval = 0;
1333 break;
1334 @@ -1885,11 +1924,17 @@ ok:
1335 static int comedi_close(struct inode *inode, struct file *file)
1336 {
1337 const unsigned minor = iminor(inode);
1338 - struct comedi_device_file_info *dev_file_info =
1339 - comedi_get_device_file_info(minor);
1340 - struct comedi_device *dev = dev_file_info->device;
1341 struct comedi_subdevice *s = NULL;
1342 int i;
1343 + struct comedi_device_file_info *dev_file_info;
1344 + struct comedi_device *dev;
1345 + dev_file_info = comedi_get_device_file_info(minor);
1346 +
1347 + if (dev_file_info == NULL)
1348 + return -ENODEV;
1349 + dev = dev_file_info->device;
1350 + if (dev == NULL)
1351 + return -ENODEV;
1352
1353 mutex_lock(&dev->mutex);
1354
1355 @@ -1923,10 +1968,15 @@ static int comedi_close(struct inode *inode, struct file *file)
1356 static int comedi_fasync(int fd, struct file *file, int on)
1357 {
1358 const unsigned minor = iminor(file->f_dentry->d_inode);
1359 - struct comedi_device_file_info *dev_file_info =
1360 - comedi_get_device_file_info(minor);
1361 + struct comedi_device_file_info *dev_file_info;
1362 + struct comedi_device *dev;
1363 + dev_file_info = comedi_get_device_file_info(minor);
1364
1365 - struct comedi_device *dev = dev_file_info->device;
1366 + if (dev_file_info == NULL)
1367 + return -ENODEV;
1368 + dev = dev_file_info->device;
1369 + if (dev == NULL)
1370 + return -ENODEV;
1371
1372 return fasync_helper(fd, file, on, &dev->async_queue);
1373 }
1374 diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c
1375 index e42ce9d..5c4b5d9 100644
1376 --- a/drivers/staging/usbip/vhci_rx.c
1377 +++ b/drivers/staging/usbip/vhci_rx.c
1378 @@ -68,6 +68,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
1379 {
1380 struct usbip_device *ud = &vdev->ud;
1381 struct urb *urb;
1382 + unsigned long flags;
1383
1384 spin_lock(&vdev->priv_lock);
1385 urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum);
1386 @@ -101,9 +102,9 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,
1387
1388 usbip_dbg_vhci_rx("now giveback urb %p\n", urb);
1389
1390 - spin_lock(&the_controller->lock);
1391 + spin_lock_irqsave(&the_controller->lock, flags);
1392 usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
1393 - spin_unlock(&the_controller->lock);
1394 + spin_unlock_irqrestore(&the_controller->lock, flags);
1395
1396 usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status);
1397
1398 @@ -141,6 +142,7 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev,
1399 {
1400 struct vhci_unlink *unlink;
1401 struct urb *urb;
1402 + unsigned long flags;
1403
1404 usbip_dump_header(pdu);
1405
1406 @@ -170,9 +172,9 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev,
1407 urb->status = pdu->u.ret_unlink.status;
1408 pr_info("urb->status %d\n", urb->status);
1409
1410 - spin_lock(&the_controller->lock);
1411 + spin_lock_irqsave(&the_controller->lock, flags);
1412 usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb);
1413 - spin_unlock(&the_controller->lock);
1414 + spin_unlock_irqrestore(&the_controller->lock, flags);
1415
1416 usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb,
1417 urb->status);
1418 diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
1419 index 063c630..8949b23 100644
1420 --- a/drivers/usb/host/ehci-sched.c
1421 +++ b/drivers/usb/host/ehci-sched.c
1422 @@ -1479,30 +1479,36 @@ iso_stream_schedule (
1423 * jump until after the queue is primed.
1424 */
1425 else {
1426 + int done = 0;
1427 start = SCHEDULE_SLOP + (now & ~0x07);
1428
1429 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */
1430
1431 - /* find a uframe slot with enough bandwidth */
1432 - next = start + period;
1433 - for (; start < next; start++) {
1434 -
1435 + /* find a uframe slot with enough bandwidth.
1436 + * Early uframes are more precious because full-speed
1437 + * iso IN transfers can't use late uframes,
1438 + * and therefore they should be allocated last.
1439 + */
1440 + next = start;
1441 + start += period;
1442 + do {
1443 + start--;
1444 /* check schedule: enough space? */
1445 if (stream->highspeed) {
1446 if (itd_slot_ok(ehci, mod, start,
1447 stream->usecs, period))
1448 - break;
1449 + done = 1;
1450 } else {
1451 if ((start % 8) >= 6)
1452 continue;
1453 if (sitd_slot_ok(ehci, mod, stream,
1454 start, sched, period))
1455 - break;
1456 + done = 1;
1457 }
1458 - }
1459 + } while (start > next && !done);
1460
1461 /* no room in the schedule */
1462 - if (start == next) {
1463 + if (!done) {
1464 ehci_dbg(ehci, "iso resched full %p (now %d max %d)\n",
1465 urb, now, now + mod);
1466 status = -ENOSPC;
1467 diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c
1468 index d6e1754..a403b53 100644
1469 --- a/drivers/usb/host/whci/qset.c
1470 +++ b/drivers/usb/host/whci/qset.c
1471 @@ -124,7 +124,7 @@ void qset_clear(struct whc *whc, struct whc_qset *qset)
1472 {
1473 qset->td_start = qset->td_end = qset->ntds = 0;
1474
1475 - qset->qh.link = cpu_to_le32(QH_LINK_NTDS(8) | QH_LINK_T);
1476 + qset->qh.link = cpu_to_le64(QH_LINK_NTDS(8) | QH_LINK_T);
1477 qset->qh.status = qset->qh.status & QH_STATUS_SEQ_MASK;
1478 qset->qh.err_count = 0;
1479 qset->qh.scratch[0] = 0;
1480 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1481 index 1f0e198..221f14e 100644
1482 --- a/drivers/usb/host/xhci.c
1483 +++ b/drivers/usb/host/xhci.c
1484 @@ -657,7 +657,10 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
1485 ring = xhci->cmd_ring;
1486 seg = ring->deq_seg;
1487 do {
1488 - memset(seg->trbs, 0, SEGMENT_SIZE);
1489 + memset(seg->trbs, 0,
1490 + sizeof(union xhci_trb) * (TRBS_PER_SEGMENT - 1));
1491 + seg->trbs[TRBS_PER_SEGMENT - 1].link.control &=
1492 + cpu_to_le32(~TRB_CYCLE);
1493 seg = seg->next;
1494 } while (seg != ring->deq_seg);
1495
1496 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1497 index 486769c..b02fd50 100644
1498 --- a/drivers/usb/serial/ftdi_sio.c
1499 +++ b/drivers/usb/serial/ftdi_sio.c
1500 @@ -735,6 +735,7 @@ static struct usb_device_id id_table_combined [] = {
1501 { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
1502 { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) },
1503 { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) },
1504 + { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) },
1505 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
1506 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1507 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID),
1508 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1509 index 571fa96..055b64e 100644
1510 --- a/drivers/usb/serial/ftdi_sio_ids.h
1511 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1512 @@ -112,6 +112,7 @@
1513
1514 /* Propox devices */
1515 #define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
1516 +#define FTDI_PROPOX_ISPCABLEIII_PID 0xD739
1517
1518 /* Lenz LI-USB Computer Interface. */
1519 #define FTDI_LENZ_LIUSB_PID 0xD780
1520 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1521 index 3a47cbe..e98a1e1 100644
1522 --- a/drivers/usb/serial/option.c
1523 +++ b/drivers/usb/serial/option.c
1524 @@ -657,6 +657,9 @@ static const struct usb_device_id option_ids[] = {
1525 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x31) },
1526 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x32) },
1527 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
1528 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
1529 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
1530 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x08) },
1531 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
1532 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
1533 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
1534 @@ -743,6 +746,7 @@ static const struct usb_device_id option_ids[] = {
1535 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
1536 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
1537 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
1538 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
1539 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */
1540 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) },
1541 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
1542 diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1543 index 3041a97..24caba7 100644
1544 --- a/drivers/usb/storage/unusual_devs.h
1545 +++ b/drivers/usb/storage/unusual_devs.h
1546 @@ -1854,6 +1854,13 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110,
1547 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1548 US_FL_IGNORE_RESIDUE ),
1549
1550 +/* Reported by Qinglin Ye <yestyle@gmail.com> */
1551 +UNUSUAL_DEV( 0x13fe, 0x3600, 0x0100, 0x0100,
1552 + "Kingston",
1553 + "DT 101 G2",
1554 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1555 + US_FL_BULK_IGNORE_TAG ),
1556 +
1557 /* Reported by Francesco Foresti <frafore@tiscali.it> */
1558 UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201,
1559 "Super Top",
1560 diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h
1561 index 61b0bd5..1603023 100644
1562 --- a/drivers/video/via/share.h
1563 +++ b/drivers/video/via/share.h
1564 @@ -557,8 +557,8 @@
1565 #define M1200X720_R60_VSP POSITIVE
1566
1567 /* 1200x900@60 Sync Polarity (DCON) */
1568 -#define M1200X900_R60_HSP NEGATIVE
1569 -#define M1200X900_R60_VSP NEGATIVE
1570 +#define M1200X900_R60_HSP POSITIVE
1571 +#define M1200X900_R60_VSP POSITIVE
1572
1573 /* 1280x600@60 Sync Polarity (GTF Mode) */
1574 #define M1280x600_R60_HSP NEGATIVE
1575 diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
1576 index 58609bd..7cf5c3e 100644
1577 --- a/fs/ecryptfs/crypto.c
1578 +++ b/fs/ecryptfs/crypto.c
1579 @@ -1943,7 +1943,7 @@ static unsigned char *portable_filename_chars = ("-.0123456789ABCD"
1580
1581 /* We could either offset on every reverse map or just pad some 0x00's
1582 * at the front here */
1583 -static const unsigned char filename_rev_map[] = {
1584 +static const unsigned char filename_rev_map[256] = {
1585 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */
1586 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 15 */
1587 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 23 */
1588 @@ -1959,7 +1959,7 @@ static const unsigned char filename_rev_map[] = {
1589 0x00, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, /* 103 */
1590 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, /* 111 */
1591 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, /* 119 */
1592 - 0x3D, 0x3E, 0x3F
1593 + 0x3D, 0x3E, 0x3F /* 123 - 255 initialized to 0x00 */
1594 };
1595
1596 /**
1597 diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
1598 index 4ec9eb0..0c1a652 100644
1599 --- a/fs/ecryptfs/file.c
1600 +++ b/fs/ecryptfs/file.c
1601 @@ -139,6 +139,27 @@ out:
1602 return rc;
1603 }
1604
1605 +static void ecryptfs_vma_close(struct vm_area_struct *vma)
1606 +{
1607 + filemap_write_and_wait(vma->vm_file->f_mapping);
1608 +}
1609 +
1610 +static const struct vm_operations_struct ecryptfs_file_vm_ops = {
1611 + .close = ecryptfs_vma_close,
1612 + .fault = filemap_fault,
1613 +};
1614 +
1615 +static int ecryptfs_file_mmap(struct file *file, struct vm_area_struct *vma)
1616 +{
1617 + int rc;
1618 +
1619 + rc = generic_file_mmap(file, vma);
1620 + if (!rc)
1621 + vma->vm_ops = &ecryptfs_file_vm_ops;
1622 +
1623 + return rc;
1624 +}
1625 +
1626 struct kmem_cache *ecryptfs_file_info_cache;
1627
1628 /**
1629 @@ -348,7 +369,7 @@ const struct file_operations ecryptfs_main_fops = {
1630 #ifdef CONFIG_COMPAT
1631 .compat_ioctl = ecryptfs_compat_ioctl,
1632 #endif
1633 - .mmap = generic_file_mmap,
1634 + .mmap = ecryptfs_file_mmap,
1635 .open = ecryptfs_open,
1636 .flush = ecryptfs_flush,
1637 .release = ecryptfs_release,
1638 diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
1639 index 614c4d2..75af812 100644
1640 --- a/fs/nfs/nfs4filelayout.c
1641 +++ b/fs/nfs/nfs4filelayout.c
1642 @@ -428,6 +428,14 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
1643
1644 dprintk("--> %s\n", __func__);
1645
1646 + /* FIXME: remove this check when layout segment support is added */
1647 + if (lgr->range.offset != 0 ||
1648 + lgr->range.length != NFS4_MAX_UINT64) {
1649 + dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
1650 + __func__);
1651 + goto out;
1652 + }
1653 +
1654 if (fl->pattern_offset > lgr->range.offset) {
1655 dprintk("%s pattern_offset %lld too large\n",
1656 __func__, fl->pattern_offset);
1657 diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
1658 index a726c0a..36d2a29 100644
1659 --- a/fs/nfs/pnfs.c
1660 +++ b/fs/nfs/pnfs.c
1661 @@ -980,7 +980,8 @@ pnfs_update_layout(struct inode *ino,
1662 arg.offset -= pg_offset;
1663 arg.length += pg_offset;
1664 }
1665 - arg.length = PAGE_CACHE_ALIGN(arg.length);
1666 + if (arg.length != NFS4_MAX_UINT64)
1667 + arg.length = PAGE_CACHE_ALIGN(arg.length);
1668
1669 lseg = send_layoutget(lo, ctx, &arg, gfp_flags);
1670 if (!lseg && first) {
1671 diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
1672 index 39f4f80..4b9fb91 100644
1673 --- a/fs/xfs/linux-2.6/xfs_acl.c
1674 +++ b/fs/xfs/linux-2.6/xfs_acl.c
1675 @@ -42,6 +42,8 @@ xfs_acl_from_disk(struct xfs_acl *aclp)
1676 int count, i;
1677
1678 count = be32_to_cpu(aclp->acl_cnt);
1679 + if (count > XFS_ACL_MAX_ENTRIES)
1680 + return ERR_PTR(-EFSCORRUPTED);
1681
1682 acl = posix_acl_alloc(count, GFP_KERNEL);
1683 if (!acl)
1684 diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
1685 index 8ecad5f..b69688d 100644
1686 --- a/fs/xfs/linux-2.6/xfs_sync.c
1687 +++ b/fs/xfs/linux-2.6/xfs_sync.c
1688 @@ -772,6 +772,17 @@ restart:
1689 if (!xfs_iflock_nowait(ip)) {
1690 if (!(sync_mode & SYNC_WAIT))
1691 goto out;
1692 +
1693 + /*
1694 + * If we only have a single dirty inode in a cluster there is
1695 + * a fair chance that the AIL push may have pushed it into
1696 + * the buffer, but xfsbufd won't touch it until 30 seconds
1697 + * from now, and thus we will lock up here.
1698 + *
1699 + * Promote the inode buffer to the front of the delwri list
1700 + * and wake up xfsbufd now.
1701 + */
1702 + xfs_promote_inode(ip);
1703 xfs_iflock(ip);
1704 }
1705
1706 diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
1707 index 71e90dc2..f49ecf2 100644
1708 --- a/fs/xfs/xfs_attr_leaf.c
1709 +++ b/fs/xfs/xfs_attr_leaf.c
1710 @@ -110,6 +110,7 @@ xfs_attr_namesp_match(int arg_flags, int ondisk_flags)
1711 /*
1712 * Query whether the requested number of additional bytes of extended
1713 * attribute space will be able to fit inline.
1714 + *
1715 * Returns zero if not, else the di_forkoff fork offset to be used in the
1716 * literal area for attribute data once the new bytes have been added.
1717 *
1718 @@ -122,7 +123,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
1719 int offset;
1720 int minforkoff; /* lower limit on valid forkoff locations */
1721 int maxforkoff; /* upper limit on valid forkoff locations */
1722 - int dsize;
1723 + int dsize;
1724 xfs_mount_t *mp = dp->i_mount;
1725
1726 offset = (XFS_LITINO(mp) - bytes) >> 3; /* rounded down */
1727 @@ -136,47 +137,60 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
1728 return (offset >= minforkoff) ? minforkoff : 0;
1729 }
1730
1731 - if (!(mp->m_flags & XFS_MOUNT_ATTR2)) {
1732 - if (bytes <= XFS_IFORK_ASIZE(dp))
1733 - return dp->i_d.di_forkoff;
1734 + /*
1735 + * If the requested numbers of bytes is smaller or equal to the
1736 + * current attribute fork size we can always proceed.
1737 + *
1738 + * Note that if_bytes in the data fork might actually be larger than
1739 + * the current data fork size is due to delalloc extents. In that
1740 + * case either the extent count will go down when they are converted
1741 + * to real extents, or the delalloc conversion will take care of the
1742 + * literal area rebalancing.
1743 + */
1744 + if (bytes <= XFS_IFORK_ASIZE(dp))
1745 + return dp->i_d.di_forkoff;
1746 +
1747 + /*
1748 + * For attr2 we can try to move the forkoff if there is space in the
1749 + * literal area, but for the old format we are done if there is no
1750 + * space in the fixed attribute fork.
1751 + */
1752 + if (!(mp->m_flags & XFS_MOUNT_ATTR2))
1753 return 0;
1754 - }
1755
1756 dsize = dp->i_df.if_bytes;
1757 -
1758 +
1759 switch (dp->i_d.di_format) {
1760 case XFS_DINODE_FMT_EXTENTS:
1761 - /*
1762 + /*
1763 * If there is no attr fork and the data fork is extents,
1764 - * determine if creating the default attr fork will result
1765 - * in the extents form migrating to btree. If so, the
1766 - * minimum offset only needs to be the space required for
1767 + * determine if creating the default attr fork will result
1768 + * in the extents form migrating to btree. If so, the
1769 + * minimum offset only needs to be the space required for
1770 * the btree root.
1771 - */
1772 + */
1773 if (!dp->i_d.di_forkoff && dp->i_df.if_bytes >
1774 xfs_default_attroffset(dp))
1775 dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS);
1776 break;
1777 -
1778 case XFS_DINODE_FMT_BTREE:
1779 /*
1780 - * If have data btree then keep forkoff if we have one,
1781 - * otherwise we are adding a new attr, so then we set
1782 - * minforkoff to where the btree root can finish so we have
1783 + * If we have a data btree then keep forkoff if we have one,
1784 + * otherwise we are adding a new attr, so then we set
1785 + * minforkoff to where the btree root can finish so we have
1786 * plenty of room for attrs
1787 */
1788 if (dp->i_d.di_forkoff) {
1789 - if (offset < dp->i_d.di_forkoff)
1790 + if (offset < dp->i_d.di_forkoff)
1791 return 0;
1792 - else
1793 - return dp->i_d.di_forkoff;
1794 - } else
1795 - dsize = XFS_BMAP_BROOT_SPACE(dp->i_df.if_broot);
1796 + return dp->i_d.di_forkoff;
1797 + }
1798 + dsize = XFS_BMAP_BROOT_SPACE(dp->i_df.if_broot);
1799 break;
1800 }
1801 -
1802 - /*
1803 - * A data fork btree root must have space for at least
1804 +
1805 + /*
1806 + * A data fork btree root must have space for at least
1807 * MINDBTPTRS key/ptr pairs if the data fork is small or empty.
1808 */
1809 minforkoff = MAX(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
1810 @@ -186,10 +200,10 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
1811 maxforkoff = XFS_LITINO(mp) - XFS_BMDR_SPACE_CALC(MINABTPTRS);
1812 maxforkoff = maxforkoff >> 3; /* rounded down */
1813
1814 - if (offset >= minforkoff && offset < maxforkoff)
1815 - return offset;
1816 if (offset >= maxforkoff)
1817 return maxforkoff;
1818 + if (offset >= minforkoff)
1819 + return offset;
1820 return 0;
1821 }
1822
1823 diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
1824 index a098a20..c6888a4 100644
1825 --- a/fs/xfs/xfs_inode.c
1826 +++ b/fs/xfs/xfs_inode.c
1827 @@ -3099,6 +3099,27 @@ corrupt_out:
1828 return XFS_ERROR(EFSCORRUPTED);
1829 }
1830
1831 +void
1832 +xfs_promote_inode(
1833 + struct xfs_inode *ip)
1834 +{
1835 + struct xfs_buf *bp;
1836 +
1837 + ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
1838 +
1839 + bp = xfs_incore(ip->i_mount->m_ddev_targp, ip->i_imap.im_blkno,
1840 + ip->i_imap.im_len, XBF_TRYLOCK);
1841 + if (!bp)
1842 + return;
1843 +
1844 + if (XFS_BUF_ISDELAYWRITE(bp)) {
1845 + xfs_buf_delwri_promote(bp);
1846 + wake_up_process(ip->i_mount->m_ddev_targp->bt_task);
1847 + }
1848 +
1849 + xfs_buf_relse(bp);
1850 +}
1851 +
1852 /*
1853 * Return a pointer to the extent record at file index idx.
1854 */
1855 diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
1856 index 964cfea..28b3596 100644
1857 --- a/fs/xfs/xfs_inode.h
1858 +++ b/fs/xfs/xfs_inode.h
1859 @@ -509,6 +509,7 @@ int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
1860 void xfs_iext_realloc(xfs_inode_t *, int, int);
1861 void xfs_iunpin_wait(xfs_inode_t *);
1862 int xfs_iflush(xfs_inode_t *, uint);
1863 +void xfs_promote_inode(struct xfs_inode *);
1864 void xfs_lock_inodes(xfs_inode_t **, int, uint);
1865 void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
1866
1867 diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
1868 index c4961ea..53dfa109 100644
1869 --- a/include/drm/drm_mode.h
1870 +++ b/include/drm/drm_mode.h
1871 @@ -233,6 +233,8 @@ struct drm_mode_fb_cmd {
1872 #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
1873 #define DRM_MODE_FB_DIRTY_FLAGS 0x03
1874
1875 +#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
1876 +
1877 /*
1878 * Mark a region of a framebuffer as dirty.
1879 *
1880 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
1881 index f81676f..4e4fbb8 100644
1882 --- a/include/drm/drm_pciids.h
1883 +++ b/include/drm/drm_pciids.h
1884 @@ -197,6 +197,14 @@
1885 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1886 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1887 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
1888 + {0x1002, 0x6840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1889 + {0x1002, 0x6841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1890 + {0x1002, 0x6842, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1891 + {0x1002, 0x6843, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1892 + {0x1002, 0x6849, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1893 + {0x1002, 0x6850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1894 + {0x1002, 0x6858, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1895 + {0x1002, 0x6859, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
1896 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1897 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
1898 {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
1899 diff --git a/include/linux/sigma.h b/include/linux/sigma.h
1900 index e2accb3..d0de882 100644
1901 --- a/include/linux/sigma.h
1902 +++ b/include/linux/sigma.h
1903 @@ -24,7 +24,7 @@ struct sigma_firmware {
1904 struct sigma_firmware_header {
1905 unsigned char magic[7];
1906 u8 version;
1907 - u32 crc;
1908 + __le32 crc;
1909 };
1910
1911 enum {
1912 @@ -40,19 +40,14 @@ enum {
1913 struct sigma_action {
1914 u8 instr;
1915 u8 len_hi;
1916 - u16 len;
1917 - u16 addr;
1918 + __le16 len;
1919 + __be16 addr;
1920 unsigned char payload[];
1921 };
1922
1923 static inline u32 sigma_action_len(struct sigma_action *sa)
1924 {
1925 - return (sa->len_hi << 16) | sa->len;
1926 -}
1927 -
1928 -static inline size_t sigma_action_size(struct sigma_action *sa, u32 payload_len)
1929 -{
1930 - return sizeof(*sa) + payload_len + (payload_len % 2);
1931 + return (sa->len_hi << 16) | le16_to_cpu(sa->len);
1932 }
1933
1934 extern int process_sigma_firmware(struct i2c_client *client, const char *name);
1935 diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
1936 index e691818..a3f638a 100644
1937 --- a/kernel/cgroup_freezer.c
1938 +++ b/kernel/cgroup_freezer.c
1939 @@ -153,6 +153,13 @@ static void freezer_destroy(struct cgroup_subsys *ss,
1940 kfree(cgroup_freezer(cgroup));
1941 }
1942
1943 +/* task is frozen or will freeze immediately when next it gets woken */
1944 +static bool is_task_frozen_enough(struct task_struct *task)
1945 +{
1946 + return frozen(task) ||
1947 + (task_is_stopped_or_traced(task) && freezing(task));
1948 +}
1949 +
1950 /*
1951 * The call to cgroup_lock() in the freezer.state write method prevents
1952 * a write to that file racing against an attach, and hence the
1953 @@ -231,7 +238,7 @@ static void update_if_frozen(struct cgroup *cgroup,
1954 cgroup_iter_start(cgroup, &it);
1955 while ((task = cgroup_iter_next(cgroup, &it))) {
1956 ntotal++;
1957 - if (frozen(task))
1958 + if (is_task_frozen_enough(task))
1959 nfrozen++;
1960 }
1961
1962 @@ -284,7 +291,7 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
1963 while ((task = cgroup_iter_next(cgroup, &it))) {
1964 if (!freeze_task(task, true))
1965 continue;
1966 - if (frozen(task))
1967 + if (is_task_frozen_enough(task))
1968 continue;
1969 if (!freezing(task) && !freezer_should_skip(task))
1970 num_cant_freeze_now++;
1971 diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
1972 index a9205e3..2043c08 100644
1973 --- a/kernel/hrtimer.c
1974 +++ b/kernel/hrtimer.c
1975 @@ -885,10 +885,13 @@ static void __remove_hrtimer(struct hrtimer *timer,
1976 struct hrtimer_clock_base *base,
1977 unsigned long newstate, int reprogram)
1978 {
1979 + struct timerqueue_node *next_timer;
1980 if (!(timer->state & HRTIMER_STATE_ENQUEUED))
1981 goto out;
1982
1983 - if (&timer->node == timerqueue_getnext(&base->active)) {
1984 + next_timer = timerqueue_getnext(&base->active);
1985 + timerqueue_del(&base->active, &timer->node);
1986 + if (&timer->node == next_timer) {
1987 #ifdef CONFIG_HIGH_RES_TIMERS
1988 /* Reprogram the clock event device. if enabled */
1989 if (reprogram && hrtimer_hres_active()) {
1990 @@ -901,7 +904,6 @@ static void __remove_hrtimer(struct hrtimer *timer,
1991 }
1992 #endif
1993 }
1994 - timerqueue_del(&base->active, &timer->node);
1995 if (!timerqueue_getnext(&base->active))
1996 base->cpu_base->active_bases &= ~(1 << base->index);
1997 out:
1998 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
1999 index 0a7840ae..a1aadab 100644
2000 --- a/kernel/irq/manage.c
2001 +++ b/kernel/irq/manage.c
2002 @@ -620,8 +620,9 @@ static irqreturn_t irq_nested_primary_handler(int irq, void *dev_id)
2003
2004 static int irq_wait_for_interrupt(struct irqaction *action)
2005 {
2006 + set_current_state(TASK_INTERRUPTIBLE);
2007 +
2008 while (!kthread_should_stop()) {
2009 - set_current_state(TASK_INTERRUPTIBLE);
2010
2011 if (test_and_clear_bit(IRQTF_RUNTHREAD,
2012 &action->thread_flags)) {
2013 @@ -629,7 +630,9 @@ static int irq_wait_for_interrupt(struct irqaction *action)
2014 return 0;
2015 }
2016 schedule();
2017 + set_current_state(TASK_INTERRUPTIBLE);
2018 }
2019 + __set_current_state(TASK_RUNNING);
2020 return -1;
2021 }
2022
2023 diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
2024 index b5f4742..dc813a9 100644
2025 --- a/kernel/irq/spurious.c
2026 +++ b/kernel/irq/spurious.c
2027 @@ -84,7 +84,9 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
2028 */
2029 action = desc->action;
2030 if (!action || !(action->flags & IRQF_SHARED) ||
2031 - (action->flags & __IRQF_TIMER) || !action->next)
2032 + (action->flags & __IRQF_TIMER) ||
2033 + (action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
2034 + !action->next)
2035 goto out;
2036
2037 /* Already running on another processor */
2038 diff --git a/kernel/jump_label.c b/kernel/jump_label.c
2039 index a8ce450..e6f1f24 100644
2040 --- a/kernel/jump_label.c
2041 +++ b/kernel/jump_label.c
2042 @@ -66,8 +66,9 @@ void jump_label_inc(struct jump_label_key *key)
2043 return;
2044
2045 jump_label_lock();
2046 - if (atomic_add_return(1, &key->enabled) == 1)
2047 + if (atomic_read(&key->enabled) == 0)
2048 jump_label_update(key, JUMP_LABEL_ENABLE);
2049 + atomic_inc(&key->enabled);
2050 jump_label_unlock();
2051 }
2052
2053 diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
2054 index e4c699d..13dfaab 100644
2055 --- a/kernel/time/clockevents.c
2056 +++ b/kernel/time/clockevents.c
2057 @@ -286,6 +286,7 @@ void clockevents_exchange_device(struct clock_event_device *old,
2058 * released list and do a notify add later.
2059 */
2060 if (old) {
2061 + old->event_handler = clockevents_handle_noop;
2062 clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED);
2063 list_del(&old->list);
2064 list_add(&old->list, &clockevents_released);
2065 diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
2066 index e0980f0..8b27006 100644
2067 --- a/kernel/time/clocksource.c
2068 +++ b/kernel/time/clocksource.c
2069 @@ -531,7 +531,7 @@ static u64 clocksource_max_deferment(struct clocksource *cs)
2070 * note a margin of 12.5% is used because this can be computed with
2071 * a shift, versus say 10% which would require division.
2072 */
2073 - return max_nsecs - (max_nsecs >> 5);
2074 + return max_nsecs - (max_nsecs >> 3);
2075 }
2076
2077 #ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
2078 @@ -653,7 +653,7 @@ void __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq)
2079 * ~ 0.06ppm granularity for NTP. We apply the same 12.5%
2080 * margin as we do in clocksource_max_deferment()
2081 */
2082 - sec = (cs->mask - (cs->mask >> 5));
2083 + sec = (cs->mask - (cs->mask >> 3));
2084 do_div(sec, freq);
2085 do_div(sec, scale);
2086 if (!sec)
2087 diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
2088 index c7218d1..7a90d02 100644
2089 --- a/kernel/time/tick-broadcast.c
2090 +++ b/kernel/time/tick-broadcast.c
2091 @@ -71,7 +71,7 @@ int tick_check_broadcast_device(struct clock_event_device *dev)
2092 (dev->features & CLOCK_EVT_FEAT_C3STOP))
2093 return 0;
2094
2095 - clockevents_exchange_device(NULL, dev);
2096 + clockevents_exchange_device(tick_broadcast_device.evtdev, dev);
2097 tick_broadcast_device.evtdev = dev;
2098 if (!cpumask_empty(tick_get_broadcast_mask()))
2099 tick_broadcast_start_periodic(dev);
2100 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
2101 index 342408c..5f45831 100644
2102 --- a/kernel/time/timekeeping.c
2103 +++ b/kernel/time/timekeeping.c
2104 @@ -249,6 +249,8 @@ ktime_t ktime_get(void)
2105 secs = xtime.tv_sec + wall_to_monotonic.tv_sec;
2106 nsecs = xtime.tv_nsec + wall_to_monotonic.tv_nsec;
2107 nsecs += timekeeping_get_ns();
2108 + /* If arch requires, add in gettimeoffset() */
2109 + nsecs += arch_gettimeoffset();
2110
2111 } while (read_seqretry(&xtime_lock, seq));
2112 /*
2113 @@ -280,6 +282,8 @@ void ktime_get_ts(struct timespec *ts)
2114 *ts = xtime;
2115 tomono = wall_to_monotonic;
2116 nsecs = timekeeping_get_ns();
2117 + /* If arch requires, add in gettimeoffset() */
2118 + nsecs += arch_gettimeoffset();
2119
2120 } while (read_seqretry(&xtime_lock, seq));
2121
2122 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
2123 index 3e2a7c9..2d04936 100644
2124 --- a/kernel/trace/trace_events.c
2125 +++ b/kernel/trace/trace_events.c
2126 @@ -1096,7 +1096,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
2127 /* First see if we did not already create this dir */
2128 list_for_each_entry(system, &event_subsystems, list) {
2129 if (strcmp(system->name, name) == 0) {
2130 - __get_system(system);
2131 system->nr_events++;
2132 return system->entry;
2133 }
2134 diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
2135 index 256764e..bd3c636 100644
2136 --- a/kernel/trace/trace_events_filter.c
2137 +++ b/kernel/trace/trace_events_filter.c
2138 @@ -1766,7 +1766,7 @@ static int replace_system_preds(struct event_subsystem *system,
2139 * replace the filter for the call.
2140 */
2141 filter = call->filter;
2142 - call->filter = filter_item->filter;
2143 + rcu_assign_pointer(call->filter, filter_item->filter);
2144 filter_item->filter = filter;
2145
2146 fail = false;
2147 @@ -1821,7 +1821,7 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
2148 filter = call->filter;
2149 if (!filter)
2150 goto out_unlock;
2151 - call->filter = NULL;
2152 + RCU_INIT_POINTER(call->filter, NULL);
2153 /* Make sure the filter is not being used */
2154 synchronize_sched();
2155 __free_filter(filter);
2156 @@ -1862,7 +1862,7 @@ out:
2157 * string
2158 */
2159 tmp = call->filter;
2160 - call->filter = filter;
2161 + rcu_assign_pointer(call->filter, filter);
2162 if (tmp) {
2163 /* Make sure the call is done with the filter */
2164 synchronize_sched();
2165 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
2166 index bfcf153..2b57cd9 100644
2167 --- a/mm/hugetlb.c
2168 +++ b/mm/hugetlb.c
2169 @@ -2415,6 +2415,8 @@ retry_avoidcopy:
2170 * anon_vma prepared.
2171 */
2172 if (unlikely(anon_vma_prepare(vma))) {
2173 + page_cache_release(new_page);
2174 + page_cache_release(old_page);
2175 /* Caller expects lock to be held */
2176 spin_lock(&mm->page_table_lock);
2177 return VM_FAULT_OOM;
2178 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
2179 index c8be8ef..42a59c2 100644
2180 --- a/net/mac80211/agg-tx.c
2181 +++ b/net/mac80211/agg-tx.c
2182 @@ -162,6 +162,12 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
2183 return -ENOENT;
2184 }
2185
2186 + /* if we're already stopping ignore any new requests to stop */
2187 + if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
2188 + spin_unlock_bh(&sta->lock);
2189 + return -EALREADY;
2190 + }
2191 +
2192 if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) {
2193 /* not even started yet! */
2194 ieee80211_assign_tid_tx(sta, tid, NULL);
2195 @@ -170,6 +176,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
2196 return 0;
2197 }
2198
2199 + set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state);
2200 +
2201 spin_unlock_bh(&sta->lock);
2202
2203 #ifdef CONFIG_MAC80211_HT_DEBUG
2204 @@ -177,8 +185,6 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
2205 sta->sta.addr, tid);
2206 #endif /* CONFIG_MAC80211_HT_DEBUG */
2207
2208 - set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state);
2209 -
2210 del_timer_sync(&tid_tx->addba_resp_timer);
2211
2212 /*
2213 @@ -188,6 +194,20 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
2214 */
2215 clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state);
2216
2217 + /*
2218 + * There might be a few packets being processed right now (on
2219 + * another CPU) that have already gotten past the aggregation
2220 + * check when it was still OPERATIONAL and consequently have
2221 + * IEEE80211_TX_CTL_AMPDU set. In that case, this code might
2222 + * call into the driver at the same time or even before the
2223 + * TX paths calls into it, which could confuse the driver.
2224 + *
2225 + * Wait for all currently running TX paths to finish before
2226 + * telling the driver. New packets will not go through since
2227 + * the aggregation session is no longer OPERATIONAL.
2228 + */
2229 + synchronize_net();
2230 +
2231 tid_tx->stop_initiator = initiator;
2232 tid_tx->tx_stop = tx;
2233
2234 diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
2235 index 72abb73..ea75079 100644
2236 --- a/net/sunrpc/xprtsock.c
2237 +++ b/net/sunrpc/xprtsock.c
2238 @@ -485,7 +485,7 @@ static int xs_nospace(struct rpc_task *task)
2239 struct rpc_rqst *req = task->tk_rqstp;
2240 struct rpc_xprt *xprt = req->rq_xprt;
2241 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
2242 - int ret = 0;
2243 + int ret = -EAGAIN;
2244
2245 dprintk("RPC: %5u xmit incomplete (%u left of %u)\n",
2246 task->tk_pid, req->rq_slen - req->rq_bytes_sent,
2247 @@ -497,7 +497,6 @@ static int xs_nospace(struct rpc_task *task)
2248 /* Don't race with disconnect */
2249 if (xprt_connected(xprt)) {
2250 if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) {
2251 - ret = -EAGAIN;
2252 /*
2253 * Notify TCP that we're limited by the application
2254 * window size
2255 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
2256 index 3dac76f..0c2b808 100644
2257 --- a/net/wireless/nl80211.c
2258 +++ b/net/wireless/nl80211.c
2259 @@ -83,8 +83,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
2260 [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 },
2261 [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 },
2262
2263 - [NL80211_ATTR_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN },
2264 - [NL80211_ATTR_PREV_BSSID] = { .type = NLA_BINARY, .len = ETH_ALEN },
2265 + [NL80211_ATTR_MAC] = { .len = ETH_ALEN },
2266 + [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN },
2267
2268 [NL80211_ATTR_KEY] = { .type = NLA_NESTED, },
2269 [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY,
2270 diff --git a/net/wireless/reg.c b/net/wireless/reg.c
2271 index 213103e..ca76d8b 100644
2272 --- a/net/wireless/reg.c
2273 +++ b/net/wireless/reg.c
2274 @@ -57,8 +57,17 @@
2275 #define REG_DBG_PRINT(args...)
2276 #endif
2277
2278 +static struct regulatory_request core_request_world = {
2279 + .initiator = NL80211_REGDOM_SET_BY_CORE,
2280 + .alpha2[0] = '0',
2281 + .alpha2[1] = '0',
2282 + .intersect = false,
2283 + .processed = true,
2284 + .country_ie_env = ENVIRON_ANY,
2285 +};
2286 +
2287 /* Receipt of information from last regulatory request */
2288 -static struct regulatory_request *last_request;
2289 +static struct regulatory_request *last_request = &core_request_world;
2290
2291 /* To trigger userspace events */
2292 static struct platform_device *reg_pdev;
2293 @@ -150,7 +159,7 @@ static char user_alpha2[2];
2294 module_param(ieee80211_regdom, charp, 0444);
2295 MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
2296
2297 -static void reset_regdomains(void)
2298 +static void reset_regdomains(bool full_reset)
2299 {
2300 /* avoid freeing static information or freeing something twice */
2301 if (cfg80211_regdomain == cfg80211_world_regdom)
2302 @@ -165,6 +174,13 @@ static void reset_regdomains(void)
2303
2304 cfg80211_world_regdom = &world_regdom;
2305 cfg80211_regdomain = NULL;
2306 +
2307 + if (!full_reset)
2308 + return;
2309 +
2310 + if (last_request != &core_request_world)
2311 + kfree(last_request);
2312 + last_request = &core_request_world;
2313 }
2314
2315 /*
2316 @@ -175,7 +191,7 @@ static void update_world_regdomain(const struct ieee80211_regdomain *rd)
2317 {
2318 BUG_ON(!last_request);
2319
2320 - reset_regdomains();
2321 + reset_regdomains(false);
2322
2323 cfg80211_world_regdom = rd;
2324 cfg80211_regdomain = rd;
2325 @@ -1396,7 +1412,8 @@ static int __regulatory_hint(struct wiphy *wiphy,
2326 }
2327
2328 new_request:
2329 - kfree(last_request);
2330 + if (last_request != &core_request_world)
2331 + kfree(last_request);
2332
2333 last_request = pending_request;
2334 last_request->intersect = intersect;
2335 @@ -1566,9 +1583,6 @@ static int regulatory_hint_core(const char *alpha2)
2336 {
2337 struct regulatory_request *request;
2338
2339 - kfree(last_request);
2340 - last_request = NULL;
2341 -
2342 request = kzalloc(sizeof(struct regulatory_request),
2343 GFP_KERNEL);
2344 if (!request)
2345 @@ -1766,7 +1780,7 @@ static void restore_regulatory_settings(bool reset_user)
2346 mutex_lock(&cfg80211_mutex);
2347 mutex_lock(&reg_mutex);
2348
2349 - reset_regdomains();
2350 + reset_regdomains(true);
2351 restore_alpha2(alpha2, reset_user);
2352
2353 /*
2354 @@ -2026,12 +2040,18 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2355 }
2356
2357 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
2358 + if (!request_wiphy &&
2359 + (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
2360 + last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
2361 + schedule_delayed_work(&reg_timeout, 0);
2362 + return -ENODEV;
2363 + }
2364
2365 if (!last_request->intersect) {
2366 int r;
2367
2368 if (last_request->initiator != NL80211_REGDOM_SET_BY_DRIVER) {
2369 - reset_regdomains();
2370 + reset_regdomains(false);
2371 cfg80211_regdomain = rd;
2372 return 0;
2373 }
2374 @@ -2052,7 +2072,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2375 if (r)
2376 return r;
2377
2378 - reset_regdomains();
2379 + reset_regdomains(false);
2380 cfg80211_regdomain = rd;
2381 return 0;
2382 }
2383 @@ -2077,7 +2097,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2384
2385 rd = NULL;
2386
2387 - reset_regdomains();
2388 + reset_regdomains(false);
2389 cfg80211_regdomain = intersected_rd;
2390
2391 return 0;
2392 @@ -2097,7 +2117,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2393 kfree(rd);
2394 rd = NULL;
2395
2396 - reset_regdomains();
2397 + reset_regdomains(false);
2398 cfg80211_regdomain = intersected_rd;
2399
2400 return 0;
2401 @@ -2250,11 +2270,8 @@ void /* __init_or_exit */ regulatory_exit(void)
2402 mutex_lock(&cfg80211_mutex);
2403 mutex_lock(&reg_mutex);
2404
2405 - reset_regdomains();
2406 -
2407 - kfree(last_request);
2408 + reset_regdomains(true);
2409
2410 - last_request = NULL;
2411 dev_set_uevent_suppress(&reg_pdev->dev, true);
2412
2413 platform_device_unregister(reg_pdev);
2414 diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
2415 index 617f98b..713f798 100644
2416 --- a/sound/pci/lx6464es/lx_core.c
2417 +++ b/sound/pci/lx6464es/lx_core.c
2418 @@ -80,8 +80,12 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port)
2419
2420 void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len)
2421 {
2422 - void __iomem *address = lx_dsp_register(chip, port);
2423 - memcpy_fromio(data, address, len*sizeof(u32));
2424 + u32 __iomem *address = lx_dsp_register(chip, port);
2425 + int i;
2426 +
2427 + /* we cannot use memcpy_fromio */
2428 + for (i = 0; i != len; ++i)
2429 + data[i] = ioread32(address + i);
2430 }
2431
2432
2433 @@ -94,8 +98,12 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data)
2434 void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
2435 u32 len)
2436 {
2437 - void __iomem *address = lx_dsp_register(chip, port);
2438 - memcpy_toio(address, data, len*sizeof(u32));
2439 + u32 __iomem *address = lx_dsp_register(chip, port);
2440 + int i;
2441 +
2442 + /* we cannot use memcpy_to */
2443 + for (i = 0; i != len; ++i)
2444 + iowrite32(data[i], address + i);
2445 }
2446
2447
2448 diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
2449 index 76b4361..f5a0ec4 100644
2450 --- a/sound/soc/codecs/wm8731.c
2451 +++ b/sound/soc/codecs/wm8731.c
2452 @@ -463,6 +463,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
2453 snd_soc_write(codec, WM8731_PWR, 0xffff);
2454 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
2455 wm8731->supplies);
2456 + codec->cache_sync = 1;
2457 break;
2458 }
2459 codec->dapm.bias_level = level;
2460 diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
2461 index aa091a0..66d18a3 100644
2462 --- a/sound/soc/codecs/wm8753.c
2463 +++ b/sound/soc/codecs/wm8753.c
2464 @@ -189,6 +189,9 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
2465 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
2466 u16 ioctl;
2467
2468 + if (wm8753->dai_func == ucontrol->value.integer.value[0])
2469 + return 0;
2470 +
2471 if (codec->active)
2472 return -EBUSY;
2473
2474 diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
2475 index 313e0cc..bd811a0 100644
2476 --- a/sound/soc/fsl/fsl_ssi.c
2477 +++ b/sound/soc/fsl/fsl_ssi.c
2478 @@ -698,6 +698,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
2479
2480 /* Initialize the the device_attribute structure */
2481 dev_attr = &ssi_private->dev_attr;
2482 + sysfs_attr_init(&dev_attr->attr);
2483 dev_attr->attr.name = "statistics";
2484 dev_attr->attr.mode = S_IRUGO;
2485 dev_attr->show = fsl_sysfs_ssi_show;
2486 diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
2487 index 0a7ed5b..6c164dc 100644
2488 --- a/tools/perf/util/trace-event-parse.c
2489 +++ b/tools/perf/util/trace-event-parse.c
2490 @@ -1537,6 +1537,8 @@ process_flags(struct event *event, struct print_arg *arg, char **tok)
2491 field = malloc_or_die(sizeof(*field));
2492
2493 type = process_arg(event, field, &token);
2494 + while (type == EVENT_OP)
2495 + type = process_op(event, field, &token);
2496 if (test_type_token(type, token, EVENT_DELIM, ","))
2497 goto out_free;
2498

  ViewVC Help
Powered by ViewVC 1.1.20