Gentoo Archives: gentoo-commits

From: "Tom Wijsman (tomwij)" <tomwij@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r2291 - in genpatches-2.6/trunk: 3.0 3.2 3.4
Date: Thu, 28 Feb 2013 19:14:58
Message-Id: 20130228191453.ECF6C2171D@flycatcher.gentoo.org
1 Author: tomwij
2 Date: 2013-02-28 19:13:50 +0000 (Thu, 28 Feb 2013)
3 New Revision: 2291
4
5 Added:
6 genpatches-2.6/trunk/3.0/1065_linux-3.0.66.patch
7 genpatches-2.6/trunk/3.0/1066_linux-3.0.67.patch
8 genpatches-2.6/trunk/3.2/1038_linux-3.2.39.patch
9 genpatches-2.6/trunk/3.4/1032_linux-3.4.33.patch
10 genpatches-2.6/trunk/3.4/1033_linux-3.4.34.patch
11 Modified:
12 genpatches-2.6/trunk/3.0/0000_README
13 genpatches-2.6/trunk/3.2/0000_README
14 genpatches-2.6/trunk/3.4/0000_README
15 Log:
16 Linux patches 3.0.66 to 3.0.67, 3.2.39 and 3.4.33 to 3.4.34.
17
18 Modified: genpatches-2.6/trunk/3.0/0000_README
19 ===================================================================
20 --- genpatches-2.6/trunk/3.0/0000_README 2013-02-23 19:07:21 UTC (rev 2290)
21 +++ genpatches-2.6/trunk/3.0/0000_README 2013-02-28 19:13:50 UTC (rev 2291)
22 @@ -295,6 +295,14 @@
23 From: http://www.kernel.org
24 Desc: Linux 3.0.65
25
26 +Patch: 1065_linux-3.0.66.patch
27 +From: http://www.kernel.org
28 +Desc: Linux 3.0.66
29 +
30 +Patch: 1066_linux-3.0.67.patch
31 +From: http://www.kernel.org
32 +Desc: Linux 3.0.67
33 +
34 Patch: 1800_fix-zcache-build.patch
35 From: http://bugs.gentoo.org/show_bug.cgi?id=376325
36 Desc: Fix zcache build error
37
38 Added: genpatches-2.6/trunk/3.0/1065_linux-3.0.66.patch
39 ===================================================================
40 --- genpatches-2.6/trunk/3.0/1065_linux-3.0.66.patch (rev 0)
41 +++ genpatches-2.6/trunk/3.0/1065_linux-3.0.66.patch 2013-02-28 19:13:50 UTC (rev 2291)
42 @@ -0,0 +1,54 @@
43 +diff --git a/Makefile b/Makefile
44 +index cdba5c1..da3ff21 100644
45 +--- a/Makefile
46 ++++ b/Makefile
47 +@@ -1,6 +1,6 @@
48 + VERSION = 3
49 + PATCHLEVEL = 0
50 +-SUBLEVEL = 65
51 ++SUBLEVEL = 66
52 + EXTRAVERSION =
53 + NAME = Sneaky Weasel
54 +
55 +diff --git a/include/linux/syslog.h b/include/linux/syslog.h
56 +index 3891139..ce4c665 100644
57 +--- a/include/linux/syslog.h
58 ++++ b/include/linux/syslog.h
59 +@@ -47,6 +47,12 @@
60 + #define SYSLOG_FROM_CALL 0
61 + #define SYSLOG_FROM_FILE 1
62 +
63 ++/*
64 ++ * Syslog priority (PRI) maximum length in char : '<[0-9]{1,3}>'
65 ++ * See RFC5424 for details
66 ++*/
67 ++#define SYSLOG_PRI_MAX_LENGTH 5
68 ++
69 + int do_syslog(int type, char __user *buf, int count, bool from_file);
70 +
71 + #endif /* _LINUX_SYSLOG_H */
72 +diff --git a/kernel/printk.c b/kernel/printk.c
73 +index 3fc4708..6edc4e89 100644
74 +--- a/kernel/printk.c
75 ++++ b/kernel/printk.c
76 +@@ -633,8 +633,19 @@ static void call_console_drivers(unsigned start, unsigned end)
77 + start_print = start;
78 + while (cur_index != end) {
79 + if (msg_level < 0 && ((end - cur_index) > 2)) {
80 ++ /*
81 ++ * prepare buf_prefix, as a contiguous array,
82 ++ * to be processed by log_prefix function
83 ++ */
84 ++ char buf_prefix[SYSLOG_PRI_MAX_LENGTH+1];
85 ++ unsigned i;
86 ++ for (i = 0; i < ((end - cur_index)) && (i < SYSLOG_PRI_MAX_LENGTH); i++) {
87 ++ buf_prefix[i] = LOG_BUF(cur_index + i);
88 ++ }
89 ++ buf_prefix[i] = '\0'; /* force '\0' as last string character */
90 ++
91 + /* strip log prefix */
92 +- cur_index += log_prefix(&LOG_BUF(cur_index), &msg_level, NULL);
93 ++ cur_index += log_prefix((const char *)&buf_prefix, &msg_level, NULL);
94 + start_print = cur_index;
95 + }
96 + while (cur_index != end) {
97
98 Added: genpatches-2.6/trunk/3.0/1066_linux-3.0.67.patch
99 ===================================================================
100 --- genpatches-2.6/trunk/3.0/1066_linux-3.0.67.patch (rev 0)
101 +++ genpatches-2.6/trunk/3.0/1066_linux-3.0.67.patch 2013-02-28 19:13:50 UTC (rev 2291)
102 @@ -0,0 +1,2195 @@
103 +diff --git a/Makefile b/Makefile
104 +index da3ff21..7d4347a 100644
105 +--- a/Makefile
106 ++++ b/Makefile
107 +@@ -1,6 +1,6 @@
108 + VERSION = 3
109 + PATCHLEVEL = 0
110 +-SUBLEVEL = 66
111 ++SUBLEVEL = 67
112 + EXTRAVERSION =
113 + NAME = Sneaky Weasel
114 +
115 +diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h
116 +index 654adc9..301bf0e 100644
117 +--- a/arch/arm/mach-pxa/include/mach/smemc.h
118 ++++ b/arch/arm/mach-pxa/include/mach/smemc.h
119 +@@ -37,6 +37,7 @@
120 + #define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
121 + #define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
122 + #define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
123 ++#define CSMSADRCFG (SMEMC_VIRT + 0xA0) /* Chip Select Configuration Register */
124 +
125 + /*
126 + * More handy macros for PCMCIA
127 +diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
128 +index 7992305..f38aa89 100644
129 +--- a/arch/arm/mach-pxa/smemc.c
130 ++++ b/arch/arm/mach-pxa/smemc.c
131 +@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)
132 + __raw_writel(csadrcfg[1], CSADRCFG1);
133 + __raw_writel(csadrcfg[2], CSADRCFG2);
134 + __raw_writel(csadrcfg[3], CSADRCFG3);
135 ++ /* CSMSADRCFG wakes up in its default state (0), so we need to set it */
136 ++ __raw_writel(0x2, CSMSADRCFG);
137 + }
138 +
139 + static struct syscore_ops smemc_syscore_ops = {
140 +@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {
141 +
142 + static int __init smemc_init(void)
143 + {
144 +- if (cpu_is_pxa3xx())
145 ++ if (cpu_is_pxa3xx()) {
146 ++ /*
147 ++ * The only documentation we have on the
148 ++ * Chip Select Configuration Register (CSMSADRCFG) is that
149 ++ * it must be programmed to 0x2.
150 ++ * Moreover, in the bit definitions, the second bit
151 ++ * (CSMSADRCFG[1]) is called "SETALWAYS".
152 ++ * Other bits are reserved in this register.
153 ++ */
154 ++ __raw_writel(0x2, CSMSADRCFG);
155 ++
156 + register_syscore_ops(&smemc_syscore_ops);
157 ++ }
158 +
159 + return 0;
160 + }
161 +diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
162 +index 22dadeb..9d35a3e 100644
163 +--- a/arch/parisc/include/asm/pgtable.h
164 ++++ b/arch/parisc/include/asm/pgtable.h
165 +@@ -12,11 +12,10 @@
166 +
167 + #include <linux/bitops.h>
168 + #include <linux/spinlock.h>
169 ++#include <linux/mm_types.h>
170 + #include <asm/processor.h>
171 + #include <asm/cache.h>
172 +
173 +-struct vm_area_struct;
174 +-
175 + /*
176 + * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
177 + * memory. For the return value to be meaningful, ADDR must be >=
178 +@@ -40,7 +39,14 @@ struct vm_area_struct;
179 + do{ \
180 + *(pteptr) = (pteval); \
181 + } while(0)
182 +-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
183 ++
184 ++extern void purge_tlb_entries(struct mm_struct *, unsigned long);
185 ++
186 ++#define set_pte_at(mm, addr, ptep, pteval) \
187 ++ do { \
188 ++ set_pte(ptep, pteval); \
189 ++ purge_tlb_entries(mm, addr); \
190 ++ } while (0)
191 +
192 + #endif /* !__ASSEMBLY__ */
193 +
194 +@@ -464,6 +470,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
195 + old = pte_val(*ptep);
196 + new = pte_val(pte_wrprotect(__pte (old)));
197 + } while (cmpxchg((unsigned long *) ptep, old, new) != old);
198 ++ purge_tlb_entries(mm, addr);
199 + #else
200 + pte_t old_pte = *ptep;
201 + set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
202 +diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
203 +index 83335f3..5241698 100644
204 +--- a/arch/parisc/kernel/cache.c
205 ++++ b/arch/parisc/kernel/cache.c
206 +@@ -421,6 +421,24 @@ void kunmap_parisc(void *addr)
207 + EXPORT_SYMBOL(kunmap_parisc);
208 + #endif
209 +
210 ++void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
211 ++{
212 ++ unsigned long flags;
213 ++
214 ++ /* Note: purge_tlb_entries can be called at startup with
215 ++ no context. */
216 ++
217 ++ /* Disable preemption while we play with %sr1. */
218 ++ preempt_disable();
219 ++ mtsp(mm->context, 1);
220 ++ purge_tlb_start(flags);
221 ++ pdtlb(addr);
222 ++ pitlb(addr);
223 ++ purge_tlb_end(flags);
224 ++ preempt_enable();
225 ++}
226 ++EXPORT_SYMBOL(purge_tlb_entries);
227 ++
228 + void __flush_tlb_range(unsigned long sid, unsigned long start,
229 + unsigned long end)
230 + {
231 +diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
232 +index 583af70..cac9d2c 100644
233 +--- a/arch/powerpc/kernel/machine_kexec_64.c
234 ++++ b/arch/powerpc/kernel/machine_kexec_64.c
235 +@@ -163,6 +163,8 @@ static int kexec_all_irq_disabled = 0;
236 + static void kexec_smp_down(void *arg)
237 + {
238 + local_irq_disable();
239 ++ hard_irq_disable();
240 ++
241 + mb(); /* make sure our irqs are disabled before we say they are */
242 + get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
243 + while(kexec_all_irq_disabled == 0)
244 +@@ -245,6 +247,8 @@ static void kexec_prepare_cpus(void)
245 + wake_offline_cpus();
246 + smp_call_function(kexec_smp_down, NULL, /* wait */0);
247 + local_irq_disable();
248 ++ hard_irq_disable();
249 ++
250 + mb(); /* make sure IRQs are disabled before we say they are */
251 + get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
252 +
253 +@@ -282,6 +286,7 @@ static void kexec_prepare_cpus(void)
254 + if (ppc_md.kexec_cpu_down)
255 + ppc_md.kexec_cpu_down(0, 0);
256 + local_irq_disable();
257 ++ hard_irq_disable();
258 + }
259 +
260 + #endif /* SMP */
261 +diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
262 +index 2ada634..25ab200 100644
263 +--- a/arch/s390/kvm/kvm-s390.c
264 ++++ b/arch/s390/kvm/kvm-s390.c
265 +@@ -584,6 +584,14 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
266 + } else
267 + prefix = 0;
268 +
269 ++ /*
270 ++ * The guest FPRS and ACRS are in the host FPRS/ACRS due to the lazy
271 ++ * copying in vcpu load/put. Lets update our copies before we save
272 ++ * it into the save area
273 ++ */
274 ++ save_fp_regs(&vcpu->arch.guest_fpregs);
275 ++ save_access_regs(vcpu->run->s.regs.acrs);
276 ++
277 + if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs),
278 + vcpu->arch.guest_fpregs.fprs, 128, prefix))
279 + return -EFAULT;
280 +diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h
281 +index ffa037f..a6a6414 100644
282 +--- a/arch/x86/include/asm/mmzone_32.h
283 ++++ b/arch/x86/include/asm/mmzone_32.h
284 +@@ -14,12 +14,6 @@ extern struct pglist_data *node_data[];
285 +
286 + #include <asm/numaq.h>
287 +
288 +-extern void resume_map_numa_kva(pgd_t *pgd);
289 +-
290 +-#else /* !CONFIG_NUMA */
291 +-
292 +-static inline void resume_map_numa_kva(pgd_t *pgd) {}
293 +-
294 + #endif /* CONFIG_NUMA */
295 +
296 + #ifdef CONFIG_DISCONTIGMEM
297 +diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
298 +index 3769079..a09ecb9 100644
299 +--- a/arch/x86/power/hibernate_32.c
300 ++++ b/arch/x86/power/hibernate_32.c
301 +@@ -130,8 +130,6 @@ static int resume_physical_mapping_init(pgd_t *pgd_base)
302 + }
303 + }
304 +
305 +- resume_map_numa_kva(pgd_base);
306 +-
307 + return 0;
308 + }
309 +
310 +diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
311 +index cc9b1e1..d99537f 100644
312 +--- a/arch/x86/xen/spinlock.c
313 ++++ b/arch/x86/xen/spinlock.c
314 +@@ -313,7 +313,6 @@ static noinline void xen_spin_unlock_slow(struct xen_spinlock *xl)
315 + if (per_cpu(lock_spinners, cpu) == xl) {
316 + ADD_STATS(released_slow_kicked, 1);
317 + xen_send_IPI_one(cpu, XEN_SPIN_UNLOCK_VECTOR);
318 +- break;
319 + }
320 + }
321 + }
322 +diff --git a/drivers/base/bus.c b/drivers/base/bus.c
323 +index 000e7b2..8b8e8c0 100644
324 +--- a/drivers/base/bus.c
325 ++++ b/drivers/base/bus.c
326 +@@ -289,7 +289,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,
327 + struct device *dev;
328 + int error = 0;
329 +
330 +- if (!bus)
331 ++ if (!bus || !bus->p)
332 + return -EINVAL;
333 +
334 + klist_iter_init_node(&bus->p->klist_devices, &i,
335 +@@ -323,7 +323,7 @@ struct device *bus_find_device(struct bus_type *bus,
336 + struct klist_iter i;
337 + struct device *dev;
338 +
339 +- if (!bus)
340 ++ if (!bus || !bus->p)
341 + return NULL;
342 +
343 + klist_iter_init_node(&bus->p->klist_devices, &i,
344 +diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
345 +index 48e8fee..94f6ae2 100644
346 +--- a/drivers/block/sunvdc.c
347 ++++ b/drivers/block/sunvdc.c
348 +@@ -461,7 +461,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
349 + int op_len, err;
350 + void *req_buf;
351 +
352 +- if (!(((u64)1 << ((u64)op - 1)) & port->operations))
353 ++ if (!(((u64)1 << (u64)op) & port->operations))
354 + return -EOPNOTSUPP;
355 +
356 + switch (op) {
357 +diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c
358 +index 4abd089..7065851 100644
359 +--- a/drivers/dca/dca-core.c
360 ++++ b/drivers/dca/dca-core.c
361 +@@ -409,6 +409,11 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
362 +
363 + spin_lock_irqsave(&dca_lock, flags);
364 +
365 ++ if (list_empty(&dca_domains)) {
366 ++ raw_spin_unlock_irqrestore(&dca_lock, flags);
367 ++ return;
368 ++ }
369 ++
370 + list_del(&dca->node);
371 +
372 + pci_rc = dca_pci_rc_from_dev(dev);
373 +diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c
374 +index 206d230..0c853f5 100644
375 +--- a/drivers/gpu/drm/drm_usb.c
376 ++++ b/drivers/gpu/drm/drm_usb.c
377 +@@ -18,7 +18,7 @@ int drm_get_usb_dev(struct usb_interface *interface,
378 +
379 + usbdev = interface_to_usbdev(interface);
380 + dev->usbdev = usbdev;
381 +- dev->dev = &usbdev->dev;
382 ++ dev->dev = &interface->dev;
383 +
384 + mutex_lock(&drm_global_mutex);
385 +
386 +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
387 +index b4f4d12..11ecb0c 100644
388 +--- a/drivers/gpu/drm/i915/intel_display.c
389 ++++ b/drivers/gpu/drm/i915/intel_display.c
390 +@@ -2898,6 +2898,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
391 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
392 + int pipe = intel_crtc->pipe;
393 + int plane = intel_crtc->plane;
394 ++ u32 pctl;
395 +
396 + if (!intel_crtc->active)
397 + return;
398 +@@ -2914,6 +2915,13 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
399 +
400 + intel_disable_plane(dev_priv, plane, pipe);
401 + intel_disable_pipe(dev_priv, pipe);
402 ++
403 ++ /* Disable pannel fitter if it is on this pipe. */
404 ++ pctl = I915_READ(PFIT_CONTROL);
405 ++ if ((pctl & PFIT_ENABLE) &&
406 ++ ((pctl & PFIT_PIPE_MASK) >> PFIT_PIPE_SHIFT) == pipe)
407 ++ I915_WRITE(PFIT_CONTROL, 0);
408 ++
409 + intel_disable_pll(dev_priv, pipe);
410 +
411 + intel_crtc->active = false;
412 +diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
413 +index f1fa763..99e7e7f 100644
414 +--- a/drivers/net/wireless/p54/p54usb.c
415 ++++ b/drivers/net/wireless/p54/p54usb.c
416 +@@ -83,8 +83,8 @@ static struct usb_device_id p54u_table[] = {
417 + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
418 + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
419 + {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
420 +- {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
421 + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
422 ++ {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */
423 + {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
424 + {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
425 + {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
426 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
427 +index 5925e0b..8eaf0e2 100644
428 +--- a/drivers/net/xen-netback/interface.c
429 ++++ b/drivers/net/xen-netback/interface.c
430 +@@ -132,6 +132,7 @@ static void xenvif_up(struct xenvif *vif)
431 + static void xenvif_down(struct xenvif *vif)
432 + {
433 + disable_irq(vif->irq);
434 ++ del_timer_sync(&vif->credit_timeout);
435 + xen_netbk_deschedule_xenvif(vif);
436 + xen_netbk_remove_xenvif(vif);
437 + }
438 +@@ -362,8 +363,6 @@ void xenvif_disconnect(struct xenvif *vif)
439 + atomic_dec(&vif->refcnt);
440 + wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0);
441 +
442 +- del_timer_sync(&vif->credit_timeout);
443 +-
444 + if (vif->irq)
445 + unbind_from_irqhandler(vif->irq, vif);
446 +
447 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
448 +index 9068d32..1260bf0 100644
449 +--- a/drivers/net/xen-netback/netback.c
450 ++++ b/drivers/net/xen-netback/netback.c
451 +@@ -870,13 +870,13 @@ static int netbk_count_requests(struct xenvif *vif,
452 + if (frags >= work_to_do) {
453 + netdev_err(vif->dev, "Need more frags\n");
454 + netbk_fatal_tx_err(vif);
455 +- return -frags;
456 ++ return -ENODATA;
457 + }
458 +
459 + if (unlikely(frags >= MAX_SKB_FRAGS)) {
460 + netdev_err(vif->dev, "Too many frags\n");
461 + netbk_fatal_tx_err(vif);
462 +- return -frags;
463 ++ return -E2BIG;
464 + }
465 +
466 + memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags),
467 +@@ -884,7 +884,7 @@ static int netbk_count_requests(struct xenvif *vif,
468 + if (txp->size > first->size) {
469 + netdev_err(vif->dev, "Frag is bigger than frame.\n");
470 + netbk_fatal_tx_err(vif);
471 +- return -frags;
472 ++ return -EIO;
473 + }
474 +
475 + first->size -= txp->size;
476 +@@ -894,7 +894,7 @@ static int netbk_count_requests(struct xenvif *vif,
477 + netdev_err(vif->dev, "txp->offset: %x, size: %u\n",
478 + txp->offset, txp->size);
479 + netbk_fatal_tx_err(vif);
480 +- return -frags;
481 ++ return -EINVAL;
482 + }
483 + } while ((txp++)->flags & XEN_NETTXF_more_data);
484 + return frags;
485 +@@ -990,7 +990,7 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
486 + xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);
487 +
488 + /* Skip first skb fragment if it is on same page as header fragment. */
489 +- start = ((unsigned long)shinfo->frags[i].page == pending_idx);
490 ++ start = ((unsigned long)shinfo->frags[0].page == pending_idx);
491 +
492 + for (i = start; i < nr_frags; i++) {
493 + int j, newerr;
494 +diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
495 +index 86e4a1a..6bb02ab 100644
496 +--- a/drivers/pcmcia/vrc4171_card.c
497 ++++ b/drivers/pcmcia/vrc4171_card.c
498 +@@ -246,6 +246,7 @@ static int pccard_init(struct pcmcia_socket *sock)
499 + socket = &vrc4171_sockets[slot];
500 + socket->csc_irq = search_nonuse_irq();
501 + socket->io_irq = search_nonuse_irq();
502 ++ spin_lock_init(&socket->lock);
503 +
504 + return 0;
505 + }
506 +diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
507 +index aec60d5..481037d 100644
508 +--- a/drivers/s390/kvm/kvm_virtio.c
509 ++++ b/drivers/s390/kvm/kvm_virtio.c
510 +@@ -413,6 +413,26 @@ static void kvm_extint_handler(unsigned int ext_int_code,
511 + }
512 +
513 + /*
514 ++ * For s390-virtio, we expect a page above main storage containing
515 ++ * the virtio configuration. Try to actually load from this area
516 ++ * in order to figure out if the host provides this page.
517 ++ */
518 ++static int __init test_devices_support(unsigned long addr)
519 ++{
520 ++ int ret = -EIO;
521 ++
522 ++ asm volatile(
523 ++ "0: lura 0,%1\n"
524 ++ "1: xgr %0,%0\n"
525 ++ "2:\n"
526 ++ EX_TABLE(0b,2b)
527 ++ EX_TABLE(1b,2b)
528 ++ : "+d" (ret)
529 ++ : "a" (addr)
530 ++ : "0", "cc");
531 ++ return ret;
532 ++}
533 ++/*
534 + * Init function for virtio
535 + * devices are in a single page above top of "normal" mem
536 + */
537 +@@ -423,21 +443,23 @@ static int __init kvm_devices_init(void)
538 + if (!MACHINE_IS_KVM)
539 + return -ENODEV;
540 +
541 ++ if (test_devices_support(real_memory_size) < 0)
542 ++ return -ENODEV;
543 ++
544 ++ rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
545 ++ if (rc)
546 ++ return rc;
547 ++
548 ++ kvm_devices = (void *) real_memory_size;
549 ++
550 + kvm_root = root_device_register("kvm_s390");
551 + if (IS_ERR(kvm_root)) {
552 + rc = PTR_ERR(kvm_root);
553 + printk(KERN_ERR "Could not register kvm_s390 root device");
554 ++ vmem_remove_mapping(real_memory_size, PAGE_SIZE);
555 + return rc;
556 + }
557 +
558 +- rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
559 +- if (rc) {
560 +- root_device_unregister(kvm_root);
561 +- return rc;
562 +- }
563 +-
564 +- kvm_devices = (void *) real_memory_size;
565 +-
566 + INIT_WORK(&hotplug_work, hotplug_devices);
567 +
568 + service_subclass_irq_register();
569 +diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
570 +index 39be673..4b9d8f0 100644
571 +--- a/drivers/staging/comedi/comedi_fops.c
572 ++++ b/drivers/staging/comedi/comedi_fops.c
573 +@@ -136,6 +136,11 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
574 + /* Device config is special, because it must work on
575 + * an unconfigured device. */
576 + if (cmd == COMEDI_DEVCONFIG) {
577 ++ if (minor >= COMEDI_NUM_BOARD_MINORS) {
578 ++ /* Device config not appropriate on non-board minors. */
579 ++ rc = -ENOTTY;
580 ++ goto done;
581 ++ }
582 + rc = do_devconfig_ioctl(dev,
583 + (struct comedi_devconfig __user *)arg);
584 + if (rc == 0)
585 +diff --git a/drivers/staging/hv/hv_kvp.c b/drivers/staging/hv/hv_kvp.c
586 +index 13b0ecf..9f8efd4 100644
587 +--- a/drivers/staging/hv/hv_kvp.c
588 ++++ b/drivers/staging/hv/hv_kvp.c
589 +@@ -201,11 +201,13 @@ kvp_respond_to_host(char *key, char *value, int error)
590 + * The windows host expects the key/value pair to be encoded
591 + * in utf16.
592 + */
593 +- keylen = utf8s_to_utf16s(key_name, strlen(key_name),
594 +- (wchar_t *)kvp_data->data.key);
595 ++ keylen = utf8s_to_utf16s(key_name, strlen(key_name), UTF16_HOST_ENDIAN,
596 ++ (wchar_t *) kvp_data->data.key,
597 ++ HV_KVP_EXCHANGE_MAX_KEY_SIZE / 2);
598 + kvp_data->data.key_size = 2*(keylen + 1); /* utf16 encoding */
599 +- valuelen = utf8s_to_utf16s(value, strlen(value),
600 +- (wchar_t *)kvp_data->data.value);
601 ++ valuelen = utf8s_to_utf16s(value, strlen(value), UTF16_HOST_ENDIAN,
602 ++ (wchar_t *) kvp_data->data.value,
603 ++ HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2);
604 + kvp_data->data.value_size = 2*(valuelen + 1); /* utf16 encoding */
605 +
606 + kvp_data->data.value_type = REG_SZ; /* all our values are strings */
607 +diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
608 +index c612ab5..f759352 100644
609 +--- a/drivers/staging/vt6656/usbpipe.c
610 ++++ b/drivers/staging/vt6656/usbpipe.c
611 +@@ -168,6 +168,11 @@ int PIPEnsControlOut(
612 + if (pDevice->Flags & fMP_CONTROL_WRITES)
613 + return STATUS_FAILURE;
614 +
615 ++ if (pDevice->Flags & fMP_CONTROL_READS)
616 ++ return STATUS_FAILURE;
617 ++
618 ++ MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
619 ++
620 + pDevice->sUsbCtlRequest.bRequestType = 0x40;
621 + pDevice->sUsbCtlRequest.bRequest = byRequest;
622 + pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
623 +@@ -182,12 +187,13 @@ int PIPEnsControlOut(
624 +
625 + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
626 + if (ntStatus != 0) {
627 +- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus);
628 ++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
629 ++ "control send request submission failed: %d\n",
630 ++ ntStatus);
631 ++ MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
632 + return STATUS_FAILURE;
633 + }
634 +- else {
635 +- MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
636 +- }
637 ++
638 + spin_unlock_irq(&pDevice->lock);
639 + for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
640 +
641 +@@ -227,6 +233,11 @@ int PIPEnsControlIn(
642 + if (pDevice->Flags & fMP_CONTROL_READS)
643 + return STATUS_FAILURE;
644 +
645 ++ if (pDevice->Flags & fMP_CONTROL_WRITES)
646 ++ return STATUS_FAILURE;
647 ++
648 ++ MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
649 ++
650 + pDevice->sUsbCtlRequest.bRequestType = 0xC0;
651 + pDevice->sUsbCtlRequest.bRequest = byRequest;
652 + pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
653 +@@ -240,10 +251,11 @@ int PIPEnsControlIn(
654 +
655 + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
656 + if (ntStatus != 0) {
657 +- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus);
658 +- }else {
659 +- MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
660 +- }
661 ++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
662 ++ "control request submission failed: %d\n", ntStatus);
663 ++ MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
664 ++ return STATUS_FAILURE;
665 ++ }
666 +
667 + spin_unlock_irq(&pDevice->lock);
668 + for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
669 +diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
670 +index 53f2442..3047873 100644
671 +--- a/drivers/tty/tty_ioctl.c
672 ++++ b/drivers/tty/tty_ioctl.c
673 +@@ -617,7 +617,7 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt)
674 + if (opt & TERMIOS_WAIT) {
675 + tty_wait_until_sent(tty, 0);
676 + if (signal_pending(current))
677 +- return -EINTR;
678 ++ return -ERESTARTSYS;
679 + }
680 +
681 + tty_set_termios(tty, &tmp_termios);
682 +@@ -684,7 +684,7 @@ static int set_termiox(struct tty_struct *tty, void __user *arg, int opt)
683 + if (opt & TERMIOS_WAIT) {
684 + tty_wait_until_sent(tty, 0);
685 + if (signal_pending(current))
686 +- return -EINTR;
687 ++ return -ERESTARTSYS;
688 + }
689 +
690 + mutex_lock(&tty->termios_mutex);
691 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
692 +index b3915b7..e41288a 100644
693 +--- a/drivers/tty/vt/vt.c
694 ++++ b/drivers/tty/vt/vt.c
695 +@@ -3016,7 +3016,7 @@ int __init vty_init(const struct file_operations *console_fops)
696 +
697 + static struct class *vtconsole_class;
698 +
699 +-static int bind_con_driver(const struct consw *csw, int first, int last,
700 ++static int do_bind_con_driver(const struct consw *csw, int first, int last,
701 + int deflt)
702 + {
703 + struct module *owner = csw->owner;
704 +@@ -3027,7 +3027,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
705 + if (!try_module_get(owner))
706 + return -ENODEV;
707 +
708 +- console_lock();
709 ++ WARN_CONSOLE_UNLOCKED();
710 +
711 + /* check if driver is registered */
712 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
713 +@@ -3112,11 +3112,22 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
714 +
715 + retval = 0;
716 + err:
717 +- console_unlock();
718 + module_put(owner);
719 + return retval;
720 + };
721 +
722 ++
723 ++static int bind_con_driver(const struct consw *csw, int first, int last,
724 ++ int deflt)
725 ++{
726 ++ int ret;
727 ++
728 ++ console_lock();
729 ++ ret = do_bind_con_driver(csw, first, last, deflt);
730 ++ console_unlock();
731 ++ return ret;
732 ++}
733 ++
734 + #ifdef CONFIG_VT_HW_CONSOLE_BINDING
735 + static int con_is_graphics(const struct consw *csw, int first, int last)
736 + {
737 +@@ -3153,6 +3164,18 @@ static int con_is_graphics(const struct consw *csw, int first, int last)
738 + */
739 + int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
740 + {
741 ++ int retval;
742 ++
743 ++ console_lock();
744 ++ retval = do_unbind_con_driver(csw, first, last, deflt);
745 ++ console_unlock();
746 ++ return retval;
747 ++}
748 ++EXPORT_SYMBOL(unbind_con_driver);
749 ++
750 ++/* unlocked version of unbind_con_driver() */
751 ++int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
752 ++{
753 + struct module *owner = csw->owner;
754 + const struct consw *defcsw = NULL;
755 + struct con_driver *con_driver = NULL, *con_back = NULL;
756 +@@ -3161,7 +3184,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
757 + if (!try_module_get(owner))
758 + return -ENODEV;
759 +
760 +- console_lock();
761 ++ WARN_CONSOLE_UNLOCKED();
762 +
763 + /* check if driver is registered and if it is unbindable */
764 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
765 +@@ -3174,10 +3197,8 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
766 + }
767 + }
768 +
769 +- if (retval) {
770 +- console_unlock();
771 ++ if (retval)
772 + goto err;
773 +- }
774 +
775 + retval = -ENODEV;
776 +
777 +@@ -3193,15 +3214,11 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
778 + }
779 + }
780 +
781 +- if (retval) {
782 +- console_unlock();
783 ++ if (retval)
784 + goto err;
785 +- }
786 +
787 +- if (!con_is_bound(csw)) {
788 +- console_unlock();
789 ++ if (!con_is_bound(csw))
790 + goto err;
791 +- }
792 +
793 + first = max(first, con_driver->first);
794 + last = min(last, con_driver->last);
795 +@@ -3228,15 +3245,14 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
796 + if (!con_is_bound(csw))
797 + con_driver->flag &= ~CON_DRIVER_FLAG_INIT;
798 +
799 +- console_unlock();
800 + /* ignore return value, binding should not fail */
801 +- bind_con_driver(defcsw, first, last, deflt);
802 ++ do_bind_con_driver(defcsw, first, last, deflt);
803 + err:
804 + module_put(owner);
805 + return retval;
806 +
807 + }
808 +-EXPORT_SYMBOL(unbind_con_driver);
809 ++EXPORT_SYMBOL_GPL(do_unbind_con_driver);
810 +
811 + static int vt_bind(struct con_driver *con)
812 + {
813 +@@ -3508,28 +3524,18 @@ int con_debug_leave(void)
814 + }
815 + EXPORT_SYMBOL_GPL(con_debug_leave);
816 +
817 +-/**
818 +- * register_con_driver - register console driver to console layer
819 +- * @csw: console driver
820 +- * @first: the first console to take over, minimum value is 0
821 +- * @last: the last console to take over, maximum value is MAX_NR_CONSOLES -1
822 +- *
823 +- * DESCRIPTION: This function registers a console driver which can later
824 +- * bind to a range of consoles specified by @first and @last. It will
825 +- * also initialize the console driver by calling con_startup().
826 +- */
827 +-int register_con_driver(const struct consw *csw, int first, int last)
828 ++static int do_register_con_driver(const struct consw *csw, int first, int last)
829 + {
830 + struct module *owner = csw->owner;
831 + struct con_driver *con_driver;
832 + const char *desc;
833 + int i, retval = 0;
834 +
835 ++ WARN_CONSOLE_UNLOCKED();
836 ++
837 + if (!try_module_get(owner))
838 + return -ENODEV;
839 +
840 +- console_lock();
841 +-
842 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
843 + con_driver = &registered_con_driver[i];
844 +
845 +@@ -3582,10 +3588,29 @@ int register_con_driver(const struct consw *csw, int first, int last)
846 + }
847 +
848 + err:
849 +- console_unlock();
850 + module_put(owner);
851 + return retval;
852 + }
853 ++
854 ++/**
855 ++ * register_con_driver - register console driver to console layer
856 ++ * @csw: console driver
857 ++ * @first: the first console to take over, minimum value is 0
858 ++ * @last: the last console to take over, maximum value is MAX_NR_CONSOLES -1
859 ++ *
860 ++ * DESCRIPTION: This function registers a console driver which can later
861 ++ * bind to a range of consoles specified by @first and @last. It will
862 ++ * also initialize the console driver by calling con_startup().
863 ++ */
864 ++int register_con_driver(const struct consw *csw, int first, int last)
865 ++{
866 ++ int retval;
867 ++
868 ++ console_lock();
869 ++ retval = do_register_con_driver(csw, first, last);
870 ++ console_unlock();
871 ++ return retval;
872 ++}
873 + EXPORT_SYMBOL(register_con_driver);
874 +
875 + /**
876 +@@ -3601,9 +3626,18 @@ EXPORT_SYMBOL(register_con_driver);
877 + */
878 + int unregister_con_driver(const struct consw *csw)
879 + {
880 +- int i, retval = -ENODEV;
881 ++ int retval;
882 +
883 + console_lock();
884 ++ retval = do_unregister_con_driver(csw);
885 ++ console_unlock();
886 ++ return retval;
887 ++}
888 ++EXPORT_SYMBOL(unregister_con_driver);
889 ++
890 ++int do_unregister_con_driver(const struct consw *csw)
891 ++{
892 ++ int i, retval = -ENODEV;
893 +
894 + /* cannot unregister a bound driver */
895 + if (con_is_bound(csw))
896 +@@ -3629,27 +3663,53 @@ int unregister_con_driver(const struct consw *csw)
897 + }
898 + }
899 + err:
900 +- console_unlock();
901 + return retval;
902 + }
903 +-EXPORT_SYMBOL(unregister_con_driver);
904 ++EXPORT_SYMBOL_GPL(do_unregister_con_driver);
905 +
906 + /*
907 + * If we support more console drivers, this function is used
908 + * when a driver wants to take over some existing consoles
909 + * and become default driver for newly opened ones.
910 + *
911 +- * take_over_console is basically a register followed by unbind
912 ++ * take_over_console is basically a register followed by unbind
913 ++ */
914 ++int do_take_over_console(const struct consw *csw, int first, int last, int deflt)
915 ++{
916 ++ int err;
917 ++
918 ++ err = do_register_con_driver(csw, first, last);
919 ++ /*
920 ++ * If we get an busy error we still want to bind the console driver
921 ++ * and return success, as we may have unbound the console driver
922 ++ * but not unregistered it.
923 ++ */
924 ++ if (err == -EBUSY)
925 ++ err = 0;
926 ++ if (!err)
927 ++ do_bind_con_driver(csw, first, last, deflt);
928 ++
929 ++ return err;
930 ++}
931 ++EXPORT_SYMBOL_GPL(do_take_over_console);
932 ++
933 ++/*
934 ++ * If we support more console drivers, this function is used
935 ++ * when a driver wants to take over some existing consoles
936 ++ * and become default driver for newly opened ones.
937 ++ *
938 ++ * take_over_console is basically a register followed by unbind
939 + */
940 + int take_over_console(const struct consw *csw, int first, int last, int deflt)
941 + {
942 + int err;
943 +
944 + err = register_con_driver(csw, first, last);
945 +- /* if we get an busy error we still want to bind the console driver
946 ++ /*
947 ++ * If we get an busy error we still want to bind the console driver
948 + * and return success, as we may have unbound the console driver
949 +-  * but not unregistered it.
950 +- */
951 ++ * but not unregistered it.
952 ++ */
953 + if (err == -EBUSY)
954 + err = 0;
955 + if (!err)
956 +diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
957 +index 55a57c2..028c572 100644
958 +--- a/drivers/usb/host/ehci-omap.c
959 ++++ b/drivers/usb/host/ehci-omap.c
960 +@@ -321,7 +321,7 @@ static const struct hc_driver ehci_omap_hc_driver = {
961 + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
962 + };
963 +
964 +-MODULE_ALIAS("platform:omap-ehci");
965 ++MODULE_ALIAS("platform:ehci-omap");
966 + MODULE_AUTHOR("Texas Instruments, Inc.");
967 + MODULE_AUTHOR("Felipe Balbi <felipe.balbi@×××××.com>");
968 +
969 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
970 +index 52cd814..24a3ea6 100644
971 +--- a/drivers/usb/serial/option.c
972 ++++ b/drivers/usb/serial/option.c
973 +@@ -479,6 +479,7 @@ static const struct option_blacklist_info four_g_w14_blacklist = {
974 +
975 + static const struct option_blacklist_info alcatel_x200_blacklist = {
976 + .sendsetup = BIT(0) | BIT(1),
977 ++ .reserved = BIT(4),
978 + };
979 +
980 + static const struct option_blacklist_info zte_0037_blacklist = {
981 +@@ -575,8 +576,14 @@ static const struct usb_device_id option_ids[] = {
982 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
983 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) },
984 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) },
985 ++ { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42),
986 ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
987 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) },
988 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
989 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
990 + .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
991 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) },
992 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) },
993 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
994 + .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
995 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
996 +@@ -1215,7 +1222,14 @@ static const struct usb_device_id option_ids[] = {
997 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
998 + .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
999 + },
1000 +- { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) },
1001 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
1002 ++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
1003 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x0052),
1004 ++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
1005 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b6),
1006 ++ .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
1007 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b7),
1008 ++ .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
1009 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V),
1010 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1011 + { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
1012 +diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c
1013 +index 16b0bf0..7ab9046 100644
1014 +--- a/drivers/usb/storage/initializers.c
1015 ++++ b/drivers/usb/storage/initializers.c
1016 +@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(struct us_data *us)
1017 + int idProduct;
1018 +
1019 + idesc = &us->pusb_intf->cur_altsetting->desc;
1020 +- idProduct = us->pusb_dev->descriptor.idProduct;
1021 ++ idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
1022 + /* The first port is CDROM,
1023 + * means the dongle in the single port mode,
1024 + * and a switch command is required to be sent. */
1025 +@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data *us)
1026 + int result = 0;
1027 +
1028 + if (usb_stor_huawei_dongles_pid(us)) {
1029 +- if (us->pusb_dev->descriptor.idProduct >= 0x1446)
1030 ++ if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
1031 + result = usb_stor_huawei_scsi_init(us);
1032 + else
1033 + result = usb_stor_huawei_feature_init(us);
1034 +diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h
1035 +index 2c85530..65a6a75 100644
1036 +--- a/drivers/usb/storage/unusual_cypress.h
1037 ++++ b/drivers/usb/storage/unusual_cypress.h
1038 +@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999,
1039 + "Cypress ISD-300LP",
1040 + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
1041 +
1042 +-UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999,
1043 ++UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219,
1044 + "Super Top",
1045 + "USB 2.0 SATA BRIDGE",
1046 + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
1047 +diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
1048 +index d2a96a4..ee0f001 100644
1049 +--- a/drivers/video/backlight/adp8860_bl.c
1050 ++++ b/drivers/video/backlight/adp8860_bl.c
1051 +@@ -793,7 +793,7 @@ static int adp8860_i2c_suspend(struct i2c_client *client, pm_message_t message)
1052 +
1053 + static int adp8860_i2c_resume(struct i2c_client *client)
1054 + {
1055 +- adp8860_set_bits(client, ADP8860_MDCR, NSTBY);
1056 ++ adp8860_set_bits(client, ADP8860_MDCR, NSTBY | BLEN);
1057 +
1058 + return 0;
1059 + }
1060 +diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
1061 +index 05a8832..bc0503a 100644
1062 +--- a/drivers/video/backlight/adp8870_bl.c
1063 ++++ b/drivers/video/backlight/adp8870_bl.c
1064 +@@ -968,7 +968,7 @@ static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message)
1065 +
1066 + static int adp8870_i2c_resume(struct i2c_client *client)
1067 + {
1068 +- adp8870_set_bits(client, ADP8870_MDCR, NSTBY);
1069 ++ adp8870_set_bits(client, ADP8870_MDCR, NSTBY | BLEN);
1070 +
1071 + return 0;
1072 + }
1073 +diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
1074 +index bf9a9b7..9b8bcab 100644
1075 +--- a/drivers/video/console/fbcon.c
1076 ++++ b/drivers/video/console/fbcon.c
1077 +@@ -530,6 +530,33 @@ static int search_for_mapped_con(void)
1078 + return retval;
1079 + }
1080 +
1081 ++static int do_fbcon_takeover(int show_logo)
1082 ++{
1083 ++ int err, i;
1084 ++
1085 ++ if (!num_registered_fb)
1086 ++ return -ENODEV;
1087 ++
1088 ++ if (!show_logo)
1089 ++ logo_shown = FBCON_LOGO_DONTSHOW;
1090 ++
1091 ++ for (i = first_fb_vc; i <= last_fb_vc; i++)
1092 ++ con2fb_map[i] = info_idx;
1093 ++
1094 ++ err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
1095 ++ fbcon_is_default);
1096 ++
1097 ++ if (err) {
1098 ++ for (i = first_fb_vc; i <= last_fb_vc; i++)
1099 ++ con2fb_map[i] = -1;
1100 ++ info_idx = -1;
1101 ++ } else {
1102 ++ fbcon_has_console_bind = 1;
1103 ++ }
1104 ++
1105 ++ return err;
1106 ++}
1107 ++
1108 + static int fbcon_takeover(int show_logo)
1109 + {
1110 + int err, i;
1111 +@@ -991,7 +1018,7 @@ static const char *fbcon_startup(void)
1112 + }
1113 +
1114 + /* Setup default font */
1115 +- if (!p->fontdata) {
1116 ++ if (!p->fontdata && !vc->vc_font.data) {
1117 + if (!fontname[0] || !(font = find_font(fontname)))
1118 + font = get_default_font(info->var.xres,
1119 + info->var.yres,
1120 +@@ -1001,6 +1028,8 @@ static const char *fbcon_startup(void)
1121 + vc->vc_font.height = font->height;
1122 + vc->vc_font.data = (void *)(p->fontdata = font->data);
1123 + vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */
1124 ++ } else {
1125 ++ p->fontdata = vc->vc_font.data;
1126 + }
1127 +
1128 + cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
1129 +@@ -1160,9 +1189,9 @@ static void fbcon_init(struct vc_data *vc, int init)
1130 + ops->p = &fb_display[fg_console];
1131 + }
1132 +
1133 +-static void fbcon_free_font(struct display *p)
1134 ++static void fbcon_free_font(struct display *p, bool freefont)
1135 + {
1136 +- if (p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0))
1137 ++ if (freefont && p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0))
1138 + kfree(p->fontdata - FONT_EXTRA_WORDS * sizeof(int));
1139 + p->fontdata = NULL;
1140 + p->userfont = 0;
1141 +@@ -1174,8 +1203,8 @@ static void fbcon_deinit(struct vc_data *vc)
1142 + struct fb_info *info;
1143 + struct fbcon_ops *ops;
1144 + int idx;
1145 ++ bool free_font = true;
1146 +
1147 +- fbcon_free_font(p);
1148 + idx = con2fb_map[vc->vc_num];
1149 +
1150 + if (idx == -1)
1151 +@@ -1186,6 +1215,8 @@ static void fbcon_deinit(struct vc_data *vc)
1152 + if (!info)
1153 + goto finished;
1154 +
1155 ++ if (info->flags & FBINFO_MISC_FIRMWARE)
1156 ++ free_font = false;
1157 + ops = info->fbcon_par;
1158 +
1159 + if (!ops)
1160 +@@ -1197,6 +1228,8 @@ static void fbcon_deinit(struct vc_data *vc)
1161 + ops->flags &= ~FBCON_FLAGS_INIT;
1162 + finished:
1163 +
1164 ++ fbcon_free_font(p, free_font);
1165 ++
1166 + if (!con_is_bound(&fb_con))
1167 + fbcon_exit();
1168 +
1169 +@@ -2978,7 +3011,7 @@ static int fbcon_unbind(void)
1170 + {
1171 + int ret;
1172 +
1173 +- ret = unbind_con_driver(&fb_con, first_fb_vc, last_fb_vc,
1174 ++ ret = do_unbind_con_driver(&fb_con, first_fb_vc, last_fb_vc,
1175 + fbcon_is_default);
1176 +
1177 + if (!ret)
1178 +@@ -3051,7 +3084,7 @@ static int fbcon_fb_unregistered(struct fb_info *info)
1179 + primary_device = -1;
1180 +
1181 + if (!num_registered_fb)
1182 +- unregister_con_driver(&fb_con);
1183 ++ do_unregister_con_driver(&fb_con);
1184 +
1185 + return 0;
1186 + }
1187 +@@ -3116,7 +3149,7 @@ static int fbcon_fb_registered(struct fb_info *info)
1188 + }
1189 +
1190 + if (info_idx != -1)
1191 +- ret = fbcon_takeover(1);
1192 ++ ret = do_fbcon_takeover(1);
1193 + } else {
1194 + for (i = first_fb_vc; i <= last_fb_vc; i++) {
1195 + if (con2fb_map_boot[i] == idx)
1196 +diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
1197 +index 7a41220..c133dde 100644
1198 +--- a/drivers/video/fbmem.c
1199 ++++ b/drivers/video/fbmem.c
1200 +@@ -1628,7 +1628,9 @@ static int do_register_framebuffer(struct fb_info *fb_info)
1201 + event.info = fb_info;
1202 + if (!lock_fb_info(fb_info))
1203 + return -ENODEV;
1204 ++ console_lock();
1205 + fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
1206 ++ console_unlock();
1207 + unlock_fb_info(fb_info);
1208 + return 0;
1209 + }
1210 +@@ -1644,8 +1646,10 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
1211 +
1212 + if (!lock_fb_info(fb_info))
1213 + return -ENODEV;
1214 ++ console_lock();
1215 + event.info = fb_info;
1216 + ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event);
1217 ++ console_unlock();
1218 + unlock_fb_info(fb_info);
1219 +
1220 + if (ret)
1221 +@@ -1660,7 +1664,9 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
1222 + num_registered_fb--;
1223 + fb_cleanup_device(fb_info);
1224 + event.info = fb_info;
1225 ++ console_lock();
1226 + fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
1227 ++ console_unlock();
1228 +
1229 + /* this may free fb info */
1230 + put_fb_info(fb_info);
1231 +@@ -1831,11 +1837,8 @@ int fb_new_modelist(struct fb_info *info)
1232 + err = 1;
1233 +
1234 + if (!list_empty(&info->modelist)) {
1235 +- if (!lock_fb_info(info))
1236 +- return -ENODEV;
1237 + event.info = info;
1238 + err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
1239 +- unlock_fb_info(info);
1240 + }
1241 +
1242 + return err;
1243 +diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
1244 +index 67afa9c..303fb9f 100644
1245 +--- a/drivers/video/fbsysfs.c
1246 ++++ b/drivers/video/fbsysfs.c
1247 +@@ -175,6 +175,8 @@ static ssize_t store_modes(struct device *device,
1248 + if (i * sizeof(struct fb_videomode) != count)
1249 + return -EINVAL;
1250 +
1251 ++ if (!lock_fb_info(fb_info))
1252 ++ return -ENODEV;
1253 + console_lock();
1254 + list_splice(&fb_info->modelist, &old_list);
1255 + fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
1256 +@@ -186,6 +188,7 @@ static ssize_t store_modes(struct device *device,
1257 + fb_destroy_modelist(&old_list);
1258 +
1259 + console_unlock();
1260 ++ unlock_fb_info(fb_info);
1261 +
1262 + return 0;
1263 + }
1264 +diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
1265 +index 80bbc9c..244100f 100644
1266 +--- a/fs/ext4/resize.c
1267 ++++ b/fs/ext4/resize.c
1268 +@@ -499,6 +499,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
1269 + return err;
1270 +
1271 + exit_inode:
1272 ++ kfree(n_group_desc);
1273 + /* ext4_handle_release_buffer(handle, iloc.bh); */
1274 + brelse(iloc.bh);
1275 + exit_dindj:
1276 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
1277 +index f1aa1a2..c6a3363 100644
1278 +--- a/fs/ext4/super.c
1279 ++++ b/fs/ext4/super.c
1280 +@@ -3681,22 +3681,19 @@ no_journal:
1281 + if (err) {
1282 + ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)",
1283 + err);
1284 +- goto failed_mount4;
1285 ++ goto failed_mount5;
1286 + }
1287 +
1288 + err = ext4_register_li_request(sb, first_not_zeroed);
1289 + if (err)
1290 +- goto failed_mount4;
1291 ++ goto failed_mount6;
1292 +
1293 + sbi->s_kobj.kset = ext4_kset;
1294 + init_completion(&sbi->s_kobj_unregister);
1295 + err = kobject_init_and_add(&sbi->s_kobj, &ext4_ktype, NULL,
1296 + "%s", sb->s_id);
1297 +- if (err) {
1298 +- ext4_mb_release(sb);
1299 +- ext4_ext_release(sb);
1300 +- goto failed_mount4;
1301 +- };
1302 ++ if (err)
1303 ++ goto failed_mount7;
1304 +
1305 + EXT4_SB(sb)->s_mount_state |= EXT4_ORPHAN_FS;
1306 + ext4_orphan_cleanup(sb, es);
1307 +@@ -3730,13 +3727,19 @@ cantfind_ext4:
1308 + ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
1309 + goto failed_mount;
1310 +
1311 ++failed_mount7:
1312 ++ ext4_unregister_li_request(sb);
1313 ++failed_mount6:
1314 ++ ext4_ext_release(sb);
1315 ++failed_mount5:
1316 ++ ext4_mb_release(sb);
1317 ++ ext4_release_system_zone(sb);
1318 + failed_mount4:
1319 + iput(root);
1320 + sb->s_root = NULL;
1321 + ext4_msg(sb, KERN_ERR, "mount failed");
1322 + destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq);
1323 + failed_mount_wq:
1324 +- ext4_release_system_zone(sb);
1325 + if (sbi->s_journal) {
1326 + jbd2_journal_destroy(sbi->s_journal);
1327 + sbi->s_journal = NULL;
1328 +diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
1329 +index 20b4ea5..6ee3c36 100644
1330 +--- a/fs/fat/namei_vfat.c
1331 ++++ b/fs/fat/namei_vfat.c
1332 +@@ -514,7 +514,8 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
1333 + int charlen;
1334 +
1335 + if (utf8) {
1336 +- *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname);
1337 ++ *outlen = utf8s_to_utf16s(name, len, UTF16_HOST_ENDIAN,
1338 ++ (wchar_t *) outname, FAT_LFN_LEN + 2);
1339 + if (*outlen < 0)
1340 + return *outlen;
1341 + else if (*outlen > FAT_LFN_LEN)
1342 +diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
1343 +index e374050..5ee055e 100644
1344 +--- a/fs/lockd/clntproc.c
1345 ++++ b/fs/lockd/clntproc.c
1346 +@@ -550,6 +550,9 @@ again:
1347 + status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT);
1348 + if (status < 0)
1349 + break;
1350 ++ /* Resend the blocking lock request after a server reboot */
1351 ++ if (resp->status == nlm_lck_denied_grace_period)
1352 ++ continue;
1353 + if (resp->status != nlm_lck_blocked)
1354 + break;
1355 + }
1356 +diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
1357 +index 44a88a9..0eb059e 100644
1358 +--- a/fs/nls/nls_base.c
1359 ++++ b/fs/nls/nls_base.c
1360 +@@ -114,34 +114,57 @@ int utf32_to_utf8(unicode_t u, u8 *s, int maxlen)
1361 + }
1362 + EXPORT_SYMBOL(utf32_to_utf8);
1363 +
1364 +-int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs)
1365 ++static inline void put_utf16(wchar_t *s, unsigned c, enum utf16_endian endian)
1366 ++{
1367 ++ switch (endian) {
1368 ++ default:
1369 ++ *s = (wchar_t) c;
1370 ++ break;
1371 ++ case UTF16_LITTLE_ENDIAN:
1372 ++ *s = __cpu_to_le16(c);
1373 ++ break;
1374 ++ case UTF16_BIG_ENDIAN:
1375 ++ *s = __cpu_to_be16(c);
1376 ++ break;
1377 ++ }
1378 ++}
1379 ++
1380 ++int utf8s_to_utf16s(const u8 *s, int len, enum utf16_endian endian,
1381 ++ wchar_t *pwcs, int maxlen)
1382 + {
1383 + u16 *op;
1384 + int size;
1385 + unicode_t u;
1386 +
1387 + op = pwcs;
1388 +- while (*s && len > 0) {
1389 ++ while (len > 0 && maxlen > 0 && *s) {
1390 + if (*s & 0x80) {
1391 + size = utf8_to_utf32(s, len, &u);
1392 + if (size < 0)
1393 + return -EINVAL;
1394 ++ s += size;
1395 ++ len -= size;
1396 +
1397 + if (u >= PLANE_SIZE) {
1398 ++ if (maxlen < 2)
1399 ++ break;
1400 + u -= PLANE_SIZE;
1401 +- *op++ = (wchar_t) (SURROGATE_PAIR |
1402 +- ((u >> 10) & SURROGATE_BITS));
1403 +- *op++ = (wchar_t) (SURROGATE_PAIR |
1404 ++ put_utf16(op++, SURROGATE_PAIR |
1405 ++ ((u >> 10) & SURROGATE_BITS),
1406 ++ endian);
1407 ++ put_utf16(op++, SURROGATE_PAIR |
1408 + SURROGATE_LOW |
1409 +- (u & SURROGATE_BITS));
1410 ++ (u & SURROGATE_BITS),
1411 ++ endian);
1412 ++ maxlen -= 2;
1413 + } else {
1414 +- *op++ = (wchar_t) u;
1415 ++ put_utf16(op++, u, endian);
1416 ++ maxlen--;
1417 + }
1418 +- s += size;
1419 +- len -= size;
1420 + } else {
1421 +- *op++ = *s++;
1422 ++ put_utf16(op++, *s++, endian);
1423 + len--;
1424 ++ maxlen--;
1425 + }
1426 + }
1427 + return op - pwcs;
1428 +diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
1429 +index 8445fbc..6f292dd 100644
1430 +--- a/fs/notify/inotify/inotify_user.c
1431 ++++ b/fs/notify/inotify/inotify_user.c
1432 +@@ -579,8 +579,6 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
1433 +
1434 + /* don't allow invalid bits: we don't want flags set */
1435 + mask = inotify_arg_to_mask(arg);
1436 +- if (unlikely(!(mask & IN_ALL_EVENTS)))
1437 +- return -EINVAL;
1438 +
1439 + fsn_mark = fsnotify_find_inode_mark(group, inode);
1440 + if (!fsn_mark)
1441 +@@ -632,8 +630,6 @@ static int inotify_new_watch(struct fsnotify_group *group,
1442 +
1443 + /* don't allow invalid bits: we don't want flags set */
1444 + mask = inotify_arg_to_mask(arg);
1445 +- if (unlikely(!(mask & IN_ALL_EVENTS)))
1446 +- return -EINVAL;
1447 +
1448 + tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
1449 + if (unlikely(!tmp_i_mark))
1450 +diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
1451 +index 7642d7c..ab4046f 100644
1452 +--- a/fs/ocfs2/dlmglue.c
1453 ++++ b/fs/ocfs2/dlmglue.c
1454 +@@ -2539,6 +2539,7 @@ int ocfs2_super_lock(struct ocfs2_super *osb,
1455 + * everything is up to the caller :) */
1456 + status = ocfs2_should_refresh_lock_res(lockres);
1457 + if (status < 0) {
1458 ++ ocfs2_cluster_unlock(osb, lockres, level);
1459 + mlog_errno(status);
1460 + goto bail;
1461 + }
1462 +@@ -2547,8 +2548,10 @@ int ocfs2_super_lock(struct ocfs2_super *osb,
1463 +
1464 + ocfs2_complete_lock_res_refresh(lockres, status);
1465 +
1466 +- if (status < 0)
1467 ++ if (status < 0) {
1468 ++ ocfs2_cluster_unlock(osb, lockres, level);
1469 + mlog_errno(status);
1470 ++ }
1471 + ocfs2_track_lock_refresh(lockres);
1472 + }
1473 + bail:
1474 +diff --git a/include/linux/console.h b/include/linux/console.h
1475 +index 7453cfd..6ae6a15 100644
1476 +--- a/include/linux/console.h
1477 ++++ b/include/linux/console.h
1478 +@@ -77,7 +77,9 @@ extern const struct consw prom_con; /* SPARC PROM console */
1479 + int con_is_bound(const struct consw *csw);
1480 + int register_con_driver(const struct consw *csw, int first, int last);
1481 + int unregister_con_driver(const struct consw *csw);
1482 ++int do_unregister_con_driver(const struct consw *csw);
1483 + int take_over_console(const struct consw *sw, int first, int last, int deflt);
1484 ++int do_take_over_console(const struct consw *sw, int first, int last, int deflt);
1485 + void give_up_console(const struct consw *sw);
1486 + #ifdef CONFIG_HW_CONSOLE
1487 + int con_debug_enter(struct vc_data *vc);
1488 +diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
1489 +index 1d1b1e1..ee2baf0 100644
1490 +--- a/include/linux/mmu_notifier.h
1491 ++++ b/include/linux/mmu_notifier.h
1492 +@@ -4,6 +4,7 @@
1493 + #include <linux/list.h>
1494 + #include <linux/spinlock.h>
1495 + #include <linux/mm_types.h>
1496 ++#include <linux/srcu.h>
1497 +
1498 + struct mmu_notifier;
1499 + struct mmu_notifier_ops;
1500 +diff --git a/include/linux/nls.h b/include/linux/nls.h
1501 +index d47beef..5dc635f 100644
1502 +--- a/include/linux/nls.h
1503 ++++ b/include/linux/nls.h
1504 +@@ -43,7 +43,7 @@ enum utf16_endian {
1505 + UTF16_BIG_ENDIAN
1506 + };
1507 +
1508 +-/* nls.c */
1509 ++/* nls_base.c */
1510 + extern int register_nls(struct nls_table *);
1511 + extern int unregister_nls(struct nls_table *);
1512 + extern struct nls_table *load_nls(char *);
1513 +@@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void);
1514 +
1515 + extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
1516 + extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);
1517 +-extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs);
1518 ++extern int utf8s_to_utf16s(const u8 *s, int len,
1519 ++ enum utf16_endian endian, wchar_t *pwcs, int maxlen);
1520 + extern int utf16s_to_utf8s(const wchar_t *pwcs, int len,
1521 + enum utf16_endian endian, u8 *s, int maxlen);
1522 +
1523 +diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
1524 +index a54b825..6f8b026 100644
1525 +--- a/include/linux/usb/audio.h
1526 ++++ b/include/linux/usb/audio.h
1527 +@@ -384,14 +384,16 @@ static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_de
1528 + int protocol)
1529 + {
1530 + __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
1531 +- return desc->baSourceID[desc->bNrInPins + control_size];
1532 ++ return *(uac_processing_unit_bmControls(desc, protocol)
1533 ++ + control_size);
1534 + }
1535 +
1536 + static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
1537 + int protocol)
1538 + {
1539 + __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
1540 +- return &desc->baSourceID[desc->bNrInPins + control_size + 1];
1541 ++ return uac_processing_unit_bmControls(desc, protocol)
1542 ++ + control_size + 1;
1543 + }
1544 +
1545 + /* 4.5.2 Class-Specific AS Interface Descriptor */
1546 +diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
1547 +index 4d05e14..90538b4 100644
1548 +--- a/include/linux/vt_kern.h
1549 ++++ b/include/linux/vt_kern.h
1550 +@@ -131,6 +131,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
1551 + int vt_waitactive(int n);
1552 + void change_console(struct vc_data *new_vc);
1553 + void reset_vc(struct vc_data *vc);
1554 ++extern int do_unbind_con_driver(const struct consw *csw, int first, int last,
1555 ++ int deflt);
1556 + extern int unbind_con_driver(const struct consw *csw, int first, int last,
1557 + int deflt);
1558 + int vty_init(const struct file_operations *console_fops);
1559 +diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
1560 +index e46674d..f9ce2fa 100644
1561 +--- a/include/net/inet6_hashtables.h
1562 ++++ b/include/net/inet6_hashtables.h
1563 +@@ -28,16 +28,16 @@
1564 +
1565 + struct inet_hashinfo;
1566 +
1567 +-/* I have no idea if this is a good hash for v6 or not. -DaveM */
1568 + static inline unsigned int inet6_ehashfn(struct net *net,
1569 + const struct in6_addr *laddr, const u16 lport,
1570 + const struct in6_addr *faddr, const __be16 fport)
1571 + {
1572 +- u32 ports = (lport ^ (__force u16)fport);
1573 ++ u32 ports = (((u32)lport) << 16) | (__force u32)fport;
1574 +
1575 + return jhash_3words((__force u32)laddr->s6_addr32[3],
1576 +- (__force u32)faddr->s6_addr32[3],
1577 +- ports, inet_ehash_secret + net_hash_mix(net));
1578 ++ ipv6_addr_jhash(faddr),
1579 ++ ports,
1580 ++ inet_ehash_secret + net_hash_mix(net));
1581 + }
1582 +
1583 + static inline int inet6_sk_ehashfn(const struct sock *sk)
1584 +diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
1585 +index 14dd9c7..26490b3 100644
1586 +--- a/include/net/inet_sock.h
1587 ++++ b/include/net/inet_sock.h
1588 +@@ -199,6 +199,7 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
1589 + extern int inet_sk_rebuild_header(struct sock *sk);
1590 +
1591 + extern u32 inet_ehash_secret;
1592 ++extern u32 ipv6_hash_secret;
1593 + extern void build_ehash_secret(void);
1594 +
1595 + static inline unsigned int inet_ehashfn(struct net *net,
1596 +diff --git a/include/net/ipv6.h b/include/net/ipv6.h
1597 +index c39121f..879aadf 100644
1598 +--- a/include/net/ipv6.h
1599 ++++ b/include/net/ipv6.h
1600 +@@ -15,6 +15,7 @@
1601 +
1602 + #include <linux/ipv6.h>
1603 + #include <linux/hardirq.h>
1604 ++#include <linux/jhash.h>
1605 + #include <net/if_inet6.h>
1606 + #include <net/ndisc.h>
1607 + #include <net/flow.h>
1608 +@@ -386,6 +387,17 @@ struct ip6_create_arg {
1609 + void ip6_frag_init(struct inet_frag_queue *q, void *a);
1610 + int ip6_frag_match(struct inet_frag_queue *q, void *a);
1611 +
1612 ++/* more secured version of ipv6_addr_hash() */
1613 ++static inline u32 ipv6_addr_jhash(const struct in6_addr *a)
1614 ++{
1615 ++ u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1];
1616 ++
1617 ++ return jhash_3words(v,
1618 ++ (__force u32)a->s6_addr32[2],
1619 ++ (__force u32)a->s6_addr32[3],
1620 ++ ipv6_hash_secret);
1621 ++}
1622 ++
1623 + static inline int ipv6_addr_any(const struct in6_addr *a)
1624 + {
1625 + return (a->s6_addr32[0] | a->s6_addr32[1] |
1626 +diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
1627 +index 957869f..e079c3e 100644
1628 +--- a/kernel/hrtimer.c
1629 ++++ b/kernel/hrtimer.c
1630 +@@ -640,21 +640,9 @@ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base)
1631 + * and expiry check is done in the hrtimer_interrupt or in the softirq.
1632 + */
1633 + static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
1634 +- struct hrtimer_clock_base *base,
1635 +- int wakeup)
1636 ++ struct hrtimer_clock_base *base)
1637 + {
1638 +- if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) {
1639 +- if (wakeup) {
1640 +- raw_spin_unlock(&base->cpu_base->lock);
1641 +- raise_softirq_irqoff(HRTIMER_SOFTIRQ);
1642 +- raw_spin_lock(&base->cpu_base->lock);
1643 +- } else
1644 +- __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
1645 +-
1646 +- return 1;
1647 +- }
1648 +-
1649 +- return 0;
1650 ++ return base->cpu_base->hres_active && hrtimer_reprogram(timer, base);
1651 + }
1652 +
1653 + static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
1654 +@@ -735,8 +723,7 @@ static inline int hrtimer_switch_to_hres(void) { return 0; }
1655 + static inline void
1656 + hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { }
1657 + static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
1658 +- struct hrtimer_clock_base *base,
1659 +- int wakeup)
1660 ++ struct hrtimer_clock_base *base)
1661 + {
1662 + return 0;
1663 + }
1664 +@@ -995,8 +982,21 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
1665 + *
1666 + * XXX send_remote_softirq() ?
1667 + */
1668 +- if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases))
1669 +- hrtimer_enqueue_reprogram(timer, new_base, wakeup);
1670 ++ if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)
1671 ++ && hrtimer_enqueue_reprogram(timer, new_base)) {
1672 ++ if (wakeup) {
1673 ++ /*
1674 ++ * We need to drop cpu_base->lock to avoid a
1675 ++ * lock ordering issue vs. rq->lock.
1676 ++ */
1677 ++ raw_spin_unlock(&new_base->cpu_base->lock);
1678 ++ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
1679 ++ local_irq_restore(flags);
1680 ++ return ret;
1681 ++ } else {
1682 ++ __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
1683 ++ }
1684 ++ }
1685 +
1686 + unlock_hrtimer_base(timer, &flags);
1687 +
1688 +diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
1689 +index dc813a9..63633a3 100644
1690 +--- a/kernel/irq/spurious.c
1691 ++++ b/kernel/irq/spurious.c
1692 +@@ -80,13 +80,11 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
1693 +
1694 + /*
1695 + * All handlers must agree on IRQF_SHARED, so we test just the
1696 +- * first. Check for action->next as well.
1697 ++ * first.
1698 + */
1699 + action = desc->action;
1700 + if (!action || !(action->flags & IRQF_SHARED) ||
1701 +- (action->flags & __IRQF_TIMER) ||
1702 +- (action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
1703 +- !action->next)
1704 ++ (action->flags & __IRQF_TIMER))
1705 + goto out;
1706 +
1707 + /* Already running on another processor */
1708 +@@ -104,6 +102,7 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
1709 + do {
1710 + if (handle_irq_event(desc) == IRQ_HANDLED)
1711 + ret = IRQ_HANDLED;
1712 ++ /* Make sure that there is still a valid action */
1713 + action = desc->action;
1714 + } while ((desc->istate & IRQS_PENDING) && action);
1715 + desc->istate &= ~IRQS_POLL_INPROGRESS;
1716 +diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
1717 +index 640ded8..93d5e4a 100644
1718 +--- a/kernel/posix-cpu-timers.c
1719 ++++ b/kernel/posix-cpu-timers.c
1720 +@@ -1450,8 +1450,10 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
1721 + while (!signal_pending(current)) {
1722 + if (timer.it.cpu.expires.sched == 0) {
1723 + /*
1724 +- * Our timer fired and was reset.
1725 ++ * Our timer fired and was reset, below
1726 ++ * deletion can not fail.
1727 + */
1728 ++ posix_cpu_timer_del(&timer);
1729 + spin_unlock_irq(&timer.it_lock);
1730 + return 0;
1731 + }
1732 +@@ -1469,9 +1471,26 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
1733 + * We were interrupted by a signal.
1734 + */
1735 + sample_to_timespec(which_clock, timer.it.cpu.expires, rqtp);
1736 +- posix_cpu_timer_set(&timer, 0, &zero_it, it);
1737 ++ error = posix_cpu_timer_set(&timer, 0, &zero_it, it);
1738 ++ if (!error) {
1739 ++ /*
1740 ++ * Timer is now unarmed, deletion can not fail.
1741 ++ */
1742 ++ posix_cpu_timer_del(&timer);
1743 ++ }
1744 + spin_unlock_irq(&timer.it_lock);
1745 +
1746 ++ while (error == TIMER_RETRY) {
1747 ++ /*
1748 ++ * We need to handle case when timer was or is in the
1749 ++ * middle of firing. In other cases we already freed
1750 ++ * resources.
1751 ++ */
1752 ++ spin_lock_irq(&timer.it_lock);
1753 ++ error = posix_cpu_timer_del(&timer);
1754 ++ spin_unlock_irq(&timer.it_lock);
1755 ++ }
1756 ++
1757 + if ((it->it_value.tv_sec | it->it_value.tv_nsec) == 0) {
1758 + /*
1759 + * It actually did fire already.
1760 +diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
1761 +index eb51d76..3f42652 100644
1762 +--- a/kernel/timeconst.pl
1763 ++++ b/kernel/timeconst.pl
1764 +@@ -369,10 +369,8 @@ if ($hz eq '--can') {
1765 + die "Usage: $0 HZ\n";
1766 + }
1767 +
1768 +- @val = @{$canned_values{$hz}};
1769 +- if (!defined(@val)) {
1770 +- @val = compute_values($hz);
1771 +- }
1772 ++ $cv = $canned_values{$hz};
1773 ++ @val = defined($cv) ? @$cv : compute_values($hz);
1774 + output($hz, @val);
1775 + }
1776 + exit 0;
1777 +diff --git a/mm/fadvise.c b/mm/fadvise.c
1778 +index 8d723c9..35b2bb0 100644
1779 +--- a/mm/fadvise.c
1780 ++++ b/mm/fadvise.c
1781 +@@ -17,6 +17,7 @@
1782 + #include <linux/fadvise.h>
1783 + #include <linux/writeback.h>
1784 + #include <linux/syscalls.h>
1785 ++#include <linux/swap.h>
1786 +
1787 + #include <asm/unistd.h>
1788 +
1789 +@@ -123,9 +124,22 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
1790 + start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
1791 + end_index = (endbyte >> PAGE_CACHE_SHIFT);
1792 +
1793 +- if (end_index >= start_index)
1794 +- invalidate_mapping_pages(mapping, start_index,
1795 ++ if (end_index >= start_index) {
1796 ++ unsigned long count = invalidate_mapping_pages(mapping,
1797 ++ start_index, end_index);
1798 ++
1799 ++ /*
1800 ++ * If fewer pages were invalidated than expected then
1801 ++ * it is possible that some of the pages were on
1802 ++ * a per-cpu pagevec for a remote CPU. Drain all
1803 ++ * pagevecs and try again.
1804 ++ */
1805 ++ if (count < (end_index - start_index + 1)) {
1806 ++ lru_add_drain_all();
1807 ++ invalidate_mapping_pages(mapping, start_index,
1808 + end_index);
1809 ++ }
1810 ++ }
1811 + break;
1812 + default:
1813 + ret = -EINVAL;
1814 +diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
1815 +index 71c7811..88fa54d 100644
1816 +--- a/mm/mmu_notifier.c
1817 ++++ b/mm/mmu_notifier.c
1818 +@@ -14,10 +14,14 @@
1819 + #include <linux/module.h>
1820 + #include <linux/mm.h>
1821 + #include <linux/err.h>
1822 ++#include <linux/srcu.h>
1823 + #include <linux/rcupdate.h>
1824 + #include <linux/sched.h>
1825 + #include <linux/slab.h>
1826 +
1827 ++/* global SRCU for all MMs */
1828 ++static struct srcu_struct srcu;
1829 ++
1830 + /*
1831 + * This function can't run concurrently against mmu_notifier_register
1832 + * because mm->mm_users > 0 during mmu_notifier_register and exit_mmap
1833 +@@ -25,58 +29,61 @@
1834 + * in parallel despite there being no task using this mm any more,
1835 + * through the vmas outside of the exit_mmap context, such as with
1836 + * vmtruncate. This serializes against mmu_notifier_unregister with
1837 +- * the mmu_notifier_mm->lock in addition to RCU and it serializes
1838 +- * against the other mmu notifiers with RCU. struct mmu_notifier_mm
1839 ++ * the mmu_notifier_mm->lock in addition to SRCU and it serializes
1840 ++ * against the other mmu notifiers with SRCU. struct mmu_notifier_mm
1841 + * can't go away from under us as exit_mmap holds an mm_count pin
1842 + * itself.
1843 + */
1844 + void __mmu_notifier_release(struct mm_struct *mm)
1845 + {
1846 + struct mmu_notifier *mn;
1847 +- struct hlist_node *n;
1848 ++ int id;
1849 +
1850 + /*
1851 +- * RCU here will block mmu_notifier_unregister until
1852 +- * ->release returns.
1853 ++ * srcu_read_lock() here will block synchronize_srcu() in
1854 ++ * mmu_notifier_unregister() until all registered
1855 ++ * ->release() callouts this function makes have
1856 ++ * returned.
1857 + */
1858 +- rcu_read_lock();
1859 +- hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist)
1860 +- /*
1861 +- * if ->release runs before mmu_notifier_unregister it
1862 +- * must be handled as it's the only way for the driver
1863 +- * to flush all existing sptes and stop the driver
1864 +- * from establishing any more sptes before all the
1865 +- * pages in the mm are freed.
1866 +- */
1867 +- if (mn->ops->release)
1868 +- mn->ops->release(mn, mm);
1869 +- rcu_read_unlock();
1870 +-
1871 ++ id = srcu_read_lock(&srcu);
1872 + spin_lock(&mm->mmu_notifier_mm->lock);
1873 + while (unlikely(!hlist_empty(&mm->mmu_notifier_mm->list))) {
1874 + mn = hlist_entry(mm->mmu_notifier_mm->list.first,
1875 + struct mmu_notifier,
1876 + hlist);
1877 ++
1878 + /*
1879 +- * We arrived before mmu_notifier_unregister so
1880 +- * mmu_notifier_unregister will do nothing other than
1881 +- * to wait ->release to finish and
1882 +- * mmu_notifier_unregister to return.
1883 ++ * Unlink. This will prevent mmu_notifier_unregister()
1884 ++ * from also making the ->release() callout.
1885 + */
1886 + hlist_del_init_rcu(&mn->hlist);
1887 ++ spin_unlock(&mm->mmu_notifier_mm->lock);
1888 ++
1889 ++ /*
1890 ++ * Clear sptes. (see 'release' description in mmu_notifier.h)
1891 ++ */
1892 ++ if (mn->ops->release)
1893 ++ mn->ops->release(mn, mm);
1894 ++
1895 ++ spin_lock(&mm->mmu_notifier_mm->lock);
1896 + }
1897 + spin_unlock(&mm->mmu_notifier_mm->lock);
1898 +
1899 + /*
1900 +- * synchronize_rcu here prevents mmu_notifier_release to
1901 +- * return to exit_mmap (which would proceed freeing all pages
1902 +- * in the mm) until the ->release method returns, if it was
1903 +- * invoked by mmu_notifier_unregister.
1904 +- *
1905 +- * The mmu_notifier_mm can't go away from under us because one
1906 +- * mm_count is hold by exit_mmap.
1907 ++ * All callouts to ->release() which we have done are complete.
1908 ++ * Allow synchronize_srcu() in mmu_notifier_unregister() to complete
1909 ++ */
1910 ++ srcu_read_unlock(&srcu, id);
1911 ++
1912 ++ /*
1913 ++ * mmu_notifier_unregister() may have unlinked a notifier and may
1914 ++ * still be calling out to it. Additionally, other notifiers
1915 ++ * may have been active via vmtruncate() et. al. Block here
1916 ++ * to ensure that all notifier callouts for this mm have been
1917 ++ * completed and the sptes are really cleaned up before returning
1918 ++ * to exit_mmap().
1919 + */
1920 +- synchronize_rcu();
1921 ++ synchronize_srcu(&srcu);
1922 + }
1923 +
1924 + /*
1925 +@@ -89,14 +96,14 @@ int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
1926 + {
1927 + struct mmu_notifier *mn;
1928 + struct hlist_node *n;
1929 +- int young = 0;
1930 ++ int young = 0, id;
1931 +
1932 +- rcu_read_lock();
1933 ++ id = srcu_read_lock(&srcu);
1934 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
1935 + if (mn->ops->clear_flush_young)
1936 + young |= mn->ops->clear_flush_young(mn, mm, address);
1937 + }
1938 +- rcu_read_unlock();
1939 ++ srcu_read_unlock(&srcu, id);
1940 +
1941 + return young;
1942 + }
1943 +@@ -106,9 +113,9 @@ int __mmu_notifier_test_young(struct mm_struct *mm,
1944 + {
1945 + struct mmu_notifier *mn;
1946 + struct hlist_node *n;
1947 +- int young = 0;
1948 ++ int young = 0, id;
1949 +
1950 +- rcu_read_lock();
1951 ++ id = srcu_read_lock(&srcu);
1952 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
1953 + if (mn->ops->test_young) {
1954 + young = mn->ops->test_young(mn, mm, address);
1955 +@@ -116,7 +123,7 @@ int __mmu_notifier_test_young(struct mm_struct *mm,
1956 + break;
1957 + }
1958 + }
1959 +- rcu_read_unlock();
1960 ++ srcu_read_unlock(&srcu, id);
1961 +
1962 + return young;
1963 + }
1964 +@@ -126,8 +133,9 @@ void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
1965 + {
1966 + struct mmu_notifier *mn;
1967 + struct hlist_node *n;
1968 ++ int id;
1969 +
1970 +- rcu_read_lock();
1971 ++ id = srcu_read_lock(&srcu);
1972 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
1973 + if (mn->ops->change_pte)
1974 + mn->ops->change_pte(mn, mm, address, pte);
1975 +@@ -138,7 +146,7 @@ void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
1976 + else if (mn->ops->invalidate_page)
1977 + mn->ops->invalidate_page(mn, mm, address);
1978 + }
1979 +- rcu_read_unlock();
1980 ++ srcu_read_unlock(&srcu, id);
1981 + }
1982 +
1983 + void __mmu_notifier_invalidate_page(struct mm_struct *mm,
1984 +@@ -146,13 +154,14 @@ void __mmu_notifier_invalidate_page(struct mm_struct *mm,
1985 + {
1986 + struct mmu_notifier *mn;
1987 + struct hlist_node *n;
1988 ++ int id;
1989 +
1990 +- rcu_read_lock();
1991 ++ id = srcu_read_lock(&srcu);
1992 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
1993 + if (mn->ops->invalidate_page)
1994 + mn->ops->invalidate_page(mn, mm, address);
1995 + }
1996 +- rcu_read_unlock();
1997 ++ srcu_read_unlock(&srcu, id);
1998 + }
1999 +
2000 + void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
2001 +@@ -160,13 +169,14 @@ void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
2002 + {
2003 + struct mmu_notifier *mn;
2004 + struct hlist_node *n;
2005 ++ int id;
2006 +
2007 +- rcu_read_lock();
2008 ++ id = srcu_read_lock(&srcu);
2009 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
2010 + if (mn->ops->invalidate_range_start)
2011 + mn->ops->invalidate_range_start(mn, mm, start, end);
2012 + }
2013 +- rcu_read_unlock();
2014 ++ srcu_read_unlock(&srcu, id);
2015 + }
2016 +
2017 + void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
2018 +@@ -174,13 +184,14 @@ void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
2019 + {
2020 + struct mmu_notifier *mn;
2021 + struct hlist_node *n;
2022 ++ int id;
2023 +
2024 +- rcu_read_lock();
2025 ++ id = srcu_read_lock(&srcu);
2026 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
2027 + if (mn->ops->invalidate_range_end)
2028 + mn->ops->invalidate_range_end(mn, mm, start, end);
2029 + }
2030 +- rcu_read_unlock();
2031 ++ srcu_read_unlock(&srcu, id);
2032 + }
2033 +
2034 + static int do_mmu_notifier_register(struct mmu_notifier *mn,
2035 +@@ -192,6 +203,12 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
2036 +
2037 + BUG_ON(atomic_read(&mm->mm_users) <= 0);
2038 +
2039 ++ /*
2040 ++ * Verify that mmu_notifier_init() already run and the global srcu is
2041 ++ * initialized.
2042 ++ */
2043 ++ BUG_ON(!srcu.per_cpu_ref);
2044 ++
2045 + ret = -ENOMEM;
2046 + mmu_notifier_mm = kmalloc(sizeof(struct mmu_notifier_mm), GFP_KERNEL);
2047 + if (unlikely(!mmu_notifier_mm))
2048 +@@ -274,8 +291,8 @@ void __mmu_notifier_mm_destroy(struct mm_struct *mm)
2049 + /*
2050 + * This releases the mm_count pin automatically and frees the mm
2051 + * structure if it was the last user of it. It serializes against
2052 +- * running mmu notifiers with RCU and against mmu_notifier_unregister
2053 +- * with the unregister lock + RCU. All sptes must be dropped before
2054 ++ * running mmu notifiers with SRCU and against mmu_notifier_unregister
2055 ++ * with the unregister lock + SRCU. All sptes must be dropped before
2056 + * calling mmu_notifier_unregister. ->release or any other notifier
2057 + * method may be invoked concurrently with mmu_notifier_unregister,
2058 + * and only after mmu_notifier_unregister returned we're guaranteed
2059 +@@ -285,35 +302,43 @@ void mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm)
2060 + {
2061 + BUG_ON(atomic_read(&mm->mm_count) <= 0);
2062 +
2063 ++ spin_lock(&mm->mmu_notifier_mm->lock);
2064 + if (!hlist_unhashed(&mn->hlist)) {
2065 +- /*
2066 +- * RCU here will force exit_mmap to wait ->release to finish
2067 +- * before freeing the pages.
2068 +- */
2069 +- rcu_read_lock();
2070 ++ int id;
2071 +
2072 + /*
2073 +- * exit_mmap will block in mmu_notifier_release to
2074 +- * guarantee ->release is called before freeing the
2075 +- * pages.
2076 ++ * Ensure we synchronize up with __mmu_notifier_release().
2077 + */
2078 ++ id = srcu_read_lock(&srcu);
2079 ++
2080 ++ hlist_del_rcu(&mn->hlist);
2081 ++ spin_unlock(&mm->mmu_notifier_mm->lock);
2082 ++
2083 + if (mn->ops->release)
2084 + mn->ops->release(mn, mm);
2085 +- rcu_read_unlock();
2086 +
2087 +- spin_lock(&mm->mmu_notifier_mm->lock);
2088 +- hlist_del_rcu(&mn->hlist);
2089 ++ /*
2090 ++ * Allow __mmu_notifier_release() to complete.
2091 ++ */
2092 ++ srcu_read_unlock(&srcu, id);
2093 ++ } else
2094 + spin_unlock(&mm->mmu_notifier_mm->lock);
2095 +- }
2096 +
2097 + /*
2098 +- * Wait any running method to finish, of course including
2099 +- * ->release if it was run by mmu_notifier_relase instead of us.
2100 ++ * Wait for any running method to finish, including ->release() if it
2101 ++ * was run by __mmu_notifier_release() instead of us.
2102 + */
2103 +- synchronize_rcu();
2104 ++ synchronize_srcu(&srcu);
2105 +
2106 + BUG_ON(atomic_read(&mm->mm_count) <= 0);
2107 +
2108 + mmdrop(mm);
2109 + }
2110 + EXPORT_SYMBOL_GPL(mmu_notifier_unregister);
2111 ++
2112 ++static int __init mmu_notifier_init(void)
2113 ++{
2114 ++ return init_srcu_struct(&srcu);
2115 ++}
2116 ++
2117 ++module_init(mmu_notifier_init);
2118 +diff --git a/mm/page_alloc.c b/mm/page_alloc.c
2119 +index 0ec869e..1b94f08 100644
2120 +--- a/mm/page_alloc.c
2121 ++++ b/mm/page_alloc.c
2122 +@@ -4264,10 +4264,11 @@ static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
2123 + * round what is now in bits to nearest long in bits, then return it in
2124 + * bytes.
2125 + */
2126 +-static unsigned long __init usemap_size(unsigned long zonesize)
2127 ++static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned long zonesize)
2128 + {
2129 + unsigned long usemapsize;
2130 +
2131 ++ zonesize += zone_start_pfn & (pageblock_nr_pages-1);
2132 + usemapsize = roundup(zonesize, pageblock_nr_pages);
2133 + usemapsize = usemapsize >> pageblock_order;
2134 + usemapsize *= NR_PAGEBLOCK_BITS;
2135 +@@ -4277,17 +4278,19 @@ static unsigned long __init usemap_size(unsigned long zonesize)
2136 + }
2137 +
2138 + static void __init setup_usemap(struct pglist_data *pgdat,
2139 +- struct zone *zone, unsigned long zonesize)
2140 ++ struct zone *zone,
2141 ++ unsigned long zone_start_pfn,
2142 ++ unsigned long zonesize)
2143 + {
2144 +- unsigned long usemapsize = usemap_size(zonesize);
2145 ++ unsigned long usemapsize = usemap_size(zone_start_pfn, zonesize);
2146 + zone->pageblock_flags = NULL;
2147 + if (usemapsize)
2148 + zone->pageblock_flags = alloc_bootmem_node_nopanic(pgdat,
2149 + usemapsize);
2150 + }
2151 + #else
2152 +-static inline void setup_usemap(struct pglist_data *pgdat,
2153 +- struct zone *zone, unsigned long zonesize) {}
2154 ++static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone,
2155 ++ unsigned long zone_start_pfn, unsigned long zonesize) {}
2156 + #endif /* CONFIG_SPARSEMEM */
2157 +
2158 + #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
2159 +@@ -4415,7 +4418,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
2160 + continue;
2161 +
2162 + set_pageblock_order(pageblock_default_order());
2163 +- setup_usemap(pgdat, zone, size);
2164 ++ setup_usemap(pgdat, zone, zone_start_pfn, size);
2165 + ret = init_currently_empty_zone(zone, zone_start_pfn,
2166 + size, MEMMAP_EARLY);
2167 + BUG_ON(ret);
2168 +diff --git a/mm/shmem.c b/mm/shmem.c
2169 +index b952332..8b38477 100644
2170 +--- a/mm/shmem.c
2171 ++++ b/mm/shmem.c
2172 +@@ -2505,6 +2505,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
2173 + unsigned long inodes;
2174 + int error = -EINVAL;
2175 +
2176 ++ config.mpol = NULL;
2177 + if (shmem_parse_options(data, &config, true))
2178 + return error;
2179 +
2180 +@@ -2530,8 +2531,13 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
2181 + sbinfo->max_inodes = config.max_inodes;
2182 + sbinfo->free_inodes = config.max_inodes - inodes;
2183 +
2184 +- mpol_put(sbinfo->mpol);
2185 +- sbinfo->mpol = config.mpol; /* transfers initial ref */
2186 ++ /*
2187 ++ * Preserve previous mempolicy unless mpol remount option was specified.
2188 ++ */
2189 ++ if (config.mpol) {
2190 ++ mpol_put(sbinfo->mpol);
2191 ++ sbinfo->mpol = config.mpol; /* transfers initial ref */
2192 ++ }
2193 + out:
2194 + spin_unlock(&sbinfo->stat_lock);
2195 + return error;
2196 +diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
2197 +index 289646e..f26516a 100644
2198 +--- a/net/bridge/br_stp_bpdu.c
2199 ++++ b/net/bridge/br_stp_bpdu.c
2200 +@@ -16,6 +16,7 @@
2201 + #include <linux/etherdevice.h>
2202 + #include <linux/llc.h>
2203 + #include <linux/slab.h>
2204 ++#include <linux/pkt_sched.h>
2205 + #include <net/net_namespace.h>
2206 + #include <net/llc.h>
2207 + #include <net/llc_pdu.h>
2208 +@@ -40,6 +41,7 @@ static void br_send_bpdu(struct net_bridge_port *p,
2209 +
2210 + skb->dev = p->dev;
2211 + skb->protocol = htons(ETH_P_802_2);
2212 ++ skb->priority = TC_PRIO_CONTROL;
2213 +
2214 + skb_reserve(skb, LLC_RESERVE);
2215 + memcpy(__skb_put(skb, length), data, length);
2216 +diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
2217 +index ef1528a..f5dde14 100644
2218 +--- a/net/ipv4/af_inet.c
2219 ++++ b/net/ipv4/af_inet.c
2220 +@@ -226,8 +226,12 @@ EXPORT_SYMBOL(inet_listen);
2221 + u32 inet_ehash_secret __read_mostly;
2222 + EXPORT_SYMBOL(inet_ehash_secret);
2223 +
2224 ++u32 ipv6_hash_secret __read_mostly;
2225 ++EXPORT_SYMBOL(ipv6_hash_secret);
2226 ++
2227 + /*
2228 +- * inet_ehash_secret must be set exactly once
2229 ++ * inet_ehash_secret must be set exactly once, and to a non nul value
2230 ++ * ipv6_hash_secret must be set exactly once.
2231 + */
2232 + void build_ehash_secret(void)
2233 + {
2234 +@@ -237,7 +241,8 @@ void build_ehash_secret(void)
2235 + get_random_bytes(&rnd, sizeof(rnd));
2236 + } while (rnd == 0);
2237 +
2238 +- cmpxchg(&inet_ehash_secret, 0, rnd);
2239 ++ if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0)
2240 ++ get_random_bytes(&ipv6_hash_secret, sizeof(ipv6_hash_secret));
2241 + }
2242 + EXPORT_SYMBOL(build_ehash_secret);
2243 +
2244 +diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
2245 +index 39b403f..0ae2cf1 100644
2246 +--- a/net/ipv4/ping.c
2247 ++++ b/net/ipv4/ping.c
2248 +@@ -320,8 +320,8 @@ void ping_err(struct sk_buff *skb, u32 info)
2249 + struct iphdr *iph = (struct iphdr *)skb->data;
2250 + struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2));
2251 + struct inet_sock *inet_sock;
2252 +- int type = icmph->type;
2253 +- int code = icmph->code;
2254 ++ int type = icmp_hdr(skb)->type;
2255 ++ int code = icmp_hdr(skb)->code;
2256 + struct net *net = dev_net(skb->dev);
2257 + struct sock *sk;
2258 + int harderr;
2259 +diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
2260 +index 5c6e322..f71a0ff 100644
2261 +--- a/sound/pci/ali5451/ali5451.c
2262 ++++ b/sound/pci/ali5451/ali5451.c
2263 +@@ -1435,7 +1435,7 @@ static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream)
2264 +
2265 + spin_lock(&codec->reg_lock);
2266 + if (!pvoice->running) {
2267 +- spin_unlock_irq(&codec->reg_lock);
2268 ++ spin_unlock(&codec->reg_lock);
2269 + return 0;
2270 + }
2271 + outb(pvoice->number, ALI_REG(codec, ALI_GC_CIR));
2272 +diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
2273 +index 3c04524..1026820 100644
2274 +--- a/sound/pci/rme32.c
2275 ++++ b/sound/pci/rme32.c
2276 +@@ -1017,7 +1017,7 @@ static int snd_rme32_capture_close(struct snd_pcm_substream *substream)
2277 + spin_lock_irq(&rme32->lock);
2278 + rme32->capture_substream = NULL;
2279 + rme32->capture_periodsize = 0;
2280 +- spin_unlock(&rme32->lock);
2281 ++ spin_unlock_irq(&rme32->lock);
2282 + return 0;
2283 + }
2284 +
2285 +diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
2286 +index 7ccffb2..11a9f86 100644
2287 +--- a/sound/usb/quirks-table.h
2288 ++++ b/sound/usb/quirks-table.h
2289 +@@ -1613,7 +1613,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
2290 + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2291 + /* .vendor_name = "Roland", */
2292 + /* .product_name = "A-PRO", */
2293 +- .ifnum = 1,
2294 ++ .ifnum = 0,
2295 + .type = QUIRK_MIDI_FIXED_ENDPOINT,
2296 + .data = & (const struct snd_usb_midi_endpoint_info) {
2297 + .out_cables = 0x0003,
2298
2299 Modified: genpatches-2.6/trunk/3.2/0000_README
2300 ===================================================================
2301 --- genpatches-2.6/trunk/3.2/0000_README 2013-02-23 19:07:21 UTC (rev 2290)
2302 +++ genpatches-2.6/trunk/3.2/0000_README 2013-02-28 19:13:50 UTC (rev 2291)
2303 @@ -192,6 +192,10 @@
2304 From: http://www.kernel.org
2305 Desc: Linux 3.2.38
2306
2307 +Patch: 1038_linux-3.2.39.patch
2308 +From: http://www.kernel.org
2309 +Desc: Linux 3.2.39
2310 +
2311 Patch: 2300_per-pci-device-msi-irq-listing.patch
2312 From: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=da8d1c8ba4dcb16d60be54b233deca9a7cac98dc
2313 Desc: Add a per-pci-device subdirectory in sysfs
2314
2315 Added: genpatches-2.6/trunk/3.2/1038_linux-3.2.39.patch
2316 ===================================================================
2317 --- genpatches-2.6/trunk/3.2/1038_linux-3.2.39.patch (rev 0)
2318 +++ genpatches-2.6/trunk/3.2/1038_linux-3.2.39.patch 2013-02-28 19:13:50 UTC (rev 2291)
2319 @@ -0,0 +1,2660 @@
2320 +diff --git a/MAINTAINERS b/MAINTAINERS
2321 +index 82d7fa6..83f156e 100644
2322 +--- a/MAINTAINERS
2323 ++++ b/MAINTAINERS
2324 +@@ -2584,7 +2584,7 @@ S: Maintained
2325 + F: drivers/net/ethernet/i825xx/eexpress.*
2326 +
2327 + ETHERNET BRIDGE
2328 +-M: Stephen Hemminger <shemminger@××××××.com>
2329 ++M: Stephen Hemminger <stephen@××××××××××××××.org>
2330 + L: bridge@××××××××××××××××××××××.org
2331 + L: netdev@×××××××××××.org
2332 + W: http://www.linuxfoundation.org/en/Net:Bridge
2333 +@@ -4475,7 +4475,7 @@ S: Supported
2334 + F: drivers/infiniband/hw/nes/
2335 +
2336 + NETEM NETWORK EMULATOR
2337 +-M: Stephen Hemminger <shemminger@××××××.com>
2338 ++M: Stephen Hemminger <stephen@××××××××××××××.org>
2339 + L: netem@××××××××××××××××××××××.org
2340 + S: Maintained
2341 + F: net/sched/sch_netem.c
2342 +@@ -5993,7 +5993,7 @@ S: Maintained
2343 + F: drivers/usb/misc/sisusbvga/
2344 +
2345 + SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS
2346 +-M: Stephen Hemminger <shemminger@××××××.com>
2347 ++M: Stephen Hemminger <stephen@××××××××××××××.org>
2348 + L: netdev@×××××××××××.org
2349 + S: Maintained
2350 + F: drivers/net/ethernet/marvell/sk*
2351 +diff --git a/Makefile b/Makefile
2352 +index c8c9d02..0fceb8b 100644
2353 +--- a/Makefile
2354 ++++ b/Makefile
2355 +@@ -1,6 +1,6 @@
2356 + VERSION = 3
2357 + PATCHLEVEL = 2
2358 +-SUBLEVEL = 38
2359 ++SUBLEVEL = 39
2360 + EXTRAVERSION =
2361 + NAME = Saber-toothed Squirrel
2362 +
2363 +diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
2364 +index a6253ec..95b4eb3 100644
2365 +--- a/arch/x86/ia32/ia32entry.S
2366 ++++ b/arch/x86/ia32/ia32entry.S
2367 +@@ -208,7 +208,7 @@ sysexit_from_sys_call:
2368 + testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
2369 + jnz ia32_ret_from_sys_call
2370 + TRACE_IRQS_ON
2371 +- sti
2372 ++ ENABLE_INTERRUPTS(CLBR_NONE)
2373 + movl %eax,%esi /* second arg, syscall return value */
2374 + cmpl $0,%eax /* is it < 0? */
2375 + setl %al /* 1 if so, 0 if not */
2376 +@@ -218,7 +218,7 @@ sysexit_from_sys_call:
2377 + GET_THREAD_INFO(%r10)
2378 + movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
2379 + movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
2380 +- cli
2381 ++ DISABLE_INTERRUPTS(CLBR_NONE)
2382 + TRACE_IRQS_OFF
2383 + testl %edi,TI_flags(%r10)
2384 + jz \exit
2385 +diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
2386 +index c346d11..d4f278e 100644
2387 +--- a/arch/x86/kernel/step.c
2388 ++++ b/arch/x86/kernel/step.c
2389 +@@ -157,6 +157,34 @@ static int enable_single_step(struct task_struct *child)
2390 + return 1;
2391 + }
2392 +
2393 ++static void set_task_blockstep(struct task_struct *task, bool on)
2394 ++{
2395 ++ unsigned long debugctl;
2396 ++
2397 ++ /*
2398 ++ * Ensure irq/preemption can't change debugctl in between.
2399 ++ * Note also that both TIF_BLOCKSTEP and debugctl should
2400 ++ * be changed atomically wrt preemption.
2401 ++ *
2402 ++ * NOTE: this means that set/clear TIF_BLOCKSTEP is only safe if
2403 ++ * task is current or it can't be running, otherwise we can race
2404 ++ * with __switch_to_xtra(). We rely on ptrace_freeze_traced() but
2405 ++ * PTRACE_KILL is not safe.
2406 ++ */
2407 ++ local_irq_disable();
2408 ++ debugctl = get_debugctlmsr();
2409 ++ if (on) {
2410 ++ debugctl |= DEBUGCTLMSR_BTF;
2411 ++ set_tsk_thread_flag(task, TIF_BLOCKSTEP);
2412 ++ } else {
2413 ++ debugctl &= ~DEBUGCTLMSR_BTF;
2414 ++ clear_tsk_thread_flag(task, TIF_BLOCKSTEP);
2415 ++ }
2416 ++ if (task == current)
2417 ++ update_debugctlmsr(debugctl);
2418 ++ local_irq_enable();
2419 ++}
2420 ++
2421 + /*
2422 + * Enable single or block step.
2423 + */
2424 +@@ -169,19 +197,10 @@ static void enable_step(struct task_struct *child, bool block)
2425 + * So no one should try to use debugger block stepping in a program
2426 + * that uses user-mode single stepping itself.
2427 + */
2428 +- if (enable_single_step(child) && block) {
2429 +- unsigned long debugctl = get_debugctlmsr();
2430 +-
2431 +- debugctl |= DEBUGCTLMSR_BTF;
2432 +- update_debugctlmsr(debugctl);
2433 +- set_tsk_thread_flag(child, TIF_BLOCKSTEP);
2434 +- } else if (test_tsk_thread_flag(child, TIF_BLOCKSTEP)) {
2435 +- unsigned long debugctl = get_debugctlmsr();
2436 +-
2437 +- debugctl &= ~DEBUGCTLMSR_BTF;
2438 +- update_debugctlmsr(debugctl);
2439 +- clear_tsk_thread_flag(child, TIF_BLOCKSTEP);
2440 +- }
2441 ++ if (enable_single_step(child) && block)
2442 ++ set_task_blockstep(child, true);
2443 ++ else if (test_tsk_thread_flag(child, TIF_BLOCKSTEP))
2444 ++ set_task_blockstep(child, false);
2445 + }
2446 +
2447 + void user_enable_single_step(struct task_struct *child)
2448 +@@ -199,13 +218,8 @@ void user_disable_single_step(struct task_struct *child)
2449 + /*
2450 + * Make sure block stepping (BTF) is disabled.
2451 + */
2452 +- if (test_tsk_thread_flag(child, TIF_BLOCKSTEP)) {
2453 +- unsigned long debugctl = get_debugctlmsr();
2454 +-
2455 +- debugctl &= ~DEBUGCTLMSR_BTF;
2456 +- update_debugctlmsr(debugctl);
2457 +- clear_tsk_thread_flag(child, TIF_BLOCKSTEP);
2458 +- }
2459 ++ if (test_tsk_thread_flag(child, TIF_BLOCKSTEP))
2460 ++ set_task_blockstep(child, false);
2461 +
2462 + /* Always clear TIF_SINGLESTEP... */
2463 + clear_tsk_thread_flag(child, TIF_SINGLESTEP);
2464 +diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S
2465 +index b040b0e..7328f71 100644
2466 +--- a/arch/x86/xen/xen-asm_32.S
2467 ++++ b/arch/x86/xen/xen-asm_32.S
2468 +@@ -88,11 +88,11 @@ ENTRY(xen_iret)
2469 + */
2470 + #ifdef CONFIG_SMP
2471 + GET_THREAD_INFO(%eax)
2472 +- movl TI_cpu(%eax), %eax
2473 +- movl __per_cpu_offset(,%eax,4), %eax
2474 +- mov xen_vcpu(%eax), %eax
2475 ++ movl %ss:TI_cpu(%eax), %eax
2476 ++ movl %ss:__per_cpu_offset(,%eax,4), %eax
2477 ++ mov %ss:xen_vcpu(%eax), %eax
2478 + #else
2479 +- movl xen_vcpu, %eax
2480 ++ movl %ss:xen_vcpu, %eax
2481 + #endif
2482 +
2483 + /* check IF state we're restoring */
2484 +@@ -105,11 +105,11 @@ ENTRY(xen_iret)
2485 + * resuming the code, so we don't have to be worried about
2486 + * being preempted to another CPU.
2487 + */
2488 +- setz XEN_vcpu_info_mask(%eax)
2489 ++ setz %ss:XEN_vcpu_info_mask(%eax)
2490 + xen_iret_start_crit:
2491 +
2492 + /* check for unmasked and pending */
2493 +- cmpw $0x0001, XEN_vcpu_info_pending(%eax)
2494 ++ cmpw $0x0001, %ss:XEN_vcpu_info_pending(%eax)
2495 +
2496 + /*
2497 + * If there's something pending, mask events again so we can
2498 +@@ -117,7 +117,7 @@ xen_iret_start_crit:
2499 + * touch XEN_vcpu_info_mask.
2500 + */
2501 + jne 1f
2502 +- movb $1, XEN_vcpu_info_mask(%eax)
2503 ++ movb $1, %ss:XEN_vcpu_info_mask(%eax)
2504 +
2505 + 1: popl %eax
2506 +
2507 +diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
2508 +index b07edc4..62c1325 100644
2509 +--- a/drivers/ata/ahci.c
2510 ++++ b/drivers/ata/ahci.c
2511 +@@ -52,7 +52,9 @@
2512 + #define DRV_VERSION "3.0"
2513 +
2514 + enum {
2515 +- AHCI_PCI_BAR = 5,
2516 ++ AHCI_PCI_BAR_STA2X11 = 0,
2517 ++ AHCI_PCI_BAR_ENMOTUS = 2,
2518 ++ AHCI_PCI_BAR_STANDARD = 5,
2519 + };
2520 +
2521 + enum board_ids {
2522 +@@ -375,6 +377,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
2523 + { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 968 */
2524 + { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */
2525 +
2526 ++ /* ST Microelectronics */
2527 ++ { PCI_VDEVICE(STMICRO, 0xCC06), board_ahci }, /* ST ConneXt */
2528 ++
2529 + /* Marvell */
2530 + { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */
2531 + { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
2532 +@@ -400,6 +405,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
2533 + { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */
2534 + { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */
2535 +
2536 ++ /* Enmotus */
2537 ++ { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
2538 ++
2539 + /* Generic, PCI class code for AHCI */
2540 + { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
2541 + PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
2542 +@@ -629,6 +637,13 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
2543 + {
2544 + int rc;
2545 +
2546 ++ /*
2547 ++ * If the device fixup already set the dma_mask to some non-standard
2548 ++ * value, don't extend it here. This happens on STA2X11, for example.
2549 ++ */
2550 ++ if (pdev->dma_mask && pdev->dma_mask < DMA_BIT_MASK(32))
2551 ++ return 0;
2552 ++
2553 + if (using_dac &&
2554 + !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
2555 + rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
2556 +@@ -1033,6 +1048,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2557 + struct ahci_host_priv *hpriv;
2558 + struct ata_host *host;
2559 + int n_ports, i, rc;
2560 ++ int ahci_pci_bar = AHCI_PCI_BAR_STANDARD;
2561 +
2562 + VPRINTK("ENTER\n");
2563 +
2564 +@@ -1064,6 +1080,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2565 + dev_info(&pdev->dev,
2566 + "PDC42819 can only drive SATA devices with this driver\n");
2567 +
2568 ++ /* Both Connext and Enmotus devices use non-standard BARs */
2569 ++ if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06)
2570 ++ ahci_pci_bar = AHCI_PCI_BAR_STA2X11;
2571 ++ else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
2572 ++ ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
2573 ++
2574 + /* acquire resources */
2575 + rc = pcim_enable_device(pdev);
2576 + if (rc)
2577 +@@ -1072,7 +1094,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2578 + /* AHCI controllers often implement SFF compatible interface.
2579 + * Grab all PCI BARs just in case.
2580 + */
2581 +- rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
2582 ++ rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
2583 + if (rc == -EBUSY)
2584 + pcim_pin_device(pdev);
2585 + if (rc)
2586 +@@ -1115,7 +1137,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2587 + if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev))
2588 + pci_intx(pdev, 1);
2589 +
2590 +- hpriv->mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
2591 ++ hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar];
2592 +
2593 + /* save initial config */
2594 + ahci_pci_save_initial_config(pdev, hpriv);
2595 +@@ -1179,8 +1201,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2596 + for (i = 0; i < host->n_ports; i++) {
2597 + struct ata_port *ap = host->ports[i];
2598 +
2599 +- ata_port_pbar_desc(ap, AHCI_PCI_BAR, -1, "abar");
2600 +- ata_port_pbar_desc(ap, AHCI_PCI_BAR,
2601 ++ ata_port_pbar_desc(ap, ahci_pci_bar, -1, "abar");
2602 ++ ata_port_pbar_desc(ap, ahci_pci_bar,
2603 + 0x100 + ap->port_no * 0x80, "port");
2604 +
2605 + /* set enclosure management message type */
2606 +diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h
2607 +index 6a0955e..53ecac5 100644
2608 +--- a/drivers/atm/iphase.h
2609 ++++ b/drivers/atm/iphase.h
2610 +@@ -636,82 +636,82 @@ struct rx_buf_desc {
2611 + #define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE
2612 + #define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE
2613 +
2614 +-typedef volatile u_int freg_t;
2615 ++typedef volatile u_int ffreg_t;
2616 + typedef u_int rreg_t;
2617 +
2618 + typedef struct _ffredn_t {
2619 +- freg_t idlehead_high; /* Idle cell header (high) */
2620 +- freg_t idlehead_low; /* Idle cell header (low) */
2621 +- freg_t maxrate; /* Maximum rate */
2622 +- freg_t stparms; /* Traffic Management Parameters */
2623 +- freg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */
2624 +- freg_t rm_type; /* */
2625 +- u_int filler5[0x17 - 0x06];
2626 +- freg_t cmd_reg; /* Command register */
2627 +- u_int filler18[0x20 - 0x18];
2628 +- freg_t cbr_base; /* CBR Pointer Base */
2629 +- freg_t vbr_base; /* VBR Pointer Base */
2630 +- freg_t abr_base; /* ABR Pointer Base */
2631 +- freg_t ubr_base; /* UBR Pointer Base */
2632 +- u_int filler24;
2633 +- freg_t vbrwq_base; /* VBR Wait Queue Base */
2634 +- freg_t abrwq_base; /* ABR Wait Queue Base */
2635 +- freg_t ubrwq_base; /* UBR Wait Queue Base */
2636 +- freg_t vct_base; /* Main VC Table Base */
2637 +- freg_t vcte_base; /* Extended Main VC Table Base */
2638 +- u_int filler2a[0x2C - 0x2A];
2639 +- freg_t cbr_tab_beg; /* CBR Table Begin */
2640 +- freg_t cbr_tab_end; /* CBR Table End */
2641 +- freg_t cbr_pointer; /* CBR Pointer */
2642 +- u_int filler2f[0x30 - 0x2F];
2643 +- freg_t prq_st_adr; /* Packet Ready Queue Start Address */
2644 +- freg_t prq_ed_adr; /* Packet Ready Queue End Address */
2645 +- freg_t prq_rd_ptr; /* Packet Ready Queue read pointer */
2646 +- freg_t prq_wr_ptr; /* Packet Ready Queue write pointer */
2647 +- freg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/
2648 +- freg_t tcq_ed_adr; /* Transmit Complete Queue End Address */
2649 +- freg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */
2650 +- freg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/
2651 +- u_int filler38[0x40 - 0x38];
2652 +- freg_t queue_base; /* Base address for PRQ and TCQ */
2653 +- freg_t desc_base; /* Base address of descriptor table */
2654 +- u_int filler42[0x45 - 0x42];
2655 +- freg_t mode_reg_0; /* Mode register 0 */
2656 +- freg_t mode_reg_1; /* Mode register 1 */
2657 +- freg_t intr_status_reg;/* Interrupt Status register */
2658 +- freg_t mask_reg; /* Mask Register */
2659 +- freg_t cell_ctr_high1; /* Total cell transfer count (high) */
2660 +- freg_t cell_ctr_lo1; /* Total cell transfer count (low) */
2661 +- freg_t state_reg; /* Status register */
2662 +- u_int filler4c[0x58 - 0x4c];
2663 +- freg_t curr_desc_num; /* Contains the current descriptor num */
2664 +- freg_t next_desc; /* Next descriptor */
2665 +- freg_t next_vc; /* Next VC */
2666 +- u_int filler5b[0x5d - 0x5b];
2667 +- freg_t present_slot_cnt;/* Present slot count */
2668 +- u_int filler5e[0x6a - 0x5e];
2669 +- freg_t new_desc_num; /* New descriptor number */
2670 +- freg_t new_vc; /* New VC */
2671 +- freg_t sched_tbl_ptr; /* Schedule table pointer */
2672 +- freg_t vbrwq_wptr; /* VBR wait queue write pointer */
2673 +- freg_t vbrwq_rptr; /* VBR wait queue read pointer */
2674 +- freg_t abrwq_wptr; /* ABR wait queue write pointer */
2675 +- freg_t abrwq_rptr; /* ABR wait queue read pointer */
2676 +- freg_t ubrwq_wptr; /* UBR wait queue write pointer */
2677 +- freg_t ubrwq_rptr; /* UBR wait queue read pointer */
2678 +- freg_t cbr_vc; /* CBR VC */
2679 +- freg_t vbr_sb_vc; /* VBR SB VC */
2680 +- freg_t abr_sb_vc; /* ABR SB VC */
2681 +- freg_t ubr_sb_vc; /* UBR SB VC */
2682 +- freg_t vbr_next_link; /* VBR next link */
2683 +- freg_t abr_next_link; /* ABR next link */
2684 +- freg_t ubr_next_link; /* UBR next link */
2685 +- u_int filler7a[0x7c-0x7a];
2686 +- freg_t out_rate_head; /* Out of rate head */
2687 +- u_int filler7d[0xca-0x7d]; /* pad out to full address space */
2688 +- freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */
2689 +- freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */
2690 +- u_int fillercc[0x100-0xcc]; /* pad out to full address space */
2691 ++ ffreg_t idlehead_high; /* Idle cell header (high) */
2692 ++ ffreg_t idlehead_low; /* Idle cell header (low) */
2693 ++ ffreg_t maxrate; /* Maximum rate */
2694 ++ ffreg_t stparms; /* Traffic Management Parameters */
2695 ++ ffreg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */
2696 ++ ffreg_t rm_type; /* */
2697 ++ u_int filler5[0x17 - 0x06];
2698 ++ ffreg_t cmd_reg; /* Command register */
2699 ++ u_int filler18[0x20 - 0x18];
2700 ++ ffreg_t cbr_base; /* CBR Pointer Base */
2701 ++ ffreg_t vbr_base; /* VBR Pointer Base */
2702 ++ ffreg_t abr_base; /* ABR Pointer Base */
2703 ++ ffreg_t ubr_base; /* UBR Pointer Base */
2704 ++ u_int filler24;
2705 ++ ffreg_t vbrwq_base; /* VBR Wait Queue Base */
2706 ++ ffreg_t abrwq_base; /* ABR Wait Queue Base */
2707 ++ ffreg_t ubrwq_base; /* UBR Wait Queue Base */
2708 ++ ffreg_t vct_base; /* Main VC Table Base */
2709 ++ ffreg_t vcte_base; /* Extended Main VC Table Base */
2710 ++ u_int filler2a[0x2C - 0x2A];
2711 ++ ffreg_t cbr_tab_beg; /* CBR Table Begin */
2712 ++ ffreg_t cbr_tab_end; /* CBR Table End */
2713 ++ ffreg_t cbr_pointer; /* CBR Pointer */
2714 ++ u_int filler2f[0x30 - 0x2F];
2715 ++ ffreg_t prq_st_adr; /* Packet Ready Queue Start Address */
2716 ++ ffreg_t prq_ed_adr; /* Packet Ready Queue End Address */
2717 ++ ffreg_t prq_rd_ptr; /* Packet Ready Queue read pointer */
2718 ++ ffreg_t prq_wr_ptr; /* Packet Ready Queue write pointer */
2719 ++ ffreg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/
2720 ++ ffreg_t tcq_ed_adr; /* Transmit Complete Queue End Address */
2721 ++ ffreg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */
2722 ++ ffreg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/
2723 ++ u_int filler38[0x40 - 0x38];
2724 ++ ffreg_t queue_base; /* Base address for PRQ and TCQ */
2725 ++ ffreg_t desc_base; /* Base address of descriptor table */
2726 ++ u_int filler42[0x45 - 0x42];
2727 ++ ffreg_t mode_reg_0; /* Mode register 0 */
2728 ++ ffreg_t mode_reg_1; /* Mode register 1 */
2729 ++ ffreg_t intr_status_reg;/* Interrupt Status register */
2730 ++ ffreg_t mask_reg; /* Mask Register */
2731 ++ ffreg_t cell_ctr_high1; /* Total cell transfer count (high) */
2732 ++ ffreg_t cell_ctr_lo1; /* Total cell transfer count (low) */
2733 ++ ffreg_t state_reg; /* Status register */
2734 ++ u_int filler4c[0x58 - 0x4c];
2735 ++ ffreg_t curr_desc_num; /* Contains the current descriptor num */
2736 ++ ffreg_t next_desc; /* Next descriptor */
2737 ++ ffreg_t next_vc; /* Next VC */
2738 ++ u_int filler5b[0x5d - 0x5b];
2739 ++ ffreg_t present_slot_cnt;/* Present slot count */
2740 ++ u_int filler5e[0x6a - 0x5e];
2741 ++ ffreg_t new_desc_num; /* New descriptor number */
2742 ++ ffreg_t new_vc; /* New VC */
2743 ++ ffreg_t sched_tbl_ptr; /* Schedule table pointer */
2744 ++ ffreg_t vbrwq_wptr; /* VBR wait queue write pointer */
2745 ++ ffreg_t vbrwq_rptr; /* VBR wait queue read pointer */
2746 ++ ffreg_t abrwq_wptr; /* ABR wait queue write pointer */
2747 ++ ffreg_t abrwq_rptr; /* ABR wait queue read pointer */
2748 ++ ffreg_t ubrwq_wptr; /* UBR wait queue write pointer */
2749 ++ ffreg_t ubrwq_rptr; /* UBR wait queue read pointer */
2750 ++ ffreg_t cbr_vc; /* CBR VC */
2751 ++ ffreg_t vbr_sb_vc; /* VBR SB VC */
2752 ++ ffreg_t abr_sb_vc; /* ABR SB VC */
2753 ++ ffreg_t ubr_sb_vc; /* UBR SB VC */
2754 ++ ffreg_t vbr_next_link; /* VBR next link */
2755 ++ ffreg_t abr_next_link; /* ABR next link */
2756 ++ ffreg_t ubr_next_link; /* UBR next link */
2757 ++ u_int filler7a[0x7c-0x7a];
2758 ++ ffreg_t out_rate_head; /* Out of rate head */
2759 ++ u_int filler7d[0xca-0x7d]; /* pad out to full address space */
2760 ++ ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */
2761 ++ ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */
2762 ++ u_int fillercc[0x100-0xcc]; /* pad out to full address space */
2763 + } ffredn_t;
2764 +
2765 + typedef struct _rfredn_t {
2766 +diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
2767 +index 8e3c46d..7795d1e 100644
2768 +--- a/drivers/char/virtio_console.c
2769 ++++ b/drivers/char/virtio_console.c
2770 +@@ -1789,7 +1789,8 @@ static void virtcons_remove(struct virtio_device *vdev)
2771 + /* Disable interrupts for vqs */
2772 + vdev->config->reset(vdev);
2773 + /* Finish up work that's lined up */
2774 +- cancel_work_sync(&portdev->control_work);
2775 ++ if (use_multiport(portdev))
2776 ++ cancel_work_sync(&portdev->control_work);
2777 +
2778 + list_for_each_entry_safe(port, port2, &portdev->ports, list)
2779 + unplug_port(port);
2780 +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
2781 +index c05e825..7817429 100644
2782 +--- a/drivers/gpu/drm/i915/intel_display.c
2783 ++++ b/drivers/gpu/drm/i915/intel_display.c
2784 +@@ -7156,8 +7156,6 @@ static int intel_gen4_queue_flip(struct drm_device *dev,
2785 + OUT_RING(pf | pipesrc);
2786 +
2787 + intel_mark_page_flip_active(intel_crtc);
2788 +-
2789 +- intel_mark_page_flip_active(intel_crtc);
2790 + ADVANCE_LP_RING();
2791 + return 0;
2792 +
2793 +@@ -7193,6 +7191,8 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
2794 + pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
2795 + pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
2796 + OUT_RING(pf | pipesrc);
2797 ++
2798 ++ intel_mark_page_flip_active(intel_crtc);
2799 + ADVANCE_LP_RING();
2800 + return 0;
2801 +
2802 +diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
2803 +index 1b98338..ec36dd9 100644
2804 +--- a/drivers/gpu/drm/radeon/radeon_combios.c
2805 ++++ b/drivers/gpu/drm/radeon/radeon_combios.c
2806 +@@ -2455,6 +2455,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
2807 + 1),
2808 + ATOM_DEVICE_CRT1_SUPPORT);
2809 + }
2810 ++ /* RV100 board with external TDMS bit mis-set.
2811 ++ * Actually uses internal TMDS, clear the bit.
2812 ++ */
2813 ++ if (dev->pdev->device == 0x5159 &&
2814 ++ dev->pdev->subsystem_vendor == 0x1014 &&
2815 ++ dev->pdev->subsystem_device == 0x029A) {
2816 ++ tmp &= ~(1 << 4);
2817 ++ }
2818 + if ((tmp >> 4) & 0x1) {
2819 + devices |= ATOM_DEVICE_DFP2_SUPPORT;
2820 + radeon_add_legacy_encoder(dev,
2821 +diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
2822 +index aec8e0c..63e7143 100644
2823 +--- a/drivers/gpu/drm/radeon/radeon_display.c
2824 ++++ b/drivers/gpu/drm/radeon/radeon_display.c
2825 +@@ -1110,8 +1110,10 @@ radeon_user_framebuffer_create(struct drm_device *dev,
2826 + }
2827 +
2828 + radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);
2829 +- if (radeon_fb == NULL)
2830 ++ if (radeon_fb == NULL) {
2831 ++ drm_gem_object_unreference_unlocked(obj);
2832 + return ERR_PTR(-ENOMEM);
2833 ++ }
2834 +
2835 + radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);
2836 +
2837 +diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
2838 +index 49d5820..65be5e8 100644
2839 +--- a/drivers/gpu/drm/radeon/radeon_ring.c
2840 ++++ b/drivers/gpu/drm/radeon/radeon_ring.c
2841 +@@ -306,6 +306,9 @@ int radeon_ring_alloc(struct radeon_device *rdev, unsigned ndw)
2842 + {
2843 + int r;
2844 +
2845 ++ /* make sure we aren't trying to allocate more space than there is on the ring */
2846 ++ if (ndw > (rdev->cp.ring_size / 4))
2847 ++ return -ENOMEM;
2848 + /* Align requested size with padding so unlock_commit can
2849 + * pad safely */
2850 + ndw = (ndw + rdev->cp.align_mask) & ~rdev->cp.align_mask;
2851 +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
2852 +index 2d41336..c15c38e 100644
2853 +--- a/drivers/hid/hid-ids.h
2854 ++++ b/drivers/hid/hid-ids.h
2855 +@@ -278,6 +278,9 @@
2856 + #define USB_VENDOR_ID_EZKEY 0x0518
2857 + #define USB_DEVICE_ID_BTC_8193 0x0002
2858 +
2859 ++#define USB_VENDOR_ID_FORMOSA 0x147a
2860 ++#define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e
2861 ++
2862 + #define USB_VENDOR_ID_FREESCALE 0x15A2
2863 + #define USB_DEVICE_ID_FREESCALE_MX28 0x004F
2864 +
2865 +diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
2866 +index aec3fa3..e26eddf 100644
2867 +--- a/drivers/hid/usbhid/hid-quirks.c
2868 ++++ b/drivers/hid/usbhid/hid-quirks.c
2869 +@@ -68,6 +68,7 @@ static const struct hid_blacklist {
2870 + { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
2871 + { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
2872 + { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
2873 ++ { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
2874 + { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
2875 + { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
2876 + { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
2877 +diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
2878 +index fd17bb3..08c2329 100644
2879 +--- a/drivers/isdn/gigaset/capi.c
2880 ++++ b/drivers/isdn/gigaset/capi.c
2881 +@@ -264,6 +264,8 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
2882 + CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l,
2883 + CAPIMSG_CONTROL(data));
2884 + l -= 12;
2885 ++ if (l <= 0)
2886 ++ return;
2887 + dbgline = kmalloc(3*l, GFP_ATOMIC);
2888 + if (!dbgline)
2889 + return;
2890 +diff --git a/drivers/media/video/gspca/kinect.c b/drivers/media/video/gspca/kinect.c
2891 +index 4fe51fd..acaef66 100644
2892 +--- a/drivers/media/video/gspca/kinect.c
2893 ++++ b/drivers/media/video/gspca/kinect.c
2894 +@@ -390,6 +390,7 @@ static const struct sd_desc sd_desc = {
2895 + /* -- module initialisation -- */
2896 + static const struct usb_device_id device_table[] = {
2897 + {USB_DEVICE(0x045e, 0x02ae)},
2898 ++ {USB_DEVICE(0x045e, 0x02bf)},
2899 + {}
2900 + };
2901 +
2902 +diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
2903 +index 21a3d77..64647d4 100644
2904 +--- a/drivers/net/can/c_can/c_can.c
2905 ++++ b/drivers/net/can/c_can/c_can.c
2906 +@@ -446,8 +446,12 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface,
2907 +
2908 + priv->write_reg(priv, &priv->regs->ifregs[iface].mask1,
2909 + IFX_WRITE_LOW_16BIT(mask));
2910 ++
2911 ++ /* According to C_CAN documentation, the reserved bit
2912 ++ * in IFx_MASK2 register is fixed 1
2913 ++ */
2914 + priv->write_reg(priv, &priv->regs->ifregs[iface].mask2,
2915 +- IFX_WRITE_HIGH_16BIT(mask));
2916 ++ IFX_WRITE_HIGH_16BIT(mask) | BIT(13));
2917 +
2918 + priv->write_reg(priv, &priv->regs->ifregs[iface].arb1,
2919 + IFX_WRITE_LOW_16BIT(id));
2920 +diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
2921 +index 01bc102..c86fa50 100644
2922 +--- a/drivers/net/ethernet/broadcom/tg3.c
2923 ++++ b/drivers/net/ethernet/broadcom/tg3.c
2924 +@@ -1135,14 +1135,26 @@ static int tg3_phy_auxctl_write(struct tg3 *tp, int reg, u32 set)
2925 + return tg3_writephy(tp, MII_TG3_AUX_CTRL, set | reg);
2926 + }
2927 +
2928 +-#define TG3_PHY_AUXCTL_SMDSP_ENABLE(tp) \
2929 +- tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \
2930 +- MII_TG3_AUXCTL_ACTL_SMDSP_ENA | \
2931 +- MII_TG3_AUXCTL_ACTL_TX_6DB)
2932 ++static int tg3_phy_toggle_auxctl_smdsp(struct tg3 *tp, bool enable)
2933 ++{
2934 ++ u32 val;
2935 ++ int err;
2936 +
2937 +-#define TG3_PHY_AUXCTL_SMDSP_DISABLE(tp) \
2938 +- tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \
2939 +- MII_TG3_AUXCTL_ACTL_TX_6DB);
2940 ++ err = tg3_phy_auxctl_read(tp, MII_TG3_AUXCTL_SHDWSEL_AUXCTL, &val);
2941 ++
2942 ++ if (err)
2943 ++ return err;
2944 ++ if (enable)
2945 ++
2946 ++ val |= MII_TG3_AUXCTL_ACTL_SMDSP_ENA;
2947 ++ else
2948 ++ val &= ~MII_TG3_AUXCTL_ACTL_SMDSP_ENA;
2949 ++
2950 ++ err = tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL,
2951 ++ val | MII_TG3_AUXCTL_ACTL_TX_6DB);
2952 ++
2953 ++ return err;
2954 ++}
2955 +
2956 + static int tg3_bmcr_reset(struct tg3 *tp)
2957 + {
2958 +@@ -2087,7 +2099,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
2959 +
2960 + otp = tp->phy_otp;
2961 +
2962 +- if (TG3_PHY_AUXCTL_SMDSP_ENABLE(tp))
2963 ++ if (tg3_phy_toggle_auxctl_smdsp(tp, true))
2964 + return;
2965 +
2966 + phy = ((otp & TG3_OTP_AGCTGT_MASK) >> TG3_OTP_AGCTGT_SHIFT);
2967 +@@ -2112,7 +2124,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
2968 + ((otp & TG3_OTP_RCOFF_MASK) >> TG3_OTP_RCOFF_SHIFT);
2969 + tg3_phydsp_write(tp, MII_TG3_DSP_EXP97, phy);
2970 +
2971 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
2972 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
2973 + }
2974 +
2975 + static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
2976 +@@ -2148,9 +2160,9 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
2977 +
2978 + if (!tp->setlpicnt) {
2979 + if (current_link_up == 1 &&
2980 +- !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
2981 ++ !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
2982 + tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
2983 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
2984 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
2985 + }
2986 +
2987 + val = tr32(TG3_CPMU_EEE_MODE);
2988 +@@ -2166,11 +2178,11 @@ static void tg3_phy_eee_enable(struct tg3 *tp)
2989 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
2990 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
2991 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
2992 +- !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
2993 ++ !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
2994 + val = MII_TG3_DSP_TAP26_ALNOKO |
2995 + MII_TG3_DSP_TAP26_RMRXSTO;
2996 + tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
2997 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
2998 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
2999 + }
3000 +
3001 + val = tr32(TG3_CPMU_EEE_MODE);
3002 +@@ -2314,7 +2326,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
3003 + tg3_writephy(tp, MII_CTRL1000,
3004 + CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER);
3005 +
3006 +- err = TG3_PHY_AUXCTL_SMDSP_ENABLE(tp);
3007 ++ err = tg3_phy_toggle_auxctl_smdsp(tp, true);
3008 + if (err)
3009 + return err;
3010 +
3011 +@@ -2335,7 +2347,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
3012 + tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8200);
3013 + tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0000);
3014 +
3015 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
3016 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
3017 +
3018 + tg3_writephy(tp, MII_CTRL1000, phy9_orig);
3019 +
3020 +@@ -2424,10 +2436,10 @@ static int tg3_phy_reset(struct tg3 *tp)
3021 +
3022 + out:
3023 + if ((tp->phy_flags & TG3_PHYFLG_ADC_BUG) &&
3024 +- !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
3025 ++ !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
3026 + tg3_phydsp_write(tp, 0x201f, 0x2aaa);
3027 + tg3_phydsp_write(tp, 0x000a, 0x0323);
3028 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
3029 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
3030 + }
3031 +
3032 + if (tp->phy_flags & TG3_PHYFLG_5704_A0_BUG) {
3033 +@@ -2436,14 +2448,14 @@ out:
3034 + }
3035 +
3036 + if (tp->phy_flags & TG3_PHYFLG_BER_BUG) {
3037 +- if (!TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
3038 ++ if (!tg3_phy_toggle_auxctl_smdsp(tp, true)) {
3039 + tg3_phydsp_write(tp, 0x000a, 0x310b);
3040 + tg3_phydsp_write(tp, 0x201f, 0x9506);
3041 + tg3_phydsp_write(tp, 0x401f, 0x14e2);
3042 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
3043 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
3044 + }
3045 + } else if (tp->phy_flags & TG3_PHYFLG_JITTER_BUG) {
3046 +- if (!TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
3047 ++ if (!tg3_phy_toggle_auxctl_smdsp(tp, true)) {
3048 + tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
3049 + if (tp->phy_flags & TG3_PHYFLG_ADJUST_TRIM) {
3050 + tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x110b);
3051 +@@ -2452,7 +2464,7 @@ out:
3052 + } else
3053 + tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x010b);
3054 +
3055 +- TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
3056 ++ tg3_phy_toggle_auxctl_smdsp(tp, false);
3057 + }
3058 + }
3059 +
3060 +@@ -3639,7 +3651,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
3061 + tw32(TG3_CPMU_EEE_MODE,
3062 + tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE);
3063 +
3064 +- err = TG3_PHY_AUXCTL_SMDSP_ENABLE(tp);
3065 ++ err = tg3_phy_toggle_auxctl_smdsp(tp, true);
3066 + if (!err) {
3067 + u32 err2;
3068 +
3069 +@@ -3671,7 +3683,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
3070 + MII_TG3_DSP_CH34TP2_HIBW01);
3071 + }
3072 +
3073 +- err2 = TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
3074 ++ err2 = tg3_phy_toggle_auxctl_smdsp(tp, false);
3075 + if (!err)
3076 + err = err2;
3077 + }
3078 +@@ -6353,6 +6365,9 @@ static void tg3_poll_controller(struct net_device *dev)
3079 + int i;
3080 + struct tg3 *tp = netdev_priv(dev);
3081 +
3082 ++ if (tg3_irq_sync(tp))
3083 ++ return;
3084 ++
3085 + for (i = 0; i < tp->irq_cnt; i++)
3086 + tg3_interrupt(tp->napi[i].irq_vec, &tp->napi[i]);
3087 + }
3088 +@@ -15388,6 +15403,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
3089 + tp->pm_cap = pm_cap;
3090 + tp->rx_mode = TG3_DEF_RX_MODE;
3091 + tp->tx_mode = TG3_DEF_TX_MODE;
3092 ++ tp->irq_sync = 1;
3093 +
3094 + if (tg3_debug > 0)
3095 + tp->msg_enable = tg3_debug;
3096 +diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
3097 +index a8259cc..5674145 100644
3098 +--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
3099 ++++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
3100 +@@ -144,7 +144,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter)
3101 + buffrag->length, PCI_DMA_TODEVICE);
3102 + buffrag->dma = 0ULL;
3103 + }
3104 +- for (j = 0; j < cmd_buf->frag_count; j++) {
3105 ++ for (j = 1; j < cmd_buf->frag_count; j++) {
3106 + buffrag++;
3107 + if (buffrag->dma) {
3108 + pci_unmap_page(adapter->pdev, buffrag->dma,
3109 +diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
3110 +index da5204d..4a238a4 100644
3111 +--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
3112 ++++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
3113 +@@ -1924,10 +1924,12 @@ unwind:
3114 + while (--i >= 0) {
3115 + nf = &pbuf->frag_array[i+1];
3116 + pci_unmap_page(pdev, nf->dma, nf->length, PCI_DMA_TODEVICE);
3117 ++ nf->dma = 0ULL;
3118 + }
3119 +
3120 + nf = &pbuf->frag_array[0];
3121 + pci_unmap_single(pdev, nf->dma, skb_headlen(skb), PCI_DMA_TODEVICE);
3122 ++ nf->dma = 0ULL;
3123 +
3124 + out_err:
3125 + return -ENOMEM;
3126 +diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
3127 +index b8db4cd..a6153f1 100644
3128 +--- a/drivers/net/ethernet/realtek/r8169.c
3129 ++++ b/drivers/net/ethernet/realtek/r8169.c
3130 +@@ -5829,13 +5829,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
3131 + dev->stats.rx_bytes += pkt_size;
3132 + dev->stats.rx_packets++;
3133 + }
3134 +-
3135 +- /* Work around for AMD plateform. */
3136 +- if ((desc->opts2 & cpu_to_le32(0xfffe000)) &&
3137 +- (tp->mac_version == RTL_GIGA_MAC_VER_05)) {
3138 +- desc->opts2 = 0;
3139 +- cur_rx++;
3140 +- }
3141 + }
3142 +
3143 + count = cur_rx - tp->cur_rx;
3144 +diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
3145 +index 4ce9e5f..d0893e4 100644
3146 +--- a/drivers/net/loopback.c
3147 ++++ b/drivers/net/loopback.c
3148 +@@ -78,6 +78,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
3149 +
3150 + skb_orphan(skb);
3151 +
3152 ++ /* Before queueing this packet to netif_rx(),
3153 ++ * make sure dst is refcounted.
3154 ++ */
3155 ++ skb_dst_force(skb);
3156 ++
3157 + skb->protocol = eth_type_trans(skb, dev);
3158 +
3159 + /* it's OK to use per_cpu_ptr() because BHs are off */
3160 +diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
3161 +index 8d3ab37..6618dd6 100644
3162 +--- a/drivers/net/wireless/mwifiex/scan.c
3163 ++++ b/drivers/net/wireless/mwifiex/scan.c
3164 +@@ -1594,7 +1594,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
3165 + dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n",
3166 + scan_rsp->number_of_sets);
3167 + ret = -1;
3168 +- goto done;
3169 ++ goto check_next_scan;
3170 + }
3171 +
3172 + bytes_left = le16_to_cpu(scan_rsp->bss_descript_size);
3173 +@@ -1663,7 +1663,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
3174 + if (!beacon_size || beacon_size > bytes_left) {
3175 + bss_info += bytes_left;
3176 + bytes_left = 0;
3177 +- return -1;
3178 ++ ret = -1;
3179 ++ goto check_next_scan;
3180 + }
3181 +
3182 + /* Initialize the current working beacon pointer for this BSS
3183 +@@ -1716,7 +1717,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
3184 + dev_err(priv->adapter->dev, "%s: in processing"
3185 + " IE, bytes left < IE length\n",
3186 + __func__);
3187 +- goto done;
3188 ++ goto check_next_scan;
3189 + }
3190 + if (element_id == WLAN_EID_DS_PARAMS) {
3191 + channel = *(u8 *) (current_ptr +
3192 +@@ -1782,6 +1783,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
3193 + }
3194 + }
3195 +
3196 ++check_next_scan:
3197 + spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
3198 + if (list_empty(&adapter->scan_pending_q)) {
3199 + spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
3200 +@@ -1812,7 +1814,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
3201 + mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, true);
3202 + }
3203 +
3204 +-done:
3205 + return ret;
3206 + }
3207 +
3208 +diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
3209 +index 22ed6df..2be9880 100644
3210 +--- a/drivers/net/wireless/rt2x00/rt2500usb.c
3211 ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c
3212 +@@ -1921,7 +1921,7 @@ static struct usb_device_id rt2500usb_device_table[] = {
3213 + { USB_DEVICE(0x0b05, 0x1706) },
3214 + { USB_DEVICE(0x0b05, 0x1707) },
3215 + /* Belkin */
3216 +- { USB_DEVICE(0x050d, 0x7050) },
3217 ++ { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050A ver. 2.x */
3218 + { USB_DEVICE(0x050d, 0x7051) },
3219 + /* Cisco Systems */
3220 + { USB_DEVICE(0x13b1, 0x000d) },
3221 +diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
3222 +index b66a61b..3d4ea1f 100644
3223 +--- a/drivers/net/wireless/rt2x00/rt2800usb.c
3224 ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c
3225 +@@ -959,6 +959,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
3226 + { USB_DEVICE(0x07d1, 0x3c15) },
3227 + { USB_DEVICE(0x07d1, 0x3c16) },
3228 + { USB_DEVICE(0x2001, 0x3c1b) },
3229 ++ { USB_DEVICE(0x2001, 0x3c1e) },
3230 + /* Draytek */
3231 + { USB_DEVICE(0x07fa, 0x7712) },
3232 + /* DVICO */
3233 +@@ -1090,6 +1091,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
3234 + { USB_DEVICE(0x177f, 0x0153) },
3235 + { USB_DEVICE(0x177f, 0x0302) },
3236 + { USB_DEVICE(0x177f, 0x0313) },
3237 ++ { USB_DEVICE(0x177f, 0x0323) },
3238 + /* U-Media */
3239 + { USB_DEVICE(0x157e, 0x300e) },
3240 + { USB_DEVICE(0x157e, 0x3013) },
3241 +diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
3242 +index 2ad468d..9e724eb 100644
3243 +--- a/drivers/net/wireless/rt2x00/rt73usb.c
3244 ++++ b/drivers/net/wireless/rt2x00/rt73usb.c
3245 +@@ -2421,6 +2421,7 @@ static struct usb_device_id rt73usb_device_table[] = {
3246 + { USB_DEVICE(0x0b05, 0x1723) },
3247 + { USB_DEVICE(0x0b05, 0x1724) },
3248 + /* Belkin */
3249 ++ { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050B ver. 3.x */
3250 + { USB_DEVICE(0x050d, 0x705a) },
3251 + { USB_DEVICE(0x050d, 0x905b) },
3252 + { USB_DEVICE(0x050d, 0x905c) },
3253 +diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
3254 +index a49e848..30dd0a9 100644
3255 +--- a/drivers/net/wireless/rtlwifi/usb.c
3256 ++++ b/drivers/net/wireless/rtlwifi/usb.c
3257 +@@ -503,8 +503,8 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb)
3258 + WARN_ON(skb_queue_empty(&rx_queue));
3259 + while (!skb_queue_empty(&rx_queue)) {
3260 + _skb = skb_dequeue(&rx_queue);
3261 +- _rtl_usb_rx_process_agg(hw, skb);
3262 +- ieee80211_rx_irqsafe(hw, skb);
3263 ++ _rtl_usb_rx_process_agg(hw, _skb);
3264 ++ ieee80211_rx_irqsafe(hw, _skb);
3265 + }
3266 + }
3267 +
3268 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
3269 +index 94b79c3..9d7f172 100644
3270 +--- a/drivers/net/xen-netback/common.h
3271 ++++ b/drivers/net/xen-netback/common.h
3272 +@@ -151,6 +151,9 @@ void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb);
3273 + /* Notify xenvif that ring now has space to send an skb to the frontend */
3274 + void xenvif_notify_tx_completion(struct xenvif *vif);
3275 +
3276 ++/* Prevent the device from generating any further traffic. */
3277 ++void xenvif_carrier_off(struct xenvif *vif);
3278 ++
3279 + /* Returns number of ring slots required to send an skb to the frontend */
3280 + unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb);
3281 +
3282 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
3283 +index 1825629..5925e0b 100644
3284 +--- a/drivers/net/xen-netback/interface.c
3285 ++++ b/drivers/net/xen-netback/interface.c
3286 +@@ -342,17 +342,22 @@ err:
3287 + return err;
3288 + }
3289 +
3290 +-void xenvif_disconnect(struct xenvif *vif)
3291 ++void xenvif_carrier_off(struct xenvif *vif)
3292 + {
3293 + struct net_device *dev = vif->dev;
3294 +- if (netif_carrier_ok(dev)) {
3295 +- rtnl_lock();
3296 +- netif_carrier_off(dev); /* discard queued packets */
3297 +- if (netif_running(dev))
3298 +- xenvif_down(vif);
3299 +- rtnl_unlock();
3300 +- xenvif_put(vif);
3301 +- }
3302 ++
3303 ++ rtnl_lock();
3304 ++ netif_carrier_off(dev); /* discard queued packets */
3305 ++ if (netif_running(dev))
3306 ++ xenvif_down(vif);
3307 ++ rtnl_unlock();
3308 ++ xenvif_put(vif);
3309 ++}
3310 ++
3311 ++void xenvif_disconnect(struct xenvif *vif)
3312 ++{
3313 ++ if (netif_carrier_ok(vif->dev))
3314 ++ xenvif_carrier_off(vif);
3315 +
3316 + atomic_dec(&vif->refcnt);
3317 + wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0);
3318 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
3319 +index 15e332d..b802bb3 100644
3320 +--- a/drivers/net/xen-netback/netback.c
3321 ++++ b/drivers/net/xen-netback/netback.c
3322 +@@ -146,7 +146,8 @@ void xen_netbk_remove_xenvif(struct xenvif *vif)
3323 + atomic_dec(&netbk->netfront_count);
3324 + }
3325 +
3326 +-static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx);
3327 ++static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx,
3328 ++ u8 status);
3329 + static void make_tx_response(struct xenvif *vif,
3330 + struct xen_netif_tx_request *txp,
3331 + s8 st);
3332 +@@ -851,7 +852,7 @@ static void netbk_tx_err(struct xenvif *vif,
3333 +
3334 + do {
3335 + make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);
3336 +- if (cons >= end)
3337 ++ if (cons == end)
3338 + break;
3339 + txp = RING_GET_REQUEST(&vif->tx, cons++);
3340 + } while (1);
3341 +@@ -860,6 +861,13 @@ static void netbk_tx_err(struct xenvif *vif,
3342 + xenvif_put(vif);
3343 + }
3344 +
3345 ++static void netbk_fatal_tx_err(struct xenvif *vif)
3346 ++{
3347 ++ netdev_err(vif->dev, "fatal error; disabling device\n");
3348 ++ xenvif_carrier_off(vif);
3349 ++ xenvif_put(vif);
3350 ++}
3351 ++
3352 + static int netbk_count_requests(struct xenvif *vif,
3353 + struct xen_netif_tx_request *first,
3354 + struct xen_netif_tx_request *txp,
3355 +@@ -873,19 +881,22 @@ static int netbk_count_requests(struct xenvif *vif,
3356 +
3357 + do {
3358 + if (frags >= work_to_do) {
3359 +- netdev_dbg(vif->dev, "Need more frags\n");
3360 ++ netdev_err(vif->dev, "Need more frags\n");
3361 ++ netbk_fatal_tx_err(vif);
3362 + return -frags;
3363 + }
3364 +
3365 + if (unlikely(frags >= MAX_SKB_FRAGS)) {
3366 +- netdev_dbg(vif->dev, "Too many frags\n");
3367 ++ netdev_err(vif->dev, "Too many frags\n");
3368 ++ netbk_fatal_tx_err(vif);
3369 + return -frags;
3370 + }
3371 +
3372 + memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags),
3373 + sizeof(*txp));
3374 + if (txp->size > first->size) {
3375 +- netdev_dbg(vif->dev, "Frags galore\n");
3376 ++ netdev_err(vif->dev, "Frag is bigger than frame.\n");
3377 ++ netbk_fatal_tx_err(vif);
3378 + return -frags;
3379 + }
3380 +
3381 +@@ -893,8 +904,9 @@ static int netbk_count_requests(struct xenvif *vif,
3382 + frags++;
3383 +
3384 + if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) {
3385 +- netdev_dbg(vif->dev, "txp->offset: %x, size: %u\n",
3386 ++ netdev_err(vif->dev, "txp->offset: %x, size: %u\n",
3387 + txp->offset, txp->size);
3388 ++ netbk_fatal_tx_err(vif);
3389 + return -frags;
3390 + }
3391 + } while ((txp++)->flags & XEN_NETTXF_more_data);
3392 +@@ -938,7 +950,7 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
3393 + pending_idx = netbk->pending_ring[index];
3394 + page = xen_netbk_alloc_page(netbk, skb, pending_idx);
3395 + if (!page)
3396 +- return NULL;
3397 ++ goto err;
3398 +
3399 + netbk->mmap_pages[pending_idx] = page;
3400 +
3401 +@@ -962,6 +974,17 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk,
3402 + }
3403 +
3404 + return gop;
3405 ++err:
3406 ++ /* Unwind, freeing all pages and sending error responses. */
3407 ++ while (i-- > start) {
3408 ++ xen_netbk_idx_release(netbk, frag_get_pending_idx(&frags[i]),
3409 ++ XEN_NETIF_RSP_ERROR);
3410 ++ }
3411 ++ /* The head too, if necessary. */
3412 ++ if (start)
3413 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);
3414 ++
3415 ++ return NULL;
3416 + }
3417 +
3418 + static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
3419 +@@ -970,30 +993,20 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
3420 + {
3421 + struct gnttab_copy *gop = *gopp;
3422 + u16 pending_idx = *((u16 *)skb->data);
3423 +- struct pending_tx_info *pending_tx_info = netbk->pending_tx_info;
3424 +- struct xenvif *vif = pending_tx_info[pending_idx].vif;
3425 +- struct xen_netif_tx_request *txp;
3426 + struct skb_shared_info *shinfo = skb_shinfo(skb);
3427 + int nr_frags = shinfo->nr_frags;
3428 + int i, err, start;
3429 +
3430 + /* Check status of header. */
3431 + err = gop->status;
3432 +- if (unlikely(err)) {
3433 +- pending_ring_idx_t index;
3434 +- index = pending_index(netbk->pending_prod++);
3435 +- txp = &pending_tx_info[pending_idx].req;
3436 +- make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);
3437 +- netbk->pending_ring[index] = pending_idx;
3438 +- xenvif_put(vif);
3439 +- }
3440 ++ if (unlikely(err))
3441 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);
3442 +
3443 + /* Skip first skb fragment if it is on same page as header fragment. */
3444 + start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx);
3445 +
3446 + for (i = start; i < nr_frags; i++) {
3447 + int j, newerr;
3448 +- pending_ring_idx_t index;
3449 +
3450 + pending_idx = frag_get_pending_idx(&shinfo->frags[i]);
3451 +
3452 +@@ -1002,16 +1015,12 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
3453 + if (likely(!newerr)) {
3454 + /* Had a previous error? Invalidate this fragment. */
3455 + if (unlikely(err))
3456 +- xen_netbk_idx_release(netbk, pending_idx);
3457 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);
3458 + continue;
3459 + }
3460 +
3461 + /* Error on this fragment: respond to client with an error. */
3462 +- txp = &netbk->pending_tx_info[pending_idx].req;
3463 +- make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR);
3464 +- index = pending_index(netbk->pending_prod++);
3465 +- netbk->pending_ring[index] = pending_idx;
3466 +- xenvif_put(vif);
3467 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR);
3468 +
3469 + /* Not the first error? Preceding frags already invalidated. */
3470 + if (err)
3471 +@@ -1019,10 +1028,10 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
3472 +
3473 + /* First error: invalidate header and preceding fragments. */
3474 + pending_idx = *((u16 *)skb->data);
3475 +- xen_netbk_idx_release(netbk, pending_idx);
3476 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);
3477 + for (j = start; j < i; j++) {
3478 + pending_idx = frag_get_pending_idx(&shinfo->frags[j]);
3479 +- xen_netbk_idx_release(netbk, pending_idx);
3480 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);
3481 + }
3482 +
3483 + /* Remember the error: invalidate all subsequent fragments. */
3484 +@@ -1056,7 +1065,7 @@ static void xen_netbk_fill_frags(struct xen_netbk *netbk, struct sk_buff *skb)
3485 +
3486 + /* Take an extra reference to offset xen_netbk_idx_release */
3487 + get_page(netbk->mmap_pages[pending_idx]);
3488 +- xen_netbk_idx_release(netbk, pending_idx);
3489 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);
3490 + }
3491 + }
3492 +
3493 +@@ -1069,7 +1078,8 @@ static int xen_netbk_get_extras(struct xenvif *vif,
3494 +
3495 + do {
3496 + if (unlikely(work_to_do-- <= 0)) {
3497 +- netdev_dbg(vif->dev, "Missing extra info\n");
3498 ++ netdev_err(vif->dev, "Missing extra info\n");
3499 ++ netbk_fatal_tx_err(vif);
3500 + return -EBADR;
3501 + }
3502 +
3503 +@@ -1078,8 +1088,9 @@ static int xen_netbk_get_extras(struct xenvif *vif,
3504 + if (unlikely(!extra.type ||
3505 + extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) {
3506 + vif->tx.req_cons = ++cons;
3507 +- netdev_dbg(vif->dev,
3508 ++ netdev_err(vif->dev,
3509 + "Invalid extra type: %d\n", extra.type);
3510 ++ netbk_fatal_tx_err(vif);
3511 + return -EINVAL;
3512 + }
3513 +
3514 +@@ -1095,13 +1106,15 @@ static int netbk_set_skb_gso(struct xenvif *vif,
3515 + struct xen_netif_extra_info *gso)
3516 + {
3517 + if (!gso->u.gso.size) {
3518 +- netdev_dbg(vif->dev, "GSO size must not be zero.\n");
3519 ++ netdev_err(vif->dev, "GSO size must not be zero.\n");
3520 ++ netbk_fatal_tx_err(vif);
3521 + return -EINVAL;
3522 + }
3523 +
3524 + /* Currently only TCPv4 S.O. is supported. */
3525 + if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) {
3526 +- netdev_dbg(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);
3527 ++ netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);
3528 ++ netbk_fatal_tx_err(vif);
3529 + return -EINVAL;
3530 + }
3531 +
3532 +@@ -1238,9 +1251,25 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
3533 +
3534 + /* Get a netif from the list with work to do. */
3535 + vif = poll_net_schedule_list(netbk);
3536 ++ /* This can sometimes happen because the test of
3537 ++ * list_empty(net_schedule_list) at the top of the
3538 ++ * loop is unlocked. Just go back and have another
3539 ++ * look.
3540 ++ */
3541 + if (!vif)
3542 + continue;
3543 +
3544 ++ if (vif->tx.sring->req_prod - vif->tx.req_cons >
3545 ++ XEN_NETIF_TX_RING_SIZE) {
3546 ++ netdev_err(vif->dev,
3547 ++ "Impossible number of requests. "
3548 ++ "req_prod %d, req_cons %d, size %ld\n",
3549 ++ vif->tx.sring->req_prod, vif->tx.req_cons,
3550 ++ XEN_NETIF_TX_RING_SIZE);
3551 ++ netbk_fatal_tx_err(vif);
3552 ++ continue;
3553 ++ }
3554 ++
3555 + RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do);
3556 + if (!work_to_do) {
3557 + xenvif_put(vif);
3558 +@@ -1268,17 +1297,14 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
3559 + work_to_do = xen_netbk_get_extras(vif, extras,
3560 + work_to_do);
3561 + idx = vif->tx.req_cons;
3562 +- if (unlikely(work_to_do < 0)) {
3563 +- netbk_tx_err(vif, &txreq, idx);
3564 ++ if (unlikely(work_to_do < 0))
3565 + continue;
3566 +- }
3567 + }
3568 +
3569 + ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);
3570 +- if (unlikely(ret < 0)) {
3571 +- netbk_tx_err(vif, &txreq, idx - ret);
3572 ++ if (unlikely(ret < 0))
3573 + continue;
3574 +- }
3575 ++
3576 + idx += ret;
3577 +
3578 + if (unlikely(txreq.size < ETH_HLEN)) {
3579 +@@ -1290,11 +1316,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
3580 +
3581 + /* No crossing a page as the payload mustn't fragment. */
3582 + if (unlikely((txreq.offset + txreq.size) > PAGE_SIZE)) {
3583 +- netdev_dbg(vif->dev,
3584 ++ netdev_err(vif->dev,
3585 + "txreq.offset: %x, size: %u, end: %lu\n",
3586 + txreq.offset, txreq.size,
3587 + (txreq.offset&~PAGE_MASK) + txreq.size);
3588 +- netbk_tx_err(vif, &txreq, idx);
3589 ++ netbk_fatal_tx_err(vif);
3590 + continue;
3591 + }
3592 +
3593 +@@ -1322,8 +1348,8 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
3594 + gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1];
3595 +
3596 + if (netbk_set_skb_gso(vif, skb, gso)) {
3597 ++ /* Failure in netbk_set_skb_gso is fatal. */
3598 + kfree_skb(skb);
3599 +- netbk_tx_err(vif, &txreq, idx);
3600 + continue;
3601 + }
3602 + }
3603 +@@ -1424,7 +1450,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
3604 + txp->size -= data_len;
3605 + } else {
3606 + /* Schedule a response immediately. */
3607 +- xen_netbk_idx_release(netbk, pending_idx);
3608 ++ xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY);
3609 + }
3610 +
3611 + if (txp->flags & XEN_NETTXF_csum_blank)
3612 +@@ -1479,7 +1505,8 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk)
3613 +
3614 + }
3615 +
3616 +-static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx)
3617 ++static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx,
3618 ++ u8 status)
3619 + {
3620 + struct xenvif *vif;
3621 + struct pending_tx_info *pending_tx_info;
3622 +@@ -1493,7 +1520,7 @@ static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx)
3623 +
3624 + vif = pending_tx_info->vif;
3625 +
3626 +- make_tx_response(vif, &pending_tx_info->req, XEN_NETIF_RSP_OKAY);
3627 ++ make_tx_response(vif, &pending_tx_info->req, status);
3628 +
3629 + index = pending_index(netbk->pending_prod++);
3630 + netbk->pending_ring[index] = pending_idx;
3631 +diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
3632 +index da8beb8..627b66a 100644
3633 +--- a/drivers/rtc/rtc-isl1208.c
3634 ++++ b/drivers/rtc/rtc-isl1208.c
3635 +@@ -494,6 +494,7 @@ isl1208_rtc_interrupt(int irq, void *data)
3636 + {
3637 + unsigned long timeout = jiffies + msecs_to_jiffies(1000);
3638 + struct i2c_client *client = data;
3639 ++ struct rtc_device *rtc = i2c_get_clientdata(client);
3640 + int handled = 0, sr, err;
3641 +
3642 + /*
3643 +@@ -516,6 +517,8 @@ isl1208_rtc_interrupt(int irq, void *data)
3644 + if (sr & ISL1208_REG_SR_ALM) {
3645 + dev_dbg(&client->dev, "alarm!\n");
3646 +
3647 ++ rtc_update_irq(rtc, 1, RTC_IRQF | RTC_AF);
3648 ++
3649 + /* Clear the alarm */
3650 + sr &= ~ISL1208_REG_SR_ALM;
3651 + sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr);
3652 +diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
3653 +index 1e80a48..73816d8 100644
3654 +--- a/drivers/rtc/rtc-pl031.c
3655 ++++ b/drivers/rtc/rtc-pl031.c
3656 +@@ -44,6 +44,7 @@
3657 + #define RTC_YMR 0x34 /* Year match register */
3658 + #define RTC_YLR 0x38 /* Year data load register */
3659 +
3660 ++#define RTC_CR_EN (1 << 0) /* counter enable bit */
3661 + #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */
3662 +
3663 + #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */
3664 +@@ -312,7 +313,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
3665 + int ret;
3666 + struct pl031_local *ldata;
3667 + struct rtc_class_ops *ops = id->data;
3668 +- unsigned long time;
3669 ++ unsigned long time, data;
3670 +
3671 + ret = amba_request_regions(adev, NULL);
3672 + if (ret)
3673 +@@ -339,10 +340,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
3674 + dev_dbg(&adev->dev, "designer ID = 0x%02x\n", ldata->hw_designer);
3675 + dev_dbg(&adev->dev, "revision = 0x%01x\n", ldata->hw_revision);
3676 +
3677 ++ data = readl(ldata->base + RTC_CR);
3678 + /* Enable the clockwatch on ST Variants */
3679 + if (ldata->hw_designer == AMBA_VENDOR_ST)
3680 +- writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
3681 +- ldata->base + RTC_CR);
3682 ++ data |= RTC_CR_CWEN;
3683 ++ writel(data | RTC_CR_EN, ldata->base + RTC_CR);
3684 +
3685 + /*
3686 + * On ST PL031 variants, the RTC reset value does not provide correct
3687 +diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
3688 +index 34655d0..08e470f 100644
3689 +--- a/drivers/usb/host/ehci-sched.c
3690 ++++ b/drivers/usb/host/ehci-sched.c
3691 +@@ -236,7 +236,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask)
3692 + }
3693 +
3694 + static const unsigned char
3695 +-max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 };
3696 ++max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 };
3697 +
3698 + /* carryover low/fullspeed bandwidth that crosses uframe boundries */
3699 + static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8])
3700 +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
3701 +index 5cc401b..c7cfbce 100644
3702 +--- a/drivers/usb/host/pci-quirks.c
3703 ++++ b/drivers/usb/host/pci-quirks.c
3704 +@@ -780,6 +780,7 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev)
3705 + "defaulting to EHCI.\n");
3706 + dev_warn(&xhci_pdev->dev,
3707 + "USB 3.0 devices will work at USB 2.0 speeds.\n");
3708 ++ usb_disable_xhci_ports(xhci_pdev);
3709 + return;
3710 + }
3711 +
3712 +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
3713 +index 2ed591d..5c1f9e7 100644
3714 +--- a/drivers/usb/host/xhci-ring.c
3715 ++++ b/drivers/usb/host/xhci-ring.c
3716 +@@ -2504,6 +2504,8 @@ cleanup:
3717 + (trb_comp_code != COMP_STALL &&
3718 + trb_comp_code != COMP_BABBLE))
3719 + xhci_urb_free_priv(xhci, urb_priv);
3720 ++ else
3721 ++ kfree(urb_priv);
3722 +
3723 + usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
3724 + if ((urb->actual_length != urb->transfer_buffer_length &&
3725 +@@ -3032,7 +3034,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,
3726 + * running_total.
3727 + */
3728 + packets_transferred = (running_total + trb_buff_len) /
3729 +- usb_endpoint_maxp(&urb->ep->desc);
3730 ++ GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc));
3731 +
3732 + if ((total_packet_count - packets_transferred) > 31)
3733 + return 31 << 17;
3734 +@@ -3594,7 +3596,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3735 + td_len = urb->iso_frame_desc[i].length;
3736 + td_remain_len = td_len;
3737 + total_packet_count = DIV_ROUND_UP(td_len,
3738 +- usb_endpoint_maxp(&urb->ep->desc));
3739 ++ GET_MAX_PACKET(
3740 ++ usb_endpoint_maxp(&urb->ep->desc)));
3741 + /* A zero-length transfer still involves at least one packet. */
3742 + if (total_packet_count == 0)
3743 + total_packet_count++;
3744 +@@ -3617,9 +3620,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3745 + td = urb_priv->td[i];
3746 + for (j = 0; j < trbs_per_td; j++) {
3747 + u32 remainder = 0;
3748 +- field = TRB_TBC(burst_count) | TRB_TLBPC(residue);
3749 ++ field = 0;
3750 +
3751 + if (first_trb) {
3752 ++ field = TRB_TBC(burst_count) |
3753 ++ TRB_TLBPC(residue);
3754 + /* Queue the isoc TRB */
3755 + field |= TRB_TYPE(TRB_ISOC);
3756 + /* Assume URB_ISO_ASAP is set */
3757 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
3758 +index 2cc7c18..d644a66 100644
3759 +--- a/drivers/usb/serial/ftdi_sio.c
3760 ++++ b/drivers/usb/serial/ftdi_sio.c
3761 +@@ -590,6 +590,7 @@ static struct usb_device_id id_table_combined [] = {
3762 + /*
3763 + * ELV devices:
3764 + */
3765 ++ { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) },
3766 + { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) },
3767 + { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) },
3768 + { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
3769 +@@ -676,6 +677,7 @@ static struct usb_device_id id_table_combined [] = {
3770 + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) },
3771 + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) },
3772 + { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) },
3773 ++ { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
3774 + { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
3775 + { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) },
3776 + { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) },
3777 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
3778 +index dd6edf8..97e0a6b 100644
3779 +--- a/drivers/usb/serial/ftdi_sio_ids.h
3780 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
3781 +@@ -147,6 +147,11 @@
3782 + #define XSENS_CONVERTER_6_PID 0xD38E
3783 + #define XSENS_CONVERTER_7_PID 0xD38F
3784 +
3785 ++/**
3786 ++ * Zolix (www.zolix.com.cb) product ids
3787 ++ */
3788 ++#define FTDI_OMNI1509 0xD491 /* Omni1509 embedded USB-serial */
3789 ++
3790 + /*
3791 + * NDI (www.ndigital.com) product ids
3792 + */
3793 +@@ -204,7 +209,7 @@
3794 +
3795 + /*
3796 + * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
3797 +- * All of these devices use FTDI's vendor ID (0x0403).
3798 ++ * Almost all of these devices use FTDI's vendor ID (0x0403).
3799 + * Further IDs taken from ELV Windows .inf file.
3800 + *
3801 + * The previously included PID for the UO 100 module was incorrect.
3802 +@@ -212,6 +217,8 @@
3803 + *
3804 + * Armin Laeuger originally sent the PID for the UM 100 module.
3805 + */
3806 ++#define FTDI_ELV_VID 0x1B1F /* ELV AG */
3807 ++#define FTDI_ELV_WS300_PID 0xC006 /* eQ3 WS 300 PC II */
3808 + #define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */
3809 + #define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */
3810 + #define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */
3811 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
3812 +index 9db3e23..52cd814 100644
3813 +--- a/drivers/usb/serial/option.c
3814 ++++ b/drivers/usb/serial/option.c
3815 +@@ -242,6 +242,7 @@ static void option_instat_callback(struct urb *urb);
3816 + #define TELIT_PRODUCT_CC864_DUAL 0x1005
3817 + #define TELIT_PRODUCT_CC864_SINGLE 0x1006
3818 + #define TELIT_PRODUCT_DE910_DUAL 0x1010
3819 ++#define TELIT_PRODUCT_LE920 0x1200
3820 +
3821 + /* ZTE PRODUCTS */
3822 + #define ZTE_VENDOR_ID 0x19d2
3823 +@@ -453,6 +454,10 @@ static void option_instat_callback(struct urb *urb);
3824 + #define TPLINK_VENDOR_ID 0x2357
3825 + #define TPLINK_PRODUCT_MA180 0x0201
3826 +
3827 ++/* Changhong products */
3828 ++#define CHANGHONG_VENDOR_ID 0x2077
3829 ++#define CHANGHONG_PRODUCT_CH690 0x7001
3830 ++
3831 + /* some devices interfaces need special handling due to a number of reasons */
3832 + enum option_blacklist_reason {
3833 + OPTION_BLACKLIST_NONE = 0,
3834 +@@ -534,6 +539,11 @@ static const struct option_blacklist_info zte_1255_blacklist = {
3835 + .reserved = BIT(3) | BIT(4),
3836 + };
3837 +
3838 ++static const struct option_blacklist_info telit_le920_blacklist = {
3839 ++ .sendsetup = BIT(0),
3840 ++ .reserved = BIT(1) | BIT(5),
3841 ++};
3842 ++
3843 + static const struct usb_device_id option_ids[] = {
3844 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
3845 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
3846 +@@ -784,6 +794,8 @@ static const struct usb_device_id option_ids[] = {
3847 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) },
3848 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
3849 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
3850 ++ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
3851 ++ .driver_info = (kernel_ulong_t)&telit_le920_blacklist },
3852 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
3853 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
3854 + .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
3855 +@@ -1318,6 +1330,7 @@ static const struct usb_device_id option_ids[] = {
3856 + { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
3857 + { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
3858 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
3859 ++ { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) },
3860 + { } /* Terminating entry */
3861 + };
3862 + MODULE_DEVICE_TABLE(usb, option_ids);
3863 +diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
3864 +index 6634477..14c4a82 100644
3865 +--- a/drivers/usb/serial/qcserial.c
3866 ++++ b/drivers/usb/serial/qcserial.c
3867 +@@ -55,6 +55,7 @@ static const struct usb_device_id id_table[] = {
3868 + {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */
3869 + {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */
3870 + {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */
3871 ++ {DEVICE_G1K(0x1bc7, 0x900e)}, /* Telit Gobi QDL device */
3872 +
3873 + /* Gobi 2000 devices */
3874 + {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */
3875 +diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c
3876 +index 105d900..16b0bf0 100644
3877 +--- a/drivers/usb/storage/initializers.c
3878 ++++ b/drivers/usb/storage/initializers.c
3879 +@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_data *us)
3880 + return 0;
3881 + }
3882 +
3883 +-/* This places the HUAWEI E220 devices in multi-port mode */
3884 +-int usb_stor_huawei_e220_init(struct us_data *us)
3885 ++/* This places the HUAWEI usb dongles in multi-port mode */
3886 ++static int usb_stor_huawei_feature_init(struct us_data *us)
3887 + {
3888 + int result;
3889 +
3890 +@@ -104,3 +104,75 @@ int usb_stor_huawei_e220_init(struct us_data *us)
3891 + US_DEBUGP("Huawei mode set result is %d\n", result);
3892 + return 0;
3893 + }
3894 ++
3895 ++/*
3896 ++ * It will send a scsi switch command called rewind' to huawei dongle.
3897 ++ * When the dongle receives this command at the first time,
3898 ++ * it will reboot immediately. After rebooted, it will ignore this command.
3899 ++ * So it is unnecessary to read its response.
3900 ++ */
3901 ++static int usb_stor_huawei_scsi_init(struct us_data *us)
3902 ++{
3903 ++ int result = 0;
3904 ++ int act_len = 0;
3905 ++ struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
3906 ++ char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
3907 ++ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
3908 ++
3909 ++ bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);
3910 ++ bcbw->Tag = 0;
3911 ++ bcbw->DataTransferLength = 0;
3912 ++ bcbw->Flags = bcbw->Lun = 0;
3913 ++ bcbw->Length = sizeof(rewind_cmd);
3914 ++ memset(bcbw->CDB, 0, sizeof(bcbw->CDB));
3915 ++ memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));
3916 ++
3917 ++ result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw,
3918 ++ US_BULK_CB_WRAP_LEN, &act_len);
3919 ++ US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result);
3920 ++ return result;
3921 ++}
3922 ++
3923 ++/*
3924 ++ * It tries to find the supported Huawei USB dongles.
3925 ++ * In Huawei, they assign the following product IDs
3926 ++ * for all of their mobile broadband dongles,
3927 ++ * including the new dongles in the future.
3928 ++ * So if the product ID is not included in this list,
3929 ++ * it means it is not Huawei's mobile broadband dongles.
3930 ++ */
3931 ++static int usb_stor_huawei_dongles_pid(struct us_data *us)
3932 ++{
3933 ++ struct usb_interface_descriptor *idesc;
3934 ++ int idProduct;
3935 ++
3936 ++ idesc = &us->pusb_intf->cur_altsetting->desc;
3937 ++ idProduct = us->pusb_dev->descriptor.idProduct;
3938 ++ /* The first port is CDROM,
3939 ++ * means the dongle in the single port mode,
3940 ++ * and a switch command is required to be sent. */
3941 ++ if (idesc && idesc->bInterfaceNumber == 0) {
3942 ++ if ((idProduct == 0x1001)
3943 ++ || (idProduct == 0x1003)
3944 ++ || (idProduct == 0x1004)
3945 ++ || (idProduct >= 0x1401 && idProduct <= 0x1500)
3946 ++ || (idProduct >= 0x1505 && idProduct <= 0x1600)
3947 ++ || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {
3948 ++ return 1;
3949 ++ }
3950 ++ }
3951 ++ return 0;
3952 ++}
3953 ++
3954 ++int usb_stor_huawei_init(struct us_data *us)
3955 ++{
3956 ++ int result = 0;
3957 ++
3958 ++ if (usb_stor_huawei_dongles_pid(us)) {
3959 ++ if (us->pusb_dev->descriptor.idProduct >= 0x1446)
3960 ++ result = usb_stor_huawei_scsi_init(us);
3961 ++ else
3962 ++ result = usb_stor_huawei_feature_init(us);
3963 ++ }
3964 ++ return result;
3965 ++}
3966 +diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h
3967 +index 529327f..5376d4f 100644
3968 +--- a/drivers/usb/storage/initializers.h
3969 ++++ b/drivers/usb/storage/initializers.h
3970 +@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data *us);
3971 + * flash reader */
3972 + int usb_stor_ucr61s2b_init(struct us_data *us);
3973 +
3974 +-/* This places the HUAWEI E220 devices in multi-port mode */
3975 +-int usb_stor_huawei_e220_init(struct us_data *us);
3976 ++/* This places the HUAWEI usb dongles in multi-port mode */
3977 ++int usb_stor_huawei_init(struct us_data *us);
3978 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
3979 +index fa8a1b2..12640ef 100644
3980 +--- a/drivers/usb/storage/unusual_devs.h
3981 ++++ b/drivers/usb/storage/unusual_devs.h
3982 +@@ -1515,335 +1515,10 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x0100,
3983 + /* Reported by fangxiaozhi <huananhu@××××××.com>
3984 + * This brings the HUAWEI data card devices into multi-port mode
3985 + */
3986 +-UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
3987 ++UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50,
3988 + "HUAWEI MOBILE",
3989 + "Mass Storage",
3990 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
3991 +- 0),
3992 +-UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
3993 +- "HUAWEI MOBILE",
3994 +- "Mass Storage",
3995 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
3996 +- 0),
3997 +-UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000,
3998 +- "HUAWEI MOBILE",
3999 +- "Mass Storage",
4000 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4001 +- 0),
4002 +-UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000,
4003 +- "HUAWEI MOBILE",
4004 +- "Mass Storage",
4005 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4006 +- 0),
4007 +-UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000,
4008 +- "HUAWEI MOBILE",
4009 +- "Mass Storage",
4010 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4011 +- 0),
4012 +-UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000,
4013 +- "HUAWEI MOBILE",
4014 +- "Mass Storage",
4015 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4016 +- 0),
4017 +-UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000,
4018 +- "HUAWEI MOBILE",
4019 +- "Mass Storage",
4020 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4021 +- 0),
4022 +-UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000,
4023 +- "HUAWEI MOBILE",
4024 +- "Mass Storage",
4025 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4026 +- 0),
4027 +-UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000,
4028 +- "HUAWEI MOBILE",
4029 +- "Mass Storage",
4030 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4031 +- 0),
4032 +-UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000,
4033 +- "HUAWEI MOBILE",
4034 +- "Mass Storage",
4035 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4036 +- 0),
4037 +-UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000,
4038 +- "HUAWEI MOBILE",
4039 +- "Mass Storage",
4040 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4041 +- 0),
4042 +-UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000,
4043 +- "HUAWEI MOBILE",
4044 +- "Mass Storage",
4045 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4046 +- 0),
4047 +-UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000,
4048 +- "HUAWEI MOBILE",
4049 +- "Mass Storage",
4050 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4051 +- 0),
4052 +-UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000,
4053 +- "HUAWEI MOBILE",
4054 +- "Mass Storage",
4055 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4056 +- 0),
4057 +-UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000,
4058 +- "HUAWEI MOBILE",
4059 +- "Mass Storage",
4060 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4061 +- 0),
4062 +-UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000,
4063 +- "HUAWEI MOBILE",
4064 +- "Mass Storage",
4065 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4066 +- 0),
4067 +-UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000,
4068 +- "HUAWEI MOBILE",
4069 +- "Mass Storage",
4070 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4071 +- 0),
4072 +-UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000,
4073 +- "HUAWEI MOBILE",
4074 +- "Mass Storage",
4075 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4076 +- 0),
4077 +-UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000,
4078 +- "HUAWEI MOBILE",
4079 +- "Mass Storage",
4080 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4081 +- 0),
4082 +-UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000,
4083 +- "HUAWEI MOBILE",
4084 +- "Mass Storage",
4085 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4086 +- 0),
4087 +-UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000,
4088 +- "HUAWEI MOBILE",
4089 +- "Mass Storage",
4090 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4091 +- 0),
4092 +-UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000,
4093 +- "HUAWEI MOBILE",
4094 +- "Mass Storage",
4095 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4096 +- 0),
4097 +-UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000,
4098 +- "HUAWEI MOBILE",
4099 +- "Mass Storage",
4100 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4101 +- 0),
4102 +-UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000,
4103 +- "HUAWEI MOBILE",
4104 +- "Mass Storage",
4105 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4106 +- 0),
4107 +-UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000,
4108 +- "HUAWEI MOBILE",
4109 +- "Mass Storage",
4110 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4111 +- 0),
4112 +-UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000,
4113 +- "HUAWEI MOBILE",
4114 +- "Mass Storage",
4115 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4116 +- 0),
4117 +-UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000,
4118 +- "HUAWEI MOBILE",
4119 +- "Mass Storage",
4120 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4121 +- 0),
4122 +-UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000,
4123 +- "HUAWEI MOBILE",
4124 +- "Mass Storage",
4125 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4126 +- 0),
4127 +-UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000,
4128 +- "HUAWEI MOBILE",
4129 +- "Mass Storage",
4130 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4131 +- 0),
4132 +-UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000,
4133 +- "HUAWEI MOBILE",
4134 +- "Mass Storage",
4135 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4136 +- 0),
4137 +-UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000,
4138 +- "HUAWEI MOBILE",
4139 +- "Mass Storage",
4140 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4141 +- 0),
4142 +-UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000,
4143 +- "HUAWEI MOBILE",
4144 +- "Mass Storage",
4145 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4146 +- 0),
4147 +-UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000,
4148 +- "HUAWEI MOBILE",
4149 +- "Mass Storage",
4150 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4151 +- 0),
4152 +-UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000,
4153 +- "HUAWEI MOBILE",
4154 +- "Mass Storage",
4155 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4156 +- 0),
4157 +-UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000,
4158 +- "HUAWEI MOBILE",
4159 +- "Mass Storage",
4160 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4161 +- 0),
4162 +-UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000,
4163 +- "HUAWEI MOBILE",
4164 +- "Mass Storage",
4165 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4166 +- 0),
4167 +-UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000,
4168 +- "HUAWEI MOBILE",
4169 +- "Mass Storage",
4170 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4171 +- 0),
4172 +-UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000,
4173 +- "HUAWEI MOBILE",
4174 +- "Mass Storage",
4175 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4176 +- 0),
4177 +-UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000,
4178 +- "HUAWEI MOBILE",
4179 +- "Mass Storage",
4180 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4181 +- 0),
4182 +-UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000,
4183 +- "HUAWEI MOBILE",
4184 +- "Mass Storage",
4185 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4186 +- 0),
4187 +-UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000,
4188 +- "HUAWEI MOBILE",
4189 +- "Mass Storage",
4190 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4191 +- 0),
4192 +-UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000,
4193 +- "HUAWEI MOBILE",
4194 +- "Mass Storage",
4195 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4196 +- 0),
4197 +-UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000,
4198 +- "HUAWEI MOBILE",
4199 +- "Mass Storage",
4200 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4201 +- 0),
4202 +-UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000,
4203 +- "HUAWEI MOBILE",
4204 +- "Mass Storage",
4205 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4206 +- 0),
4207 +-UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000,
4208 +- "HUAWEI MOBILE",
4209 +- "Mass Storage",
4210 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4211 +- 0),
4212 +-UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000,
4213 +- "HUAWEI MOBILE",
4214 +- "Mass Storage",
4215 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4216 +- 0),
4217 +-UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000,
4218 +- "HUAWEI MOBILE",
4219 +- "Mass Storage",
4220 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4221 +- 0),
4222 +-UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000,
4223 +- "HUAWEI MOBILE",
4224 +- "Mass Storage",
4225 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4226 +- 0),
4227 +-UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000,
4228 +- "HUAWEI MOBILE",
4229 +- "Mass Storage",
4230 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4231 +- 0),
4232 +-UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000,
4233 +- "HUAWEI MOBILE",
4234 +- "Mass Storage",
4235 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4236 +- 0),
4237 +-UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000,
4238 +- "HUAWEI MOBILE",
4239 +- "Mass Storage",
4240 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4241 +- 0),
4242 +-UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000,
4243 +- "HUAWEI MOBILE",
4244 +- "Mass Storage",
4245 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4246 +- 0),
4247 +-UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000,
4248 +- "HUAWEI MOBILE",
4249 +- "Mass Storage",
4250 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4251 +- 0),
4252 +-UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000,
4253 +- "HUAWEI MOBILE",
4254 +- "Mass Storage",
4255 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4256 +- 0),
4257 +-UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000,
4258 +- "HUAWEI MOBILE",
4259 +- "Mass Storage",
4260 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4261 +- 0),
4262 +-UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000,
4263 +- "HUAWEI MOBILE",
4264 +- "Mass Storage",
4265 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4266 +- 0),
4267 +-UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000,
4268 +- "HUAWEI MOBILE",
4269 +- "Mass Storage",
4270 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4271 +- 0),
4272 +-UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000,
4273 +- "HUAWEI MOBILE",
4274 +- "Mass Storage",
4275 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4276 +- 0),
4277 +-UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000,
4278 +- "HUAWEI MOBILE",
4279 +- "Mass Storage",
4280 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4281 +- 0),
4282 +-UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000,
4283 +- "HUAWEI MOBILE",
4284 +- "Mass Storage",
4285 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4286 +- 0),
4287 +-UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000,
4288 +- "HUAWEI MOBILE",
4289 +- "Mass Storage",
4290 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4291 +- 0),
4292 +-UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000,
4293 +- "HUAWEI MOBILE",
4294 +- "Mass Storage",
4295 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4296 +- 0),
4297 +-UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000,
4298 +- "HUAWEI MOBILE",
4299 +- "Mass Storage",
4300 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4301 +- 0),
4302 +-UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000,
4303 +- "HUAWEI MOBILE",
4304 +- "Mass Storage",
4305 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4306 +- 0),
4307 +-UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000,
4308 +- "HUAWEI MOBILE",
4309 +- "Mass Storage",
4310 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4311 +- 0),
4312 +-UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000,
4313 +- "HUAWEI MOBILE",
4314 +- "Mass Storage",
4315 +- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
4316 ++ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init,
4317 + 0),
4318 +
4319 + /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
4320 +diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
4321 +index db51ba1..d582af4 100644
4322 +--- a/drivers/usb/storage/usb.c
4323 ++++ b/drivers/usb/storage/usb.c
4324 +@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks");
4325 + .useTransport = use_transport, \
4326 + }
4327 +
4328 ++#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
4329 ++ vendor_name, product_name, use_protocol, use_transport, \
4330 ++ init_function, Flags) \
4331 ++{ \
4332 ++ .vendorName = vendor_name, \
4333 ++ .productName = product_name, \
4334 ++ .useProtocol = use_protocol, \
4335 ++ .useTransport = use_transport, \
4336 ++ .initFunction = init_function, \
4337 ++}
4338 ++
4339 + static struct us_unusual_dev us_unusual_dev_list[] = {
4340 + # include "unusual_devs.h"
4341 + { } /* Terminating entry */
4342 +@@ -128,6 +139,7 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
4343 + #undef UNUSUAL_DEV
4344 + #undef COMPLIANT_DEV
4345 + #undef USUAL_DEV
4346 ++#undef UNUSUAL_VENDOR_INTF
4347 +
4348 +
4349 + #ifdef CONFIG_PM /* Minimal support for suspend and resume */
4350 +diff --git a/drivers/usb/storage/usual-tables.c b/drivers/usb/storage/usual-tables.c
4351 +index b969279..a9b5f2e 100644
4352 +--- a/drivers/usb/storage/usual-tables.c
4353 ++++ b/drivers/usb/storage/usual-tables.c
4354 +@@ -46,6 +46,20 @@
4355 + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
4356 + .driver_info = ((useType)<<24) }
4357 +
4358 ++/* Define the device is matched with Vendor ID and interface descriptors */
4359 ++#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
4360 ++ vendorName, productName, useProtocol, useTransport, \
4361 ++ initFunction, flags) \
4362 ++{ \
4363 ++ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
4364 ++ | USB_DEVICE_ID_MATCH_VENDOR, \
4365 ++ .idVendor = (id_vendor), \
4366 ++ .bInterfaceClass = (cl), \
4367 ++ .bInterfaceSubClass = (sc), \
4368 ++ .bInterfaceProtocol = (pr), \
4369 ++ .driver_info = (flags) \
4370 ++}
4371 ++
4372 + struct usb_device_id usb_storage_usb_ids[] = {
4373 + # include "unusual_devs.h"
4374 + { } /* Terminating entry */
4375 +@@ -57,6 +71,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids);
4376 + #undef UNUSUAL_DEV
4377 + #undef COMPLIANT_DEV
4378 + #undef USUAL_DEV
4379 ++#undef UNUSUAL_VENDOR_INTF
4380 +
4381 +
4382 + /*
4383 +diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
4384 +index c598cfb..2b5e695 100644
4385 +--- a/fs/nilfs2/ioctl.c
4386 ++++ b/fs/nilfs2/ioctl.c
4387 +@@ -664,8 +664,11 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
4388 + if (ret < 0)
4389 + printk(KERN_ERR "NILFS: GC failed during preparation: "
4390 + "cannot read source blocks: err=%d\n", ret);
4391 +- else
4392 ++ else {
4393 ++ if (nilfs_sb_need_update(nilfs))
4394 ++ set_nilfs_discontinued(nilfs);
4395 + ret = nilfs_clean_segments(inode->i_sb, argv, kbufs);
4396 ++ }
4397 +
4398 + nilfs_remove_all_gcinodes(nilfs);
4399 + clear_nilfs_gc_running(nilfs);
4400 +diff --git a/fs/splice.c b/fs/splice.c
4401 +index 014fcb4..58ab918 100644
4402 +--- a/fs/splice.c
4403 ++++ b/fs/splice.c
4404 +@@ -697,8 +697,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
4405 + return -EINVAL;
4406 +
4407 + more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
4408 +- if (sd->len < sd->total_len)
4409 ++
4410 ++ if (sd->len < sd->total_len && pipe->nrbufs > 1)
4411 + more |= MSG_SENDPAGE_NOTLAST;
4412 ++
4413 + return file->f_op->sendpage(file, buf->page, buf->offset,
4414 + sd->len, &pos, more);
4415 + }
4416 +diff --git a/include/linux/sched.h b/include/linux/sched.h
4417 +index 1e86bb4..8204898 100644
4418 +--- a/include/linux/sched.h
4419 ++++ b/include/linux/sched.h
4420 +@@ -2597,7 +2597,16 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)
4421 + extern void recalc_sigpending_and_wake(struct task_struct *t);
4422 + extern void recalc_sigpending(void);
4423 +
4424 +-extern void signal_wake_up(struct task_struct *t, int resume_stopped);
4425 ++extern void signal_wake_up_state(struct task_struct *t, unsigned int state);
4426 ++
4427 ++static inline void signal_wake_up(struct task_struct *t, bool resume)
4428 ++{
4429 ++ signal_wake_up_state(t, resume ? TASK_WAKEKILL : 0);
4430 ++}
4431 ++static inline void ptrace_signal_wake_up(struct task_struct *t, bool resume)
4432 ++{
4433 ++ signal_wake_up_state(t, resume ? __TASK_TRACED : 0);
4434 ++}
4435 +
4436 + /*
4437 + * Wrappers for p->thread_info->cpu access. No-op on UP.
4438 +diff --git a/kernel/ptrace.c b/kernel/ptrace.c
4439 +index 78ab24a..67fedad 100644
4440 +--- a/kernel/ptrace.c
4441 ++++ b/kernel/ptrace.c
4442 +@@ -117,11 +117,45 @@ void __ptrace_unlink(struct task_struct *child)
4443 + * TASK_KILLABLE sleeps.
4444 + */
4445 + if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child))
4446 +- signal_wake_up(child, task_is_traced(child));
4447 ++ ptrace_signal_wake_up(child, true);
4448 +
4449 + spin_unlock(&child->sighand->siglock);
4450 + }
4451 +
4452 ++/* Ensure that nothing can wake it up, even SIGKILL */
4453 ++static bool ptrace_freeze_traced(struct task_struct *task)
4454 ++{
4455 ++ bool ret = false;
4456 ++
4457 ++ /* Lockless, nobody but us can set this flag */
4458 ++ if (task->jobctl & JOBCTL_LISTENING)
4459 ++ return ret;
4460 ++
4461 ++ spin_lock_irq(&task->sighand->siglock);
4462 ++ if (task_is_traced(task) && !__fatal_signal_pending(task)) {
4463 ++ task->state = __TASK_TRACED;
4464 ++ ret = true;
4465 ++ }
4466 ++ spin_unlock_irq(&task->sighand->siglock);
4467 ++
4468 ++ return ret;
4469 ++}
4470 ++
4471 ++static void ptrace_unfreeze_traced(struct task_struct *task)
4472 ++{
4473 ++ if (task->state != __TASK_TRACED)
4474 ++ return;
4475 ++
4476 ++ WARN_ON(!task->ptrace || task->parent != current);
4477 ++
4478 ++ spin_lock_irq(&task->sighand->siglock);
4479 ++ if (__fatal_signal_pending(task))
4480 ++ wake_up_state(task, __TASK_TRACED);
4481 ++ else
4482 ++ task->state = TASK_TRACED;
4483 ++ spin_unlock_irq(&task->sighand->siglock);
4484 ++}
4485 ++
4486 + /**
4487 + * ptrace_check_attach - check whether ptracee is ready for ptrace operation
4488 + * @child: ptracee to check for
4489 +@@ -151,24 +185,29 @@ int ptrace_check_attach(struct task_struct *child, bool ignore_state)
4490 + * be changed by us so it's not changing right after this.
4491 + */
4492 + read_lock(&tasklist_lock);
4493 +- if ((child->ptrace & PT_PTRACED) && child->parent == current) {
4494 ++ if (child->ptrace && child->parent == current) {
4495 ++ WARN_ON(child->state == __TASK_TRACED);
4496 + /*
4497 + * child->sighand can't be NULL, release_task()
4498 + * does ptrace_unlink() before __exit_signal().
4499 + */
4500 +- spin_lock_irq(&child->sighand->siglock);
4501 +- WARN_ON_ONCE(task_is_stopped(child));
4502 +- if (ignore_state || (task_is_traced(child) &&
4503 +- !(child->jobctl & JOBCTL_LISTENING)))
4504 ++ if (ignore_state || ptrace_freeze_traced(child))
4505 + ret = 0;
4506 +- spin_unlock_irq(&child->sighand->siglock);
4507 + }
4508 + read_unlock(&tasklist_lock);
4509 +
4510 +- if (!ret && !ignore_state)
4511 +- ret = wait_task_inactive(child, TASK_TRACED) ? 0 : -ESRCH;
4512 ++ if (!ret && !ignore_state) {
4513 ++ if (!wait_task_inactive(child, __TASK_TRACED)) {
4514 ++ /*
4515 ++ * This can only happen if may_ptrace_stop() fails and
4516 ++ * ptrace_stop() changes ->state back to TASK_RUNNING,
4517 ++ * so we should not worry about leaking __TASK_TRACED.
4518 ++ */
4519 ++ WARN_ON(child->state == __TASK_TRACED);
4520 ++ ret = -ESRCH;
4521 ++ }
4522 ++ }
4523 +
4524 +- /* All systems go.. */
4525 + return ret;
4526 + }
4527 +
4528 +@@ -307,7 +346,7 @@ static int ptrace_attach(struct task_struct *task, long request,
4529 + */
4530 + if (task_is_stopped(task) &&
4531 + task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING))
4532 +- signal_wake_up(task, 1);
4533 ++ signal_wake_up_state(task, __TASK_STOPPED);
4534 +
4535 + spin_unlock(&task->sighand->siglock);
4536 +
4537 +@@ -736,7 +775,7 @@ int ptrace_request(struct task_struct *child, long request,
4538 + * tracee into STOP.
4539 + */
4540 + if (likely(task_set_jobctl_pending(child, JOBCTL_TRAP_STOP)))
4541 +- signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
4542 ++ ptrace_signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
4543 +
4544 + unlock_task_sighand(child, &flags);
4545 + ret = 0;
4546 +@@ -762,7 +801,7 @@ int ptrace_request(struct task_struct *child, long request,
4547 + * start of this trap and now. Trigger re-trap.
4548 + */
4549 + if (child->jobctl & JOBCTL_TRAP_NOTIFY)
4550 +- signal_wake_up(child, true);
4551 ++ ptrace_signal_wake_up(child, true);
4552 + ret = 0;
4553 + }
4554 + unlock_task_sighand(child, &flags);
4555 +@@ -899,6 +938,8 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
4556 + goto out_put_task_struct;
4557 +
4558 + ret = arch_ptrace(child, request, addr, data);
4559 ++ if (ret || request != PTRACE_DETACH)
4560 ++ ptrace_unfreeze_traced(child);
4561 +
4562 + out_put_task_struct:
4563 + put_task_struct(child);
4564 +@@ -1038,8 +1079,11 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
4565 +
4566 + ret = ptrace_check_attach(child, request == PTRACE_KILL ||
4567 + request == PTRACE_INTERRUPT);
4568 +- if (!ret)
4569 ++ if (!ret) {
4570 + ret = compat_arch_ptrace(child, request, addr, data);
4571 ++ if (ret || request != PTRACE_DETACH)
4572 ++ ptrace_unfreeze_traced(child);
4573 ++ }
4574 +
4575 + out_put_task_struct:
4576 + put_task_struct(child);
4577 +diff --git a/kernel/resource.c b/kernel/resource.c
4578 +index 7640b3a..08aa28e 100644
4579 +--- a/kernel/resource.c
4580 ++++ b/kernel/resource.c
4581 +@@ -757,6 +757,7 @@ static void __init __reserve_region_with_split(struct resource *root,
4582 + struct resource *parent = root;
4583 + struct resource *conflict;
4584 + struct resource *res = kzalloc(sizeof(*res), GFP_ATOMIC);
4585 ++ struct resource *next_res = NULL;
4586 +
4587 + if (!res)
4588 + return;
4589 +@@ -766,21 +767,46 @@ static void __init __reserve_region_with_split(struct resource *root,
4590 + res->end = end;
4591 + res->flags = IORESOURCE_BUSY;
4592 +
4593 +- conflict = __request_resource(parent, res);
4594 +- if (!conflict)
4595 +- return;
4596 ++ while (1) {
4597 +
4598 +- /* failed, split and try again */
4599 +- kfree(res);
4600 ++ conflict = __request_resource(parent, res);
4601 ++ if (!conflict) {
4602 ++ if (!next_res)
4603 ++ break;
4604 ++ res = next_res;
4605 ++ next_res = NULL;
4606 ++ continue;
4607 ++ }
4608 +
4609 +- /* conflict covered whole area */
4610 +- if (conflict->start <= start && conflict->end >= end)
4611 +- return;
4612 ++ /* conflict covered whole area */
4613 ++ if (conflict->start <= res->start &&
4614 ++ conflict->end >= res->end) {
4615 ++ kfree(res);
4616 ++ WARN_ON(next_res);
4617 ++ break;
4618 ++ }
4619 ++
4620 ++ /* failed, split and try again */
4621 ++ if (conflict->start > res->start) {
4622 ++ end = res->end;
4623 ++ res->end = conflict->start - 1;
4624 ++ if (conflict->end < end) {
4625 ++ next_res = kzalloc(sizeof(*next_res),
4626 ++ GFP_ATOMIC);
4627 ++ if (!next_res) {
4628 ++ kfree(res);
4629 ++ break;
4630 ++ }
4631 ++ next_res->name = name;
4632 ++ next_res->start = conflict->end + 1;
4633 ++ next_res->end = end;
4634 ++ next_res->flags = IORESOURCE_BUSY;
4635 ++ }
4636 ++ } else {
4637 ++ res->start = conflict->end + 1;
4638 ++ }
4639 ++ }
4640 +
4641 +- if (conflict->start > start)
4642 +- __reserve_region_with_split(root, start, conflict->start-1, name);
4643 +- if (conflict->end < end)
4644 +- __reserve_region_with_split(root, conflict->end+1, end, name);
4645 + }
4646 +
4647 + void __init reserve_region_with_split(struct resource *root,
4648 +diff --git a/kernel/sched.c b/kernel/sched.c
4649 +index fcc893f..eeeec4e 100644
4650 +--- a/kernel/sched.c
4651 ++++ b/kernel/sched.c
4652 +@@ -2924,7 +2924,8 @@ out:
4653 + */
4654 + int wake_up_process(struct task_struct *p)
4655 + {
4656 +- return try_to_wake_up(p, TASK_ALL, 0);
4657 ++ WARN_ON(task_is_stopped_or_traced(p));
4658 ++ return try_to_wake_up(p, TASK_NORMAL, 0);
4659 + }
4660 + EXPORT_SYMBOL(wake_up_process);
4661 +
4662 +diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
4663 +index 78fcacf..6ad4fb3 100644
4664 +--- a/kernel/sched_rt.c
4665 ++++ b/kernel/sched_rt.c
4666 +@@ -384,7 +384,7 @@ static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq)
4667 + static int do_balance_runtime(struct rt_rq *rt_rq)
4668 + {
4669 + struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);
4670 +- struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
4671 ++ struct root_domain *rd = rq_of_rt_rq(rt_rq)->rd;
4672 + int i, weight, more = 0;
4673 + u64 rt_period;
4674 +
4675 +diff --git a/kernel/signal.c b/kernel/signal.c
4676 +index 08e0b97..d2f55ea 100644
4677 +--- a/kernel/signal.c
4678 ++++ b/kernel/signal.c
4679 +@@ -676,23 +676,17 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
4680 + * No need to set need_resched since signal event passing
4681 + * goes through ->blocked
4682 + */
4683 +-void signal_wake_up(struct task_struct *t, int resume)
4684 ++void signal_wake_up_state(struct task_struct *t, unsigned int state)
4685 + {
4686 +- unsigned int mask;
4687 +-
4688 + set_tsk_thread_flag(t, TIF_SIGPENDING);
4689 +-
4690 + /*
4691 +- * For SIGKILL, we want to wake it up in the stopped/traced/killable
4692 ++ * TASK_WAKEKILL also means wake it up in the stopped/traced/killable
4693 + * case. We don't check t->state here because there is a race with it
4694 + * executing another processor and just now entering stopped state.
4695 + * By using wake_up_state, we ensure the process will wake up and
4696 + * handle its death signal.
4697 + */
4698 +- mask = TASK_INTERRUPTIBLE;
4699 +- if (resume)
4700 +- mask |= TASK_WAKEKILL;
4701 +- if (!wake_up_state(t, mask))
4702 ++ if (!wake_up_state(t, state | TASK_INTERRUPTIBLE))
4703 + kick_process(t);
4704 + }
4705 +
4706 +@@ -841,7 +835,7 @@ static void ptrace_trap_notify(struct task_struct *t)
4707 + assert_spin_locked(&t->sighand->siglock);
4708 +
4709 + task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
4710 +- signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
4711 ++ ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
4712 + }
4713 +
4714 + /*
4715 +@@ -1765,6 +1759,10 @@ static inline int may_ptrace_stop(void)
4716 + * If SIGKILL was already sent before the caller unlocked
4717 + * ->siglock we must see ->core_state != NULL. Otherwise it
4718 + * is safe to enter schedule().
4719 ++ *
4720 ++ * This is almost outdated, a task with the pending SIGKILL can't
4721 ++ * block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported
4722 ++ * after SIGKILL was already dequeued.
4723 + */
4724 + if (unlikely(current->mm->core_state) &&
4725 + unlikely(current->mm == current->parent->mm))
4726 +@@ -1890,6 +1888,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
4727 + if (gstop_done)
4728 + do_notify_parent_cldstop(current, false, why);
4729 +
4730 ++ /* tasklist protects us from ptrace_freeze_traced() */
4731 + __set_current_state(TASK_RUNNING);
4732 + if (clear_code)
4733 + current->exit_code = 0;
4734 +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
4735 +index 6033f02..7a157b3 100644
4736 +--- a/net/bluetooth/hci_event.c
4737 ++++ b/net/bluetooth/hci_event.c
4738 +@@ -1972,7 +1972,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
4739 + if (ev->opcode != HCI_OP_NOP)
4740 + del_timer(&hdev->cmd_timer);
4741 +
4742 +- if (ev->ncmd) {
4743 ++ if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
4744 + atomic_set(&hdev->cmd_cnt, 1);
4745 + if (!skb_queue_empty(&hdev->cmd_q))
4746 + tasklet_schedule(&hdev->cmd_task);
4747 +diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
4748 +index 1849ee0..9ab60e6 100644
4749 +--- a/net/bluetooth/smp.c
4750 ++++ b/net/bluetooth/smp.c
4751 +@@ -642,6 +642,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
4752 +
4753 + skb_pull(skb, sizeof(code));
4754 +
4755 ++ /*
4756 ++ * The SMP context must be initialized for all other PDUs except
4757 ++ * pairing and security requests. If we get any other PDU when
4758 ++ * not initialized simply disconnect (done if this function
4759 ++ * returns an error).
4760 ++ */
4761 ++ if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ &&
4762 ++ !conn->smp_chan) {
4763 ++ BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);
4764 ++ kfree_skb(skb);
4765 ++ return -ENOTSUPP;
4766 ++ }
4767 ++
4768 + switch (code) {
4769 + case SMP_CMD_PAIRING_REQ:
4770 + reason = smp_cmd_pairing_req(conn, skb);
4771 +diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
4772 +index 577ea5d..7c1745d 100644
4773 +--- a/net/bridge/br_netfilter.c
4774 ++++ b/net/bridge/br_netfilter.c
4775 +@@ -245,6 +245,9 @@ static int br_parse_ip_options(struct sk_buff *skb)
4776 + struct net_device *dev = skb->dev;
4777 + u32 len;
4778 +
4779 ++ if (!pskb_may_pull(skb, sizeof(struct iphdr)))
4780 ++ goto inhdr_error;
4781 ++
4782 + iph = ip_hdr(skb);
4783 + opt = &(IPCB(skb)->opt);
4784 +
4785 +diff --git a/net/core/pktgen.c b/net/core/pktgen.c
4786 +index 7bc9991..2ef7da0 100644
4787 +--- a/net/core/pktgen.c
4788 ++++ b/net/core/pktgen.c
4789 +@@ -1803,10 +1803,13 @@ static ssize_t pktgen_thread_write(struct file *file,
4790 + return -EFAULT;
4791 + i += len;
4792 + mutex_lock(&pktgen_thread_lock);
4793 +- pktgen_add_device(t, f);
4794 ++ ret = pktgen_add_device(t, f);
4795 + mutex_unlock(&pktgen_thread_lock);
4796 +- ret = count;
4797 +- sprintf(pg_result, "OK: add_device=%s", f);
4798 ++ if (!ret) {
4799 ++ ret = count;
4800 ++ sprintf(pg_result, "OK: add_device=%s", f);
4801 ++ } else
4802 ++ sprintf(pg_result, "ERROR: can not add device %s", f);
4803 + goto out;
4804 + }
4805 +
4806 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
4807 +index 0106d25..3b36002 100644
4808 +--- a/net/ipv4/ip_sockglue.c
4809 ++++ b/net/ipv4/ip_sockglue.c
4810 +@@ -600,7 +600,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
4811 + case IP_TTL:
4812 + if (optlen < 1)
4813 + goto e_inval;
4814 +- if (val != -1 && (val < 0 || val > 255))
4815 ++ if (val != -1 && (val < 1 || val > 255))
4816 + goto e_inval;
4817 + inet->uc_ttl = val;
4818 + break;
4819 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
4820 +index aab8f08..e865ed1 100644
4821 +--- a/net/ipv4/tcp_input.c
4822 ++++ b/net/ipv4/tcp_input.c
4823 +@@ -3655,6 +3655,11 @@ static int tcp_process_frto(struct sock *sk, int flag)
4824 + }
4825 + } else {
4826 + if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) {
4827 ++ if (!tcp_packets_in_flight(tp)) {
4828 ++ tcp_enter_frto_loss(sk, 2, flag);
4829 ++ return true;
4830 ++ }
4831 ++
4832 + /* Prevent sending of new data. */
4833 + tp->snd_cwnd = min(tp->snd_cwnd,
4834 + tcp_packets_in_flight(tp));
4835 +diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
4836 +index aef80d7..b27baed 100644
4837 +--- a/net/ipv6/addrconf.c
4838 ++++ b/net/ipv6/addrconf.c
4839 +@@ -1739,7 +1739,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
4840 + continue;
4841 + if ((rt->rt6i_flags & flags) != flags)
4842 + continue;
4843 +- if ((noflags != 0) && ((rt->rt6i_flags & flags) != 0))
4844 ++ if ((rt->rt6i_flags & noflags) != 0)
4845 + continue;
4846 + dst_hold(&rt->dst);
4847 + break;
4848 +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
4849 +index ae98e09..3ccd9b2 100644
4850 +--- a/net/ipv6/ip6_output.c
4851 ++++ b/net/ipv6/ip6_output.c
4852 +@@ -1284,10 +1284,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
4853 + cork->length = 0;
4854 + sk->sk_sndmsg_page = NULL;
4855 + sk->sk_sndmsg_off = 0;
4856 +- exthdrlen = (opt ? opt->opt_flen : 0) - rt->rt6i_nfheader_len;
4857 ++ exthdrlen = (opt ? opt->opt_flen : 0);
4858 + length += exthdrlen;
4859 + transhdrlen += exthdrlen;
4860 +- dst_exthdrlen = rt->dst.header_len;
4861 ++ dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len;
4862 + } else {
4863 + rt = (struct rt6_info *)cork->dst;
4864 + fl6 = &inet->cork.fl.u.ip6;
4865 +diff --git a/net/ipv6/route.c b/net/ipv6/route.c
4866 +index 19724bd..791c1fa 100644
4867 +--- a/net/ipv6/route.c
4868 ++++ b/net/ipv6/route.c
4869 +@@ -819,7 +819,8 @@ restart:
4870 + dst_hold(&rt->dst);
4871 + read_unlock_bh(&table->tb6_lock);
4872 +
4873 +- if (!dst_get_neighbour_raw(&rt->dst) && !(rt->rt6i_flags & RTF_NONEXTHOP))
4874 ++ if (!dst_get_neighbour_raw(&rt->dst)
4875 ++ && !(rt->rt6i_flags & (RTF_NONEXTHOP | RTF_LOCAL)))
4876 + nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr);
4877 + else if (!(rt->dst.flags & DST_HOST))
4878 + nrt = rt6_alloc_clone(rt, &fl6->daddr);
4879 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
4880 +index 85afc13..835fcea 100644
4881 +--- a/net/packet/af_packet.c
4882 ++++ b/net/packet/af_packet.c
4883 +@@ -2422,13 +2422,15 @@ static int packet_release(struct socket *sock)
4884 +
4885 + packet_flush_mclist(sk);
4886 +
4887 +- memset(&req_u, 0, sizeof(req_u));
4888 +-
4889 +- if (po->rx_ring.pg_vec)
4890 ++ if (po->rx_ring.pg_vec) {
4891 ++ memset(&req_u, 0, sizeof(req_u));
4892 + packet_set_ring(sk, &req_u, 1, 0);
4893 ++ }
4894 +
4895 +- if (po->tx_ring.pg_vec)
4896 ++ if (po->tx_ring.pg_vec) {
4897 ++ memset(&req_u, 0, sizeof(req_u));
4898 + packet_set_ring(sk, &req_u, 1, 1);
4899 ++ }
4900 +
4901 + fanout_release(sk);
4902 +
4903 +diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
4904 +index c8cc24e..dbe5870a 100644
4905 +--- a/net/sctp/endpointola.c
4906 ++++ b/net/sctp/endpointola.c
4907 +@@ -248,6 +248,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)
4908 + /* Final destructor for endpoint. */
4909 + static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
4910 + {
4911 ++ int i;
4912 ++
4913 + SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
4914 +
4915 + /* Free up the HMAC transform. */
4916 +@@ -270,6 +272,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
4917 + sctp_inq_free(&ep->base.inqueue);
4918 + sctp_bind_addr_free(&ep->base.bind_addr);
4919 +
4920 ++ for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i)
4921 ++ memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE);
4922 ++
4923 + /* Remove and free the port */
4924 + if (sctp_sk(ep->base.sk)->bind_hash)
4925 + sctp_put_port(ep->base.sk);
4926 +diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
4927 +index cfeb1d4..96eb168 100644
4928 +--- a/net/sctp/outqueue.c
4929 ++++ b/net/sctp/outqueue.c
4930 +@@ -223,7 +223,7 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
4931 +
4932 + /* Free the outqueue structure and any related pending chunks.
4933 + */
4934 +-void sctp_outq_teardown(struct sctp_outq *q)
4935 ++static void __sctp_outq_teardown(struct sctp_outq *q)
4936 + {
4937 + struct sctp_transport *transport;
4938 + struct list_head *lchunk, *temp;
4939 +@@ -276,8 +276,6 @@ void sctp_outq_teardown(struct sctp_outq *q)
4940 + sctp_chunk_free(chunk);
4941 + }
4942 +
4943 +- q->error = 0;
4944 +-
4945 + /* Throw away any leftover control chunks. */
4946 + list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
4947 + list_del_init(&chunk->list);
4948 +@@ -285,11 +283,17 @@ void sctp_outq_teardown(struct sctp_outq *q)
4949 + }
4950 + }
4951 +
4952 ++void sctp_outq_teardown(struct sctp_outq *q)
4953 ++{
4954 ++ __sctp_outq_teardown(q);
4955 ++ sctp_outq_init(q->asoc, q);
4956 ++}
4957 ++
4958 + /* Free the outqueue structure and any related pending chunks. */
4959 + void sctp_outq_free(struct sctp_outq *q)
4960 + {
4961 + /* Throw away leftover chunks. */
4962 +- sctp_outq_teardown(q);
4963 ++ __sctp_outq_teardown(q);
4964 +
4965 + /* If we were kmalloc()'d, free the memory. */
4966 + if (q->malloced)
4967 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
4968 +index fa8333b..5e0d86e 100644
4969 +--- a/net/sctp/socket.c
4970 ++++ b/net/sctp/socket.c
4971 +@@ -3375,7 +3375,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
4972 +
4973 + ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey);
4974 + out:
4975 +- kfree(authkey);
4976 ++ kzfree(authkey);
4977 + return ret;
4978 + }
4979 +
4980
4981 Modified: genpatches-2.6/trunk/3.4/0000_README
4982 ===================================================================
4983 --- genpatches-2.6/trunk/3.4/0000_README 2013-02-23 19:07:21 UTC (rev 2290)
4984 +++ genpatches-2.6/trunk/3.4/0000_README 2013-02-28 19:13:50 UTC (rev 2291)
4985 @@ -167,6 +167,14 @@
4986 From: http://www.kernel.org
4987 Desc: Linux 3.4.32
4988
4989 +Patch: 1032_linux-3.4.33.patch
4990 +From: http://www.kernel.org
4991 +Desc: Linux 3.4.33
4992 +
4993 +Patch: 1033_linux-3.4.34.patch
4994 +From: http://www.kernel.org
4995 +Desc: Linux 3.4.34
4996 +
4997 Patch: 1700_correct-bnx2-firware-ver-mips.patch
4998 From: https://bugs.gentoo.org/show_bug.cgi?id=424609
4999 Desc: Correct firmware version for bnx2 on mips
5000
5001 Added: genpatches-2.6/trunk/3.4/1032_linux-3.4.33.patch
5002 ===================================================================
5003 --- genpatches-2.6/trunk/3.4/1032_linux-3.4.33.patch (rev 0)
5004 +++ genpatches-2.6/trunk/3.4/1032_linux-3.4.33.patch 2013-02-28 19:13:50 UTC (rev 2291)
5005 @@ -0,0 +1,54 @@
5006 +diff --git a/Makefile b/Makefile
5007 +index ece8970..a26d19a 100644
5008 +--- a/Makefile
5009 ++++ b/Makefile
5010 +@@ -1,6 +1,6 @@
5011 + VERSION = 3
5012 + PATCHLEVEL = 4
5013 +-SUBLEVEL = 32
5014 ++SUBLEVEL = 33
5015 + EXTRAVERSION =
5016 + NAME = Saber-toothed Squirrel
5017 +
5018 +diff --git a/include/linux/syslog.h b/include/linux/syslog.h
5019 +index 3891139..ce4c665 100644
5020 +--- a/include/linux/syslog.h
5021 ++++ b/include/linux/syslog.h
5022 +@@ -47,6 +47,12 @@
5023 + #define SYSLOG_FROM_CALL 0
5024 + #define SYSLOG_FROM_FILE 1
5025 +
5026 ++/*
5027 ++ * Syslog priority (PRI) maximum length in char : '<[0-9]{1,3}>'
5028 ++ * See RFC5424 for details
5029 ++*/
5030 ++#define SYSLOG_PRI_MAX_LENGTH 5
5031 ++
5032 + int do_syslog(int type, char __user *buf, int count, bool from_file);
5033 +
5034 + #endif /* _LINUX_SYSLOG_H */
5035 +diff --git a/kernel/printk.c b/kernel/printk.c
5036 +index b663c2c..e95c662 100644
5037 +--- a/kernel/printk.c
5038 ++++ b/kernel/printk.c
5039 +@@ -638,8 +638,19 @@ static void call_console_drivers(unsigned start, unsigned end)
5040 + start_print = start;
5041 + while (cur_index != end) {
5042 + if (msg_level < 0 && ((end - cur_index) > 2)) {
5043 ++ /*
5044 ++ * prepare buf_prefix, as a contiguous array,
5045 ++ * to be processed by log_prefix function
5046 ++ */
5047 ++ char buf_prefix[SYSLOG_PRI_MAX_LENGTH+1];
5048 ++ unsigned i;
5049 ++ for (i = 0; i < ((end - cur_index)) && (i < SYSLOG_PRI_MAX_LENGTH); i++) {
5050 ++ buf_prefix[i] = LOG_BUF(cur_index + i);
5051 ++ }
5052 ++ buf_prefix[i] = '\0'; /* force '\0' as last string character */
5053 ++
5054 + /* strip log prefix */
5055 +- cur_index += log_prefix(&LOG_BUF(cur_index), &msg_level, NULL);
5056 ++ cur_index += log_prefix((const char *)&buf_prefix, &msg_level, NULL);
5057 + start_print = cur_index;
5058 + }
5059 + while (cur_index != end) {
5060
5061 Added: genpatches-2.6/trunk/3.4/1033_linux-3.4.34.patch
5062 ===================================================================
5063 --- genpatches-2.6/trunk/3.4/1033_linux-3.4.34.patch (rev 0)
5064 +++ genpatches-2.6/trunk/3.4/1033_linux-3.4.34.patch 2013-02-28 19:13:50 UTC (rev 2291)
5065 @@ -0,0 +1,3543 @@
5066 +diff --git a/Makefile b/Makefile
5067 +index a26d19a..250be36 100644
5068 +--- a/Makefile
5069 ++++ b/Makefile
5070 +@@ -1,6 +1,6 @@
5071 + VERSION = 3
5072 + PATCHLEVEL = 4
5073 +-SUBLEVEL = 33
5074 ++SUBLEVEL = 34
5075 + EXTRAVERSION =
5076 + NAME = Saber-toothed Squirrel
5077 +
5078 +diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
5079 +index 27d186a..6bbf936 100644
5080 +--- a/arch/arm/kernel/sched_clock.c
5081 ++++ b/arch/arm/kernel/sched_clock.c
5082 +@@ -84,11 +84,11 @@ static void notrace update_sched_clock(void)
5083 + * detectable in cyc_to_fixed_sched_clock().
5084 + */
5085 + raw_local_irq_save(flags);
5086 +- cd.epoch_cyc = cyc;
5087 ++ cd.epoch_cyc_copy = cyc;
5088 + smp_wmb();
5089 + cd.epoch_ns = ns;
5090 + smp_wmb();
5091 +- cd.epoch_cyc_copy = cyc;
5092 ++ cd.epoch_cyc = cyc;
5093 + raw_local_irq_restore(flags);
5094 + }
5095 +
5096 +diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h
5097 +index b7de471..b802f28 100644
5098 +--- a/arch/arm/mach-pxa/include/mach/smemc.h
5099 ++++ b/arch/arm/mach-pxa/include/mach/smemc.h
5100 +@@ -37,6 +37,7 @@
5101 + #define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
5102 + #define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
5103 + #define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
5104 ++#define CSMSADRCFG (SMEMC_VIRT + 0xA0) /* Chip Select Configuration Register */
5105 +
5106 + /*
5107 + * More handy macros for PCMCIA
5108 +diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
5109 +index 7992305..f38aa89 100644
5110 +--- a/arch/arm/mach-pxa/smemc.c
5111 ++++ b/arch/arm/mach-pxa/smemc.c
5112 +@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)
5113 + __raw_writel(csadrcfg[1], CSADRCFG1);
5114 + __raw_writel(csadrcfg[2], CSADRCFG2);
5115 + __raw_writel(csadrcfg[3], CSADRCFG3);
5116 ++ /* CSMSADRCFG wakes up in its default state (0), so we need to set it */
5117 ++ __raw_writel(0x2, CSMSADRCFG);
5118 + }
5119 +
5120 + static struct syscore_ops smemc_syscore_ops = {
5121 +@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {
5122 +
5123 + static int __init smemc_init(void)
5124 + {
5125 +- if (cpu_is_pxa3xx())
5126 ++ if (cpu_is_pxa3xx()) {
5127 ++ /*
5128 ++ * The only documentation we have on the
5129 ++ * Chip Select Configuration Register (CSMSADRCFG) is that
5130 ++ * it must be programmed to 0x2.
5131 ++ * Moreover, in the bit definitions, the second bit
5132 ++ * (CSMSADRCFG[1]) is called "SETALWAYS".
5133 ++ * Other bits are reserved in this register.
5134 ++ */
5135 ++ __raw_writel(0x2, CSMSADRCFG);
5136 ++
5137 + register_syscore_ops(&smemc_syscore_ops);
5138 ++ }
5139 +
5140 + return 0;
5141 + }
5142 +diff --git a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
5143 +index 4135de8..13ed33c 100644
5144 +--- a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
5145 ++++ b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
5146 +@@ -40,17 +40,17 @@
5147 + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
5148 + addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
5149 + bic \rd, \rd, #0xff000
5150 +- ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
5151 ++ ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
5152 + and \rd, \rd, #0x00ff0000
5153 + teq \rd, #0x00440000 @ is it 2440?
5154 + 1004:
5155 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5156 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5157 + moveq \rd, \rd, lsr #SHIFT_2440TXF
5158 + tst \rd, #S3C2410_UFSTAT_TXFULL
5159 + .endm
5160 +
5161 + .macro fifo_full_s3c2410 rd, rx
5162 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5163 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5164 + tst \rd, #S3C2410_UFSTAT_TXFULL
5165 + .endm
5166 +
5167 +@@ -68,18 +68,18 @@
5168 + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
5169 + addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
5170 + bic \rd, \rd, #0xff000
5171 +- ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
5172 ++ ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
5173 + and \rd, \rd, #0x00ff0000
5174 + teq \rd, #0x00440000 @ is it 2440?
5175 +
5176 + 10000:
5177 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5178 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5179 + andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
5180 + andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
5181 + .endm
5182 +
5183 + .macro fifo_level_s3c2410 rd, rx
5184 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5185 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5186 + and \rd, \rd, #S3C2410_UFSTAT_TXMASK
5187 + .endm
5188 +
5189 +diff --git a/arch/arm/mach-s3c24xx/include/mach/entry-macro.S b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
5190 +index 7615a14..6a21bee 100644
5191 +--- a/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
5192 ++++ b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
5193 +@@ -31,10 +31,10 @@
5194 +
5195 + @@ try the interrupt offset register, since it is there
5196 +
5197 +- ldr \irqstat, [ \base, #INTPND ]
5198 ++ ldr \irqstat, [\base, #INTPND ]
5199 + teq \irqstat, #0
5200 + beq 1002f
5201 +- ldr \irqnr, [ \base, #INTOFFSET ]
5202 ++ ldr \irqnr, [\base, #INTOFFSET ]
5203 + mov \tmp, #1
5204 + tst \irqstat, \tmp, lsl \irqnr
5205 + bne 1001f
5206 +diff --git a/arch/arm/mach-s3c24xx/pm-h1940.S b/arch/arm/mach-s3c24xx/pm-h1940.S
5207 +index c93bf2d..6183a68 100644
5208 +--- a/arch/arm/mach-s3c24xx/pm-h1940.S
5209 ++++ b/arch/arm/mach-s3c24xx/pm-h1940.S
5210 +@@ -30,4 +30,4 @@
5211 +
5212 + h1940_pm_return:
5213 + mov r0, #S3C2410_PA_GPIO
5214 +- ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ]
5215 ++ ldr pc, [r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO]
5216 +diff --git a/arch/arm/mach-s3c24xx/sleep-s3c2410.S b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
5217 +index dd5b638..65200ae 100644
5218 +--- a/arch/arm/mach-s3c24xx/sleep-s3c2410.S
5219 ++++ b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
5220 +@@ -45,9 +45,9 @@ ENTRY(s3c2410_cpu_suspend)
5221 + ldr r4, =S3C2410_REFRESH
5222 + ldr r5, =S3C24XX_MISCCR
5223 + ldr r6, =S3C2410_CLKCON
5224 +- ldr r7, [ r4 ] @ get REFRESH (and ensure in TLB)
5225 +- ldr r8, [ r5 ] @ get MISCCR (and ensure in TLB)
5226 +- ldr r9, [ r6 ] @ get CLKCON (and ensure in TLB)
5227 ++ ldr r7, [r4] @ get REFRESH (and ensure in TLB)
5228 ++ ldr r8, [r5] @ get MISCCR (and ensure in TLB)
5229 ++ ldr r9, [r6] @ get CLKCON (and ensure in TLB)
5230 +
5231 + orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
5232 + orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
5233 +@@ -61,8 +61,8 @@ ENTRY(s3c2410_cpu_suspend)
5234 + @@ align next bit of code to cache line
5235 + .align 5
5236 + s3c2410_do_sleep:
5237 +- streq r7, [ r4 ] @ SDRAM sleep command
5238 +- streq r8, [ r5 ] @ SDRAM power-down config
5239 +- streq r9, [ r6 ] @ CPU sleep
5240 ++ streq r7, [r4] @ SDRAM sleep command
5241 ++ streq r8, [r5] @ SDRAM power-down config
5242 ++ streq r9, [r6] @ CPU sleep
5243 + 1: beq 1b
5244 + mov pc, r14
5245 +diff --git a/arch/arm/mach-s3c24xx/sleep-s3c2412.S b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
5246 +index c82418e..5adaceb 100644
5247 +--- a/arch/arm/mach-s3c24xx/sleep-s3c2412.S
5248 ++++ b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
5249 +@@ -57,12 +57,12 @@ s3c2412_sleep_enter1:
5250 + * retry, as simply returning causes the system to lock.
5251 + */
5252 +
5253 +- ldrne r9, [ r1 ]
5254 +- strne r9, [ r1 ]
5255 +- ldrne r9, [ r2 ]
5256 +- strne r9, [ r2 ]
5257 +- ldrne r9, [ r3 ]
5258 +- strne r9, [ r3 ]
5259 ++ ldrne r9, [r1]
5260 ++ strne r9, [r1]
5261 ++ ldrne r9, [r2]
5262 ++ strne r9, [r2]
5263 ++ ldrne r9, [r3]
5264 ++ strne r9, [r3]
5265 + bne s3c2412_sleep_enter1
5266 +
5267 + mov pc, r14
5268 +diff --git a/arch/arm/plat-samsung/include/plat/debug-macro.S b/arch/arm/plat-samsung/include/plat/debug-macro.S
5269 +index 207e275..f3a9cff 100644
5270 +--- a/arch/arm/plat-samsung/include/plat/debug-macro.S
5271 ++++ b/arch/arm/plat-samsung/include/plat/debug-macro.S
5272 +@@ -14,12 +14,12 @@
5273 + /* The S5PV210/S5PC110 implementations are as belows. */
5274 +
5275 + .macro fifo_level_s5pv210 rd, rx
5276 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5277 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5278 + and \rd, \rd, #S5PV210_UFSTAT_TXMASK
5279 + .endm
5280 +
5281 + .macro fifo_full_s5pv210 rd, rx
5282 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5283 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5284 + tst \rd, #S5PV210_UFSTAT_TXFULL
5285 + .endm
5286 +
5287 +@@ -27,7 +27,7 @@
5288 + * most widely re-used */
5289 +
5290 + .macro fifo_level_s3c2440 rd, rx
5291 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5292 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5293 + and \rd, \rd, #S3C2440_UFSTAT_TXMASK
5294 + .endm
5295 +
5296 +@@ -36,7 +36,7 @@
5297 + #endif
5298 +
5299 + .macro fifo_full_s3c2440 rd, rx
5300 +- ldr \rd, [ \rx, # S3C2410_UFSTAT ]
5301 ++ ldr \rd, [\rx, # S3C2410_UFSTAT]
5302 + tst \rd, #S3C2440_UFSTAT_TXFULL
5303 + .endm
5304 +
5305 +@@ -45,11 +45,11 @@
5306 + #endif
5307 +
5308 + .macro senduart,rd,rx
5309 +- strb \rd, [\rx, # S3C2410_UTXH ]
5310 ++ strb \rd, [\rx, # S3C2410_UTXH]
5311 + .endm
5312 +
5313 + .macro busyuart, rd, rx
5314 +- ldr \rd, [ \rx, # S3C2410_UFCON ]
5315 ++ ldr \rd, [\rx, # S3C2410_UFCON]
5316 + tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
5317 + beq 1001f @
5318 + @ FIFO enabled...
5319 +@@ -60,7 +60,7 @@
5320 +
5321 + 1001:
5322 + @ busy waiting for non fifo
5323 +- ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
5324 ++ ldr \rd, [\rx, # S3C2410_UTRSTAT]
5325 + tst \rd, #S3C2410_UTRSTAT_TXFE
5326 + beq 1001b
5327 +
5328 +@@ -68,7 +68,7 @@
5329 + .endm
5330 +
5331 + .macro waituart,rd,rx
5332 +- ldr \rd, [ \rx, # S3C2410_UFCON ]
5333 ++ ldr \rd, [\rx, # S3C2410_UFCON]
5334 + tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
5335 + beq 1001f @
5336 + @ FIFO enabled...
5337 +@@ -79,7 +79,7 @@
5338 + b 1002f
5339 + 1001:
5340 + @ idle waiting for non fifo
5341 +- ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
5342 ++ ldr \rd, [\rx, # S3C2410_UTRSTAT]
5343 + tst \rd, #S3C2410_UTRSTAT_TXFE
5344 + beq 1001b
5345 +
5346 +diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
5347 +index ee99f23..7df49fa 100644
5348 +--- a/arch/parisc/include/asm/pgtable.h
5349 ++++ b/arch/parisc/include/asm/pgtable.h
5350 +@@ -12,11 +12,10 @@
5351 +
5352 + #include <linux/bitops.h>
5353 + #include <linux/spinlock.h>
5354 ++#include <linux/mm_types.h>
5355 + #include <asm/processor.h>
5356 + #include <asm/cache.h>
5357 +
5358 +-struct vm_area_struct;
5359 +-
5360 + /*
5361 + * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
5362 + * memory. For the return value to be meaningful, ADDR must be >=
5363 +@@ -40,7 +39,14 @@ struct vm_area_struct;
5364 + do{ \
5365 + *(pteptr) = (pteval); \
5366 + } while(0)
5367 +-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
5368 ++
5369 ++extern void purge_tlb_entries(struct mm_struct *, unsigned long);
5370 ++
5371 ++#define set_pte_at(mm, addr, ptep, pteval) \
5372 ++ do { \
5373 ++ set_pte(ptep, pteval); \
5374 ++ purge_tlb_entries(mm, addr); \
5375 ++ } while (0)
5376 +
5377 + #endif /* !__ASSEMBLY__ */
5378 +
5379 +@@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
5380 + old = pte_val(*ptep);
5381 + new = pte_val(pte_wrprotect(__pte (old)));
5382 + } while (cmpxchg((unsigned long *) ptep, old, new) != old);
5383 ++ purge_tlb_entries(mm, addr);
5384 + #else
5385 + pte_t old_pte = *ptep;
5386 + set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
5387 +diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
5388 +index 9d18189..fa21463 100644
5389 +--- a/arch/parisc/kernel/cache.c
5390 ++++ b/arch/parisc/kernel/cache.c
5391 +@@ -420,6 +420,24 @@ void kunmap_parisc(void *addr)
5392 + EXPORT_SYMBOL(kunmap_parisc);
5393 + #endif
5394 +
5395 ++void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
5396 ++{
5397 ++ unsigned long flags;
5398 ++
5399 ++ /* Note: purge_tlb_entries can be called at startup with
5400 ++ no context. */
5401 ++
5402 ++ /* Disable preemption while we play with %sr1. */
5403 ++ preempt_disable();
5404 ++ mtsp(mm->context, 1);
5405 ++ purge_tlb_start(flags);
5406 ++ pdtlb(addr);
5407 ++ pitlb(addr);
5408 ++ purge_tlb_end(flags);
5409 ++ preempt_enable();
5410 ++}
5411 ++EXPORT_SYMBOL(purge_tlb_entries);
5412 ++
5413 + void __flush_tlb_range(unsigned long sid, unsigned long start,
5414 + unsigned long end)
5415 + {
5416 +diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
5417 +index d7f6090..39833e0 100644
5418 +--- a/arch/powerpc/kernel/machine_kexec_64.c
5419 ++++ b/arch/powerpc/kernel/machine_kexec_64.c
5420 +@@ -162,6 +162,8 @@ static int kexec_all_irq_disabled = 0;
5421 + static void kexec_smp_down(void *arg)
5422 + {
5423 + local_irq_disable();
5424 ++ hard_irq_disable();
5425 ++
5426 + mb(); /* make sure our irqs are disabled before we say they are */
5427 + get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
5428 + while(kexec_all_irq_disabled == 0)
5429 +@@ -244,6 +246,8 @@ static void kexec_prepare_cpus(void)
5430 + wake_offline_cpus();
5431 + smp_call_function(kexec_smp_down, NULL, /* wait */0);
5432 + local_irq_disable();
5433 ++ hard_irq_disable();
5434 ++
5435 + mb(); /* make sure IRQs are disabled before we say they are */
5436 + get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
5437 +
5438 +@@ -281,6 +285,7 @@ static void kexec_prepare_cpus(void)
5439 + if (ppc_md.kexec_cpu_down)
5440 + ppc_md.kexec_cpu_down(0, 0);
5441 + local_irq_disable();
5442 ++ hard_irq_disable();
5443 + }
5444 +
5445 + #endif /* SMP */
5446 +diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
5447 +index 217ce44..e00accf 100644
5448 +--- a/arch/s390/kvm/kvm-s390.c
5449 ++++ b/arch/s390/kvm/kvm-s390.c
5450 +@@ -677,6 +677,14 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
5451 + } else
5452 + prefix = 0;
5453 +
5454 ++ /*
5455 ++ * The guest FPRS and ACRS are in the host FPRS/ACRS due to the lazy
5456 ++ * copying in vcpu load/put. Lets update our copies before we save
5457 ++ * it into the save area
5458 ++ */
5459 ++ save_fp_regs(&vcpu->arch.guest_fpregs);
5460 ++ save_access_regs(vcpu->run->s.regs.acrs);
5461 ++
5462 + if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs),
5463 + vcpu->arch.guest_fpregs.fprs, 128, prefix))
5464 + return -EFAULT;
5465 +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
5466 +index c9866b0..b1478f4 100644
5467 +--- a/arch/x86/Kconfig
5468 ++++ b/arch/x86/Kconfig
5469 +@@ -1243,10 +1243,6 @@ config HAVE_ARCH_BOOTMEM
5470 + def_bool y
5471 + depends on X86_32 && NUMA
5472 +
5473 +-config HAVE_ARCH_ALLOC_REMAP
5474 +- def_bool y
5475 +- depends on X86_32 && NUMA
5476 +-
5477 + config ARCH_HAVE_MEMORY_PRESENT
5478 + def_bool y
5479 + depends on X86_32 && DISCONTIGMEM
5480 +diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h
5481 +index 55728e1..5e0286f 100644
5482 +--- a/arch/x86/include/asm/mmzone_32.h
5483 ++++ b/arch/x86/include/asm/mmzone_32.h
5484 +@@ -14,12 +14,6 @@ extern struct pglist_data *node_data[];
5485 +
5486 + #include <asm/numaq.h>
5487 +
5488 +-extern void resume_map_numa_kva(pgd_t *pgd);
5489 +-
5490 +-#else /* !CONFIG_NUMA */
5491 +-
5492 +-static inline void resume_map_numa_kva(pgd_t *pgd) {}
5493 +-
5494 + #endif /* CONFIG_NUMA */
5495 +
5496 + #ifdef CONFIG_DISCONTIGMEM
5497 +diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
5498 +index 0a630dd..646d192 100644
5499 +--- a/arch/x86/kernel/cpu/mshyperv.c
5500 ++++ b/arch/x86/kernel/cpu/mshyperv.c
5501 +@@ -68,7 +68,8 @@ static void __init ms_hyperv_init_platform(void)
5502 + printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
5503 + ms_hyperv.features, ms_hyperv.hints);
5504 +
5505 +- clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
5506 ++ if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
5507 ++ clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
5508 + }
5509 +
5510 + const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
5511 +diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
5512 +index 19d3fa0..c1e8394 100644
5513 +--- a/arch/x86/mm/numa.c
5514 ++++ b/arch/x86/mm/numa.c
5515 +@@ -193,7 +193,6 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
5516 + static void __init setup_node_data(int nid, u64 start, u64 end)
5517 + {
5518 + const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
5519 +- bool remapped = false;
5520 + u64 nd_pa;
5521 + void *nd;
5522 + int tnid;
5523 +@@ -205,37 +204,28 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
5524 + if (end && (end - start) < NODE_MIN_SIZE)
5525 + return;
5526 +
5527 +- /* initialize remap allocator before aligning to ZONE_ALIGN */
5528 +- init_alloc_remap(nid, start, end);
5529 +-
5530 + start = roundup(start, ZONE_ALIGN);
5531 +
5532 + printk(KERN_INFO "Initmem setup node %d %016Lx-%016Lx\n",
5533 + nid, start, end);
5534 +
5535 + /*
5536 +- * Allocate node data. Try remap allocator first, node-local
5537 +- * memory and then any node. Never allocate in DMA zone.
5538 ++ * Allocate node data. Try node-local memory and then any node.
5539 ++ * Never allocate in DMA zone.
5540 + */
5541 +- nd = alloc_remap(nid, nd_size);
5542 +- if (nd) {
5543 +- nd_pa = __pa(nd);
5544 +- remapped = true;
5545 +- } else {
5546 +- nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
5547 +- if (!nd_pa) {
5548 +- pr_err("Cannot find %zu bytes in node %d\n",
5549 +- nd_size, nid);
5550 +- return;
5551 +- }
5552 +- nd = __va(nd_pa);
5553 ++ nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
5554 ++ if (!nd_pa) {
5555 ++ pr_err("Cannot find %zu bytes in node %d\n",
5556 ++ nd_size, nid);
5557 ++ return;
5558 + }
5559 ++ nd = __va(nd_pa);
5560 +
5561 + /* report and initialize */
5562 +- printk(KERN_INFO " NODE_DATA [%016Lx - %016Lx]%s\n",
5563 +- nd_pa, nd_pa + nd_size - 1, remapped ? " (remapped)" : "");
5564 ++ printk(KERN_INFO " NODE_DATA [mem %#010Lx-%#010Lx]\n",
5565 ++ nd_pa, nd_pa + nd_size - 1);
5566 + tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
5567 +- if (!remapped && tnid != nid)
5568 ++ if (tnid != nid)
5569 + printk(KERN_INFO " NODE_DATA(%d) on node %d\n", nid, tnid);
5570 +
5571 + node_data[nid] = nd;
5572 +diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
5573 +index 534255a..73a6d73 100644
5574 +--- a/arch/x86/mm/numa_32.c
5575 ++++ b/arch/x86/mm/numa_32.c
5576 +@@ -73,167 +73,6 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn,
5577 +
5578 + extern unsigned long highend_pfn, highstart_pfn;
5579 +
5580 +-#define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE)
5581 +-
5582 +-static void *node_remap_start_vaddr[MAX_NUMNODES];
5583 +-void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
5584 +-
5585 +-/*
5586 +- * Remap memory allocator
5587 +- */
5588 +-static unsigned long node_remap_start_pfn[MAX_NUMNODES];
5589 +-static void *node_remap_end_vaddr[MAX_NUMNODES];
5590 +-static void *node_remap_alloc_vaddr[MAX_NUMNODES];
5591 +-
5592 +-/**
5593 +- * alloc_remap - Allocate remapped memory
5594 +- * @nid: NUMA node to allocate memory from
5595 +- * @size: The size of allocation
5596 +- *
5597 +- * Allocate @size bytes from the remap area of NUMA node @nid. The
5598 +- * size of the remap area is predetermined by init_alloc_remap() and
5599 +- * only the callers considered there should call this function. For
5600 +- * more info, please read the comment on top of init_alloc_remap().
5601 +- *
5602 +- * The caller must be ready to handle allocation failure from this
5603 +- * function and fall back to regular memory allocator in such cases.
5604 +- *
5605 +- * CONTEXT:
5606 +- * Single CPU early boot context.
5607 +- *
5608 +- * RETURNS:
5609 +- * Pointer to the allocated memory on success, %NULL on failure.
5610 +- */
5611 +-void *alloc_remap(int nid, unsigned long size)
5612 +-{
5613 +- void *allocation = node_remap_alloc_vaddr[nid];
5614 +-
5615 +- size = ALIGN(size, L1_CACHE_BYTES);
5616 +-
5617 +- if (!allocation || (allocation + size) > node_remap_end_vaddr[nid])
5618 +- return NULL;
5619 +-
5620 +- node_remap_alloc_vaddr[nid] += size;
5621 +- memset(allocation, 0, size);
5622 +-
5623 +- return allocation;
5624 +-}
5625 +-
5626 +-#ifdef CONFIG_HIBERNATION
5627 +-/**
5628 +- * resume_map_numa_kva - add KVA mapping to the temporary page tables created
5629 +- * during resume from hibernation
5630 +- * @pgd_base - temporary resume page directory
5631 +- */
5632 +-void resume_map_numa_kva(pgd_t *pgd_base)
5633 +-{
5634 +- int node;
5635 +-
5636 +- for_each_online_node(node) {
5637 +- unsigned long start_va, start_pfn, nr_pages, pfn;
5638 +-
5639 +- start_va = (unsigned long)node_remap_start_vaddr[node];
5640 +- start_pfn = node_remap_start_pfn[node];
5641 +- nr_pages = (node_remap_end_vaddr[node] -
5642 +- node_remap_start_vaddr[node]) >> PAGE_SHIFT;
5643 +-
5644 +- printk(KERN_DEBUG "%s: node %d\n", __func__, node);
5645 +-
5646 +- for (pfn = 0; pfn < nr_pages; pfn += PTRS_PER_PTE) {
5647 +- unsigned long vaddr = start_va + (pfn << PAGE_SHIFT);
5648 +- pgd_t *pgd = pgd_base + pgd_index(vaddr);
5649 +- pud_t *pud = pud_offset(pgd, vaddr);
5650 +- pmd_t *pmd = pmd_offset(pud, vaddr);
5651 +-
5652 +- set_pmd(pmd, pfn_pmd(start_pfn + pfn,
5653 +- PAGE_KERNEL_LARGE_EXEC));
5654 +-
5655 +- printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n",
5656 +- __func__, vaddr, start_pfn + pfn);
5657 +- }
5658 +- }
5659 +-}
5660 +-#endif
5661 +-
5662 +-/**
5663 +- * init_alloc_remap - Initialize remap allocator for a NUMA node
5664 +- * @nid: NUMA node to initizlie remap allocator for
5665 +- *
5666 +- * NUMA nodes may end up without any lowmem. As allocating pgdat and
5667 +- * memmap on a different node with lowmem is inefficient, a special
5668 +- * remap allocator is implemented which can be used by alloc_remap().
5669 +- *
5670 +- * For each node, the amount of memory which will be necessary for
5671 +- * pgdat and memmap is calculated and two memory areas of the size are
5672 +- * allocated - one in the node and the other in lowmem; then, the area
5673 +- * in the node is remapped to the lowmem area.
5674 +- *
5675 +- * As pgdat and memmap must be allocated in lowmem anyway, this
5676 +- * doesn't waste lowmem address space; however, the actual lowmem
5677 +- * which gets remapped over is wasted. The amount shouldn't be
5678 +- * problematic on machines this feature will be used.
5679 +- *
5680 +- * Initialization failure isn't fatal. alloc_remap() is used
5681 +- * opportunistically and the callers will fall back to other memory
5682 +- * allocation mechanisms on failure.
5683 +- */
5684 +-void __init init_alloc_remap(int nid, u64 start, u64 end)
5685 +-{
5686 +- unsigned long start_pfn = start >> PAGE_SHIFT;
5687 +- unsigned long end_pfn = end >> PAGE_SHIFT;
5688 +- unsigned long size, pfn;
5689 +- u64 node_pa, remap_pa;
5690 +- void *remap_va;
5691 +-
5692 +- /*
5693 +- * The acpi/srat node info can show hot-add memroy zones where
5694 +- * memory could be added but not currently present.
5695 +- */
5696 +- printk(KERN_DEBUG "node %d pfn: [%lx - %lx]\n",
5697 +- nid, start_pfn, end_pfn);
5698 +-
5699 +- /* calculate the necessary space aligned to large page size */
5700 +- size = node_memmap_size_bytes(nid, start_pfn, end_pfn);
5701 +- size += ALIGN(sizeof(pg_data_t), PAGE_SIZE);
5702 +- size = ALIGN(size, LARGE_PAGE_BYTES);
5703 +-
5704 +- /* allocate node memory and the lowmem remap area */
5705 +- node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES);
5706 +- if (!node_pa) {
5707 +- pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n",
5708 +- size, nid);
5709 +- return;
5710 +- }
5711 +- memblock_reserve(node_pa, size);
5712 +-
5713 +- remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT,
5714 +- max_low_pfn << PAGE_SHIFT,
5715 +- size, LARGE_PAGE_BYTES);
5716 +- if (!remap_pa) {
5717 +- pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n",
5718 +- size, nid);
5719 +- memblock_free(node_pa, size);
5720 +- return;
5721 +- }
5722 +- memblock_reserve(remap_pa, size);
5723 +- remap_va = phys_to_virt(remap_pa);
5724 +-
5725 +- /* perform actual remap */
5726 +- for (pfn = 0; pfn < size >> PAGE_SHIFT; pfn += PTRS_PER_PTE)
5727 +- set_pmd_pfn((unsigned long)remap_va + (pfn << PAGE_SHIFT),
5728 +- (node_pa >> PAGE_SHIFT) + pfn,
5729 +- PAGE_KERNEL_LARGE);
5730 +-
5731 +- /* initialize remap allocator parameters */
5732 +- node_remap_start_pfn[nid] = node_pa >> PAGE_SHIFT;
5733 +- node_remap_start_vaddr[nid] = remap_va;
5734 +- node_remap_end_vaddr[nid] = remap_va + size;
5735 +- node_remap_alloc_vaddr[nid] = remap_va;
5736 +-
5737 +- printk(KERN_DEBUG "remap_alloc: node %d [%08llx-%08llx) -> [%p-%p)\n",
5738 +- nid, node_pa, node_pa + size, remap_va, remap_va + size);
5739 +-}
5740 +-
5741 + void __init initmem_init(void)
5742 + {
5743 + x86_numa_init();
5744 +diff --git a/arch/x86/mm/numa_internal.h b/arch/x86/mm/numa_internal.h
5745 +index 7178c3a..ad86ec9 100644
5746 +--- a/arch/x86/mm/numa_internal.h
5747 ++++ b/arch/x86/mm/numa_internal.h
5748 +@@ -21,12 +21,6 @@ void __init numa_reset_distance(void);
5749 +
5750 + void __init x86_numa_init(void);
5751 +
5752 +-#ifdef CONFIG_X86_64
5753 +-static inline void init_alloc_remap(int nid, u64 start, u64 end) { }
5754 +-#else
5755 +-void __init init_alloc_remap(int nid, u64 start, u64 end);
5756 +-#endif
5757 +-
5758 + #ifdef CONFIG_NUMA_EMU
5759 + void __init numa_emulation(struct numa_meminfo *numa_meminfo,
5760 + int numa_dist_cnt);
5761 +diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
5762 +index 74202c1..7d28c88 100644
5763 +--- a/arch/x86/power/hibernate_32.c
5764 ++++ b/arch/x86/power/hibernate_32.c
5765 +@@ -129,8 +129,6 @@ static int resume_physical_mapping_init(pgd_t *pgd_base)
5766 + }
5767 + }
5768 +
5769 +- resume_map_numa_kva(pgd_base);
5770 +-
5771 + return 0;
5772 + }
5773 +
5774 +diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
5775 +index d69cc6c..67bc7ba 100644
5776 +--- a/arch/x86/xen/spinlock.c
5777 ++++ b/arch/x86/xen/spinlock.c
5778 +@@ -328,7 +328,6 @@ static noinline void xen_spin_unlock_slow(struct xen_spinlock *xl)
5779 + if (per_cpu(lock_spinners, cpu) == xl) {
5780 + ADD_STATS(released_slow_kicked, 1);
5781 + xen_send_IPI_one(cpu, XEN_SPIN_UNLOCK_VECTOR);
5782 +- break;
5783 + }
5784 + }
5785 + }
5786 +diff --git a/drivers/base/bus.c b/drivers/base/bus.c
5787 +index 26a06b8..b850cec 100644
5788 +--- a/drivers/base/bus.c
5789 ++++ b/drivers/base/bus.c
5790 +@@ -294,7 +294,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,
5791 + struct device *dev;
5792 + int error = 0;
5793 +
5794 +- if (!bus)
5795 ++ if (!bus || !bus->p)
5796 + return -EINVAL;
5797 +
5798 + klist_iter_init_node(&bus->p->klist_devices, &i,
5799 +@@ -328,7 +328,7 @@ struct device *bus_find_device(struct bus_type *bus,
5800 + struct klist_iter i;
5801 + struct device *dev;
5802 +
5803 +- if (!bus)
5804 ++ if (!bus || !bus->p)
5805 + return NULL;
5806 +
5807 + klist_iter_init_node(&bus->p->klist_devices, &i,
5808 +diff --git a/drivers/base/dd.c b/drivers/base/dd.c
5809 +index 1b1cbb5..97fc774 100644
5810 +--- a/drivers/base/dd.c
5811 ++++ b/drivers/base/dd.c
5812 +@@ -160,6 +160,8 @@ static int deferred_probe_initcall(void)
5813 +
5814 + driver_deferred_probe_enable = true;
5815 + driver_deferred_probe_trigger();
5816 ++ /* Sort as many dependencies as possible before exiting initcalls */
5817 ++ flush_workqueue(deferred_wq);
5818 + return 0;
5819 + }
5820 + late_initcall(deferred_probe_initcall);
5821 +diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
5822 +index 9dcf76a..31dd451 100644
5823 +--- a/drivers/block/sunvdc.c
5824 ++++ b/drivers/block/sunvdc.c
5825 +@@ -461,7 +461,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
5826 + int op_len, err;
5827 + void *req_buf;
5828 +
5829 +- if (!(((u64)1 << ((u64)op - 1)) & port->operations))
5830 ++ if (!(((u64)1 << (u64)op) & port->operations))
5831 + return -EOPNOTSUPP;
5832 +
5833 + switch (op) {
5834 +diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c
5835 +index bc6f5fa..819dfda 100644
5836 +--- a/drivers/dca/dca-core.c
5837 ++++ b/drivers/dca/dca-core.c
5838 +@@ -420,6 +420,11 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
5839 +
5840 + raw_spin_lock_irqsave(&dca_lock, flags);
5841 +
5842 ++ if (list_empty(&dca_domains)) {
5843 ++ raw_spin_unlock_irqrestore(&dca_lock, flags);
5844 ++ return;
5845 ++ }
5846 ++
5847 + list_del(&dca->node);
5848 +
5849 + pci_rc = dca_pci_rc_from_dev(dev);
5850 +diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
5851 +index 4fd363f..c61e672 100644
5852 +--- a/drivers/gpu/drm/drm_crtc.c
5853 ++++ b/drivers/gpu/drm/drm_crtc.c
5854 +@@ -2023,7 +2023,7 @@ uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
5855 +
5856 + switch (bpp) {
5857 + case 8:
5858 +- fmt = DRM_FORMAT_RGB332;
5859 ++ fmt = DRM_FORMAT_C8;
5860 + break;
5861 + case 16:
5862 + if (depth == 15)
5863 +@@ -3409,6 +3409,7 @@ void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
5864 + int *bpp)
5865 + {
5866 + switch (format) {
5867 ++ case DRM_FORMAT_C8:
5868 + case DRM_FORMAT_RGB332:
5869 + case DRM_FORMAT_BGR233:
5870 + *depth = 8;
5871 +diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
5872 +index 9d9835a..384edc6 100644
5873 +--- a/drivers/gpu/drm/drm_edid.c
5874 ++++ b/drivers/gpu/drm/drm_edid.c
5875 +@@ -1769,7 +1769,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
5876 + num_modes += add_cvt_modes(connector, edid);
5877 + num_modes += add_standard_modes(connector, edid);
5878 + num_modes += add_established_modes(connector, edid);
5879 +- num_modes += add_inferred_modes(connector, edid);
5880 ++ if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
5881 ++ num_modes += add_inferred_modes(connector, edid);
5882 + num_modes += add_cea_modes(connector, edid);
5883 +
5884 + if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
5885 +diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c
5886 +index 37c9a52..767782a 100644
5887 +--- a/drivers/gpu/drm/drm_usb.c
5888 ++++ b/drivers/gpu/drm/drm_usb.c
5889 +@@ -18,7 +18,7 @@ int drm_get_usb_dev(struct usb_interface *interface,
5890 +
5891 + usbdev = interface_to_usbdev(interface);
5892 + dev->usbdev = usbdev;
5893 +- dev->dev = &usbdev->dev;
5894 ++ dev->dev = &interface->dev;
5895 +
5896 + mutex_lock(&drm_global_mutex);
5897 +
5898 +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
5899 +index 3c9b9c5..67f6db5 100644
5900 +--- a/drivers/gpu/drm/i915/intel_display.c
5901 ++++ b/drivers/gpu/drm/i915/intel_display.c
5902 +@@ -142,8 +142,8 @@ static const intel_limit_t intel_limits_i9xx_sdvo = {
5903 + .vco = { .min = 1400000, .max = 2800000 },
5904 + .n = { .min = 1, .max = 6 },
5905 + .m = { .min = 70, .max = 120 },
5906 +- .m1 = { .min = 10, .max = 22 },
5907 +- .m2 = { .min = 5, .max = 9 },
5908 ++ .m1 = { .min = 8, .max = 18 },
5909 ++ .m2 = { .min = 3, .max = 7 },
5910 + .p = { .min = 5, .max = 80 },
5911 + .p1 = { .min = 1, .max = 8 },
5912 + .p2 = { .dot_limit = 200000,
5913 +@@ -3303,6 +3303,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
5914 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
5915 + int pipe = intel_crtc->pipe;
5916 + int plane = intel_crtc->plane;
5917 ++ u32 pctl;
5918 +
5919 + if (!intel_crtc->active)
5920 + return;
5921 +@@ -3318,6 +3319,13 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
5922 +
5923 + intel_disable_plane(dev_priv, plane, pipe);
5924 + intel_disable_pipe(dev_priv, pipe);
5925 ++
5926 ++ /* Disable pannel fitter if it is on this pipe. */
5927 ++ pctl = I915_READ(PFIT_CONTROL);
5928 ++ if ((pctl & PFIT_ENABLE) &&
5929 ++ ((pctl & PFIT_PIPE_MASK) >> PFIT_PIPE_SHIFT) == pipe)
5930 ++ I915_WRITE(PFIT_CONTROL, 0);
5931 ++
5932 + intel_disable_pll(dev_priv, pipe);
5933 +
5934 + intel_crtc->active = false;
5935 +diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
5936 +index 15594a3..ebbfbd2 100644
5937 +--- a/drivers/gpu/drm/radeon/atombios_crtc.c
5938 ++++ b/drivers/gpu/drm/radeon/atombios_crtc.c
5939 +@@ -258,8 +258,6 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
5940 + radeon_crtc->enabled = true;
5941 + /* adjust pm to dpms changes BEFORE enabling crtcs */
5942 + radeon_pm_compute_clocks(rdev);
5943 +- if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set)
5944 +- atombios_powergate_crtc(crtc, ATOM_DISABLE);
5945 + atombios_enable_crtc(crtc, ATOM_ENABLE);
5946 + if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev))
5947 + atombios_enable_crtc_memreq(crtc, ATOM_ENABLE);
5948 +@@ -277,8 +275,6 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
5949 + atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
5950 + atombios_enable_crtc(crtc, ATOM_DISABLE);
5951 + radeon_crtc->enabled = false;
5952 +- if (ASIC_IS_DCE6(rdev) && !radeon_crtc->in_mode_set)
5953 +- atombios_powergate_crtc(crtc, ATOM_ENABLE);
5954 + /* adjust pm to dpms changes AFTER disabling crtcs */
5955 + radeon_pm_compute_clocks(rdev);
5956 + break;
5957 +@@ -1670,6 +1666,8 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
5958 + int i;
5959 +
5960 + atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
5961 ++ if (ASIC_IS_DCE6(rdev))
5962 ++ atombios_powergate_crtc(crtc, ATOM_ENABLE);
5963 +
5964 + for (i = 0; i < rdev->num_crtc; i++) {
5965 + if (rdev->mode_info.crtcs[i] &&
5966 +diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
5967 +index e760575..2b8c4fd 100644
5968 +--- a/drivers/gpu/drm/udl/udl_drv.h
5969 ++++ b/drivers/gpu/drm/udl/udl_drv.h
5970 +@@ -74,6 +74,8 @@ struct udl_framebuffer {
5971 + struct drm_framebuffer base;
5972 + struct udl_gem_object *obj;
5973 + bool active_16; /* active on the 16-bit channel */
5974 ++ int x1, y1, x2, y2; /* dirty rect */
5975 ++ spinlock_t dirty_lock;
5976 + };
5977 +
5978 + #define to_udl_fb(x) container_of(x, struct udl_framebuffer, base)
5979 +diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
5980 +index b9282cf..f02d223 100644
5981 +--- a/drivers/gpu/drm/udl/udl_fb.c
5982 ++++ b/drivers/gpu/drm/udl/udl_fb.c
5983 +@@ -22,9 +22,9 @@
5984 +
5985 + #include "drm_fb_helper.h"
5986 +
5987 +-#define DL_DEFIO_WRITE_DELAY 5 /* fb_deferred_io.delay in jiffies */
5988 ++#define DL_DEFIO_WRITE_DELAY (HZ/20) /* fb_deferred_io.delay in jiffies */
5989 +
5990 +-static int fb_defio = 1; /* Optionally enable experimental fb_defio mmap support */
5991 ++static int fb_defio = 0; /* Optionally enable experimental fb_defio mmap support */
5992 + static int fb_bpp = 16;
5993 +
5994 + module_param(fb_bpp, int, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
5995 +@@ -153,6 +153,9 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
5996 + struct urb *urb;
5997 + int aligned_x;
5998 + int bpp = (fb->base.bits_per_pixel / 8);
5999 ++ int x2, y2;
6000 ++ bool store_for_later = false;
6001 ++ unsigned long flags;
6002 +
6003 + if (!fb->active_16)
6004 + return 0;
6005 +@@ -160,8 +163,6 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
6006 + if (!fb->obj->vmapping)
6007 + udl_gem_vmap(fb->obj);
6008 +
6009 +- start_cycles = get_cycles();
6010 +-
6011 + aligned_x = DL_ALIGN_DOWN(x, sizeof(unsigned long));
6012 + width = DL_ALIGN_UP(width + (x-aligned_x), sizeof(unsigned long));
6013 + x = aligned_x;
6014 +@@ -171,19 +172,53 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
6015 + (y + height > fb->base.height))
6016 + return -EINVAL;
6017 +
6018 ++ /* if we are in atomic just store the info
6019 ++ can't test inside spin lock */
6020 ++ if (in_atomic())
6021 ++ store_for_later = true;
6022 ++
6023 ++ x2 = x + width - 1;
6024 ++ y2 = y + height - 1;
6025 ++
6026 ++ spin_lock_irqsave(&fb->dirty_lock, flags);
6027 ++
6028 ++ if (fb->y1 < y)
6029 ++ y = fb->y1;
6030 ++ if (fb->y2 > y2)
6031 ++ y2 = fb->y2;
6032 ++ if (fb->x1 < x)
6033 ++ x = fb->x1;
6034 ++ if (fb->x2 > x2)
6035 ++ x2 = fb->x2;
6036 ++
6037 ++ if (store_for_later) {
6038 ++ fb->x1 = x;
6039 ++ fb->x2 = x2;
6040 ++ fb->y1 = y;
6041 ++ fb->y2 = y2;
6042 ++ spin_unlock_irqrestore(&fb->dirty_lock, flags);
6043 ++ return 0;
6044 ++ }
6045 ++
6046 ++ fb->x1 = fb->y1 = INT_MAX;
6047 ++ fb->x2 = fb->y2 = 0;
6048 ++
6049 ++ spin_unlock_irqrestore(&fb->dirty_lock, flags);
6050 ++ start_cycles = get_cycles();
6051 ++
6052 + urb = udl_get_urb(dev);
6053 + if (!urb)
6054 + return 0;
6055 + cmd = urb->transfer_buffer;
6056 +
6057 +- for (i = y; i < y + height ; i++) {
6058 ++ for (i = y; i <= y2 ; i++) {
6059 + const int line_offset = fb->base.pitches[0] * i;
6060 + const int byte_offset = line_offset + (x * bpp);
6061 + const int dev_byte_offset = (fb->base.width * bpp * i) + (x * bpp);
6062 + if (udl_render_hline(dev, bpp, &urb,
6063 + (char *) fb->obj->vmapping,
6064 + &cmd, byte_offset, dev_byte_offset,
6065 +- width * bpp,
6066 ++ (x2 - x + 1) * bpp,
6067 + &bytes_identical, &bytes_sent))
6068 + goto error;
6069 + }
6070 +@@ -408,6 +443,7 @@ udl_framebuffer_init(struct drm_device *dev,
6071 + {
6072 + int ret;
6073 +
6074 ++ spin_lock_init(&ufb->dirty_lock);
6075 + ufb->obj = obj;
6076 + ret = drm_framebuffer_init(dev, &ufb->base, &udlfb_funcs);
6077 + drm_helper_mode_fill_fb_struct(&ufb->base, mode_cmd);
6078 +diff --git a/drivers/hid/hid-wiimote-ext.c b/drivers/hid/hid-wiimote-ext.c
6079 +index aa95870..9e57285 100644
6080 +--- a/drivers/hid/hid-wiimote-ext.c
6081 ++++ b/drivers/hid/hid-wiimote-ext.c
6082 +@@ -378,14 +378,14 @@ static void handler_nunchuck(struct wiimote_ext *ext, const __u8 *payload)
6083 +
6084 + if (ext->motionp) {
6085 + input_report_key(ext->input,
6086 +- wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x04));
6087 ++ wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x04));
6088 + input_report_key(ext->input,
6089 +- wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x08));
6090 ++ wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x08));
6091 + } else {
6092 + input_report_key(ext->input,
6093 +- wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x01));
6094 ++ wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x01));
6095 + input_report_key(ext->input,
6096 +- wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x02));
6097 ++ wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x02));
6098 + }
6099 +
6100 + input_sync(ext->input);
6101 +diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
6102 +index 5d71873..1711924 100644
6103 +--- a/drivers/iommu/intel-iommu.c
6104 ++++ b/drivers/iommu/intel-iommu.c
6105 +@@ -4212,13 +4212,19 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
6106 + {
6107 + /*
6108 + * Mobile 4 Series Chipset neglects to set RWBF capability,
6109 +- * but needs it:
6110 ++ * but needs it. Same seems to hold for the desktop versions.
6111 + */
6112 + printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
6113 + rwbf_quirk = 1;
6114 + }
6115 +
6116 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
6117 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_rwbf);
6118 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e10, quirk_iommu_rwbf);
6119 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, quirk_iommu_rwbf);
6120 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_rwbf);
6121 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_rwbf);
6122 ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_rwbf);
6123 +
6124 + #define GGC 0x52
6125 + #define GGC_MEMORY_SIZE_MASK (0xf << 8)
6126 +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
6127 +index 8abdaf6..be46052 100644
6128 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c
6129 ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c
6130 +@@ -232,15 +232,18 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)
6131 +
6132 + static u16 esdhc_readw_le(struct sdhci_host *host, int reg)
6133 + {
6134 ++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
6135 ++ struct pltfm_imx_data *imx_data = pltfm_host->priv;
6136 ++
6137 + if (unlikely(reg == SDHCI_HOST_VERSION)) {
6138 +- u16 val = readw(host->ioaddr + (reg ^ 2));
6139 +- /*
6140 +- * uSDHC supports SDHCI v3.0, but it's encoded as value
6141 +- * 0x3 in host controller version register, which violates
6142 +- * SDHCI_SPEC_300 definition. Work it around here.
6143 +- */
6144 +- if ((val & SDHCI_SPEC_VER_MASK) == 3)
6145 +- return --val;
6146 ++ reg ^= 2;
6147 ++ if (is_imx6q_usdhc(imx_data)) {
6148 ++ /*
6149 ++ * The usdhc register returns a wrong host version.
6150 ++ * Correct it here.
6151 ++ */
6152 ++ return SDHCI_SPEC_300;
6153 ++ }
6154 + }
6155 +
6156 + return readw(host->ioaddr + reg);
6157 +diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h
6158 +index 315b96e..9fdd198 100644
6159 +--- a/drivers/net/wireless/b43/dma.h
6160 ++++ b/drivers/net/wireless/b43/dma.h
6161 +@@ -169,7 +169,7 @@ struct b43_dmadesc_generic {
6162 +
6163 + /* DMA engine tuning knobs */
6164 + #define B43_TXRING_SLOTS 256
6165 +-#define B43_RXRING_SLOTS 64
6166 ++#define B43_RXRING_SLOTS 256
6167 + #define B43_DMA0_RX_FW598_BUFSIZE (B43_DMA0_RX_FW598_FO + IEEE80211_MAX_FRAME_LEN)
6168 + #define B43_DMA0_RX_FW351_BUFSIZE (B43_DMA0_RX_FW351_FO + IEEE80211_MAX_FRAME_LEN)
6169 +
6170 +diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
6171 +index be20cf7..af30777 100644
6172 +--- a/drivers/net/wireless/p54/p54usb.c
6173 ++++ b/drivers/net/wireless/p54/p54usb.c
6174 +@@ -84,8 +84,8 @@ static struct usb_device_id p54u_table[] = {
6175 + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
6176 + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
6177 + {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
6178 +- {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
6179 + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
6180 ++ {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */
6181 + {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
6182 + {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
6183 + {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
6184 +diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
6185 +index 61e5768..8cf41bb 100644
6186 +--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
6187 ++++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
6188 +@@ -285,6 +285,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
6189 + {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817f, rtl92cu_hal_cfg)},
6190 + /* RTL8188CUS-VL */
6191 + {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x818a, rtl92cu_hal_cfg)},
6192 ++ {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x819a, rtl92cu_hal_cfg)},
6193 + /* 8188 Combo for BC4 */
6194 + {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)},
6195 +
6196 +diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
6197 +index 17cd028..6ce8484 100644
6198 +--- a/drivers/net/wireless/rtlwifi/usb.c
6199 ++++ b/drivers/net/wireless/rtlwifi/usb.c
6200 +@@ -42,8 +42,12 @@
6201 +
6202 + static void usbctrl_async_callback(struct urb *urb)
6203 + {
6204 +- if (urb)
6205 +- kfree(urb->context);
6206 ++ if (urb) {
6207 ++ /* free dr */
6208 ++ kfree(urb->setup_packet);
6209 ++ /* free databuf */
6210 ++ kfree(urb->transfer_buffer);
6211 ++ }
6212 + }
6213 +
6214 + static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
6215 +@@ -55,39 +59,47 @@ static int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
6216 + u8 reqtype;
6217 + struct usb_ctrlrequest *dr;
6218 + struct urb *urb;
6219 +- struct rtl819x_async_write_data {
6220 +- u8 data[REALTEK_USB_VENQT_MAX_BUF_SIZE];
6221 +- struct usb_ctrlrequest dr;
6222 +- } *buf;
6223 ++ const u16 databuf_maxlen = REALTEK_USB_VENQT_MAX_BUF_SIZE;
6224 ++ u8 *databuf;
6225 ++
6226 ++ if (WARN_ON_ONCE(len > databuf_maxlen))
6227 ++ len = databuf_maxlen;
6228 +
6229 + pipe = usb_sndctrlpipe(udev, 0); /* write_out */
6230 + reqtype = REALTEK_USB_VENQT_WRITE;
6231 +
6232 +- buf = kmalloc(sizeof(*buf), GFP_ATOMIC);
6233 +- if (!buf)
6234 ++ dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
6235 ++ if (!dr)
6236 + return -ENOMEM;
6237 +
6238 ++ databuf = kmalloc(databuf_maxlen, GFP_ATOMIC);
6239 ++ if (!databuf) {
6240 ++ kfree(dr);
6241 ++ return -ENOMEM;
6242 ++ }
6243 ++
6244 + urb = usb_alloc_urb(0, GFP_ATOMIC);
6245 + if (!urb) {
6246 +- kfree(buf);
6247 ++ kfree(databuf);
6248 ++ kfree(dr);
6249 + return -ENOMEM;
6250 + }
6251 +
6252 +- dr = &buf->dr;
6253 +-
6254 + dr->bRequestType = reqtype;
6255 + dr->bRequest = request;
6256 + dr->wValue = cpu_to_le16(value);
6257 + dr->wIndex = cpu_to_le16(index);
6258 + dr->wLength = cpu_to_le16(len);
6259 + /* data are already in little-endian order */
6260 +- memcpy(buf, pdata, len);
6261 ++ memcpy(databuf, pdata, len);
6262 + usb_fill_control_urb(urb, udev, pipe,
6263 +- (unsigned char *)dr, buf, len,
6264 +- usbctrl_async_callback, buf);
6265 ++ (unsigned char *)dr, databuf, len,
6266 ++ usbctrl_async_callback, NULL);
6267 + rc = usb_submit_urb(urb, GFP_ATOMIC);
6268 +- if (rc < 0)
6269 +- kfree(buf);
6270 ++ if (rc < 0) {
6271 ++ kfree(databuf);
6272 ++ kfree(dr);
6273 ++ }
6274 + usb_free_urb(urb);
6275 + return rc;
6276 + }
6277 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
6278 +index b8c5193..221f426 100644
6279 +--- a/drivers/net/xen-netback/interface.c
6280 ++++ b/drivers/net/xen-netback/interface.c
6281 +@@ -132,6 +132,7 @@ static void xenvif_up(struct xenvif *vif)
6282 + static void xenvif_down(struct xenvif *vif)
6283 + {
6284 + disable_irq(vif->irq);
6285 ++ del_timer_sync(&vif->credit_timeout);
6286 + xen_netbk_deschedule_xenvif(vif);
6287 + xen_netbk_remove_xenvif(vif);
6288 + }
6289 +@@ -363,8 +364,6 @@ void xenvif_disconnect(struct xenvif *vif)
6290 + atomic_dec(&vif->refcnt);
6291 + wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0);
6292 +
6293 +- del_timer_sync(&vif->credit_timeout);
6294 +-
6295 + if (vif->irq)
6296 + unbind_from_irqhandler(vif->irq, vif);
6297 +
6298 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
6299 +index e2793d0..2bdf798 100644
6300 +--- a/drivers/net/xen-netback/netback.c
6301 ++++ b/drivers/net/xen-netback/netback.c
6302 +@@ -883,13 +883,13 @@ static int netbk_count_requests(struct xenvif *vif,
6303 + if (frags >= work_to_do) {
6304 + netdev_err(vif->dev, "Need more frags\n");
6305 + netbk_fatal_tx_err(vif);
6306 +- return -frags;
6307 ++ return -ENODATA;
6308 + }
6309 +
6310 + if (unlikely(frags >= MAX_SKB_FRAGS)) {
6311 + netdev_err(vif->dev, "Too many frags\n");
6312 + netbk_fatal_tx_err(vif);
6313 +- return -frags;
6314 ++ return -E2BIG;
6315 + }
6316 +
6317 + memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags),
6318 +@@ -897,7 +897,7 @@ static int netbk_count_requests(struct xenvif *vif,
6319 + if (txp->size > first->size) {
6320 + netdev_err(vif->dev, "Frag is bigger than frame.\n");
6321 + netbk_fatal_tx_err(vif);
6322 +- return -frags;
6323 ++ return -EIO;
6324 + }
6325 +
6326 + first->size -= txp->size;
6327 +@@ -907,7 +907,7 @@ static int netbk_count_requests(struct xenvif *vif,
6328 + netdev_err(vif->dev, "txp->offset: %x, size: %u\n",
6329 + txp->offset, txp->size);
6330 + netbk_fatal_tx_err(vif);
6331 +- return -frags;
6332 ++ return -EINVAL;
6333 + }
6334 + } while ((txp++)->flags & XEN_NETTXF_more_data);
6335 + return frags;
6336 +diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
6337 +index 86e4a1a..6bb02ab 100644
6338 +--- a/drivers/pcmcia/vrc4171_card.c
6339 ++++ b/drivers/pcmcia/vrc4171_card.c
6340 +@@ -246,6 +246,7 @@ static int pccard_init(struct pcmcia_socket *sock)
6341 + socket = &vrc4171_sockets[slot];
6342 + socket->csc_irq = search_nonuse_irq();
6343 + socket->io_irq = search_nonuse_irq();
6344 ++ spin_lock_init(&socket->lock);
6345 +
6346 + return 0;
6347 + }
6348 +diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
6349 +index d74e9ae..f97b2aa 100644
6350 +--- a/drivers/s390/kvm/kvm_virtio.c
6351 ++++ b/drivers/s390/kvm/kvm_virtio.c
6352 +@@ -418,6 +418,26 @@ static void kvm_extint_handler(struct ext_code ext_code,
6353 + }
6354 +
6355 + /*
6356 ++ * For s390-virtio, we expect a page above main storage containing
6357 ++ * the virtio configuration. Try to actually load from this area
6358 ++ * in order to figure out if the host provides this page.
6359 ++ */
6360 ++static int __init test_devices_support(unsigned long addr)
6361 ++{
6362 ++ int ret = -EIO;
6363 ++
6364 ++ asm volatile(
6365 ++ "0: lura 0,%1\n"
6366 ++ "1: xgr %0,%0\n"
6367 ++ "2:\n"
6368 ++ EX_TABLE(0b,2b)
6369 ++ EX_TABLE(1b,2b)
6370 ++ : "+d" (ret)
6371 ++ : "a" (addr)
6372 ++ : "0", "cc");
6373 ++ return ret;
6374 ++}
6375 ++/*
6376 + * Init function for virtio
6377 + * devices are in a single page above top of "normal" mem
6378 + */
6379 +@@ -428,21 +448,23 @@ static int __init kvm_devices_init(void)
6380 + if (!MACHINE_IS_KVM)
6381 + return -ENODEV;
6382 +
6383 ++ if (test_devices_support(real_memory_size) < 0)
6384 ++ return -ENODEV;
6385 ++
6386 ++ rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
6387 ++ if (rc)
6388 ++ return rc;
6389 ++
6390 ++ kvm_devices = (void *) real_memory_size;
6391 ++
6392 + kvm_root = root_device_register("kvm_s390");
6393 + if (IS_ERR(kvm_root)) {
6394 + rc = PTR_ERR(kvm_root);
6395 + printk(KERN_ERR "Could not register kvm_s390 root device");
6396 ++ vmem_remove_mapping(real_memory_size, PAGE_SIZE);
6397 + return rc;
6398 + }
6399 +
6400 +- rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
6401 +- if (rc) {
6402 +- root_device_unregister(kvm_root);
6403 +- return rc;
6404 +- }
6405 +-
6406 +- kvm_devices = (void *) real_memory_size;
6407 +-
6408 + INIT_WORK(&hotplug_work, hotplug_devices);
6409 +
6410 + service_subclass_irq_register();
6411 +diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
6412 +index b67c107..cf67ce5 100644
6413 +--- a/drivers/staging/comedi/comedi_fops.c
6414 ++++ b/drivers/staging/comedi/comedi_fops.c
6415 +@@ -136,6 +136,11 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
6416 + /* Device config is special, because it must work on
6417 + * an unconfigured device. */
6418 + if (cmd == COMEDI_DEVCONFIG) {
6419 ++ if (minor >= COMEDI_NUM_BOARD_MINORS) {
6420 ++ /* Device config not appropriate on non-board minors. */
6421 ++ rc = -ENOTTY;
6422 ++ goto done;
6423 ++ }
6424 + rc = do_devconfig_ioctl(dev,
6425 + (struct comedi_devconfig __user *)arg);
6426 + if (rc == 0)
6427 +diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
6428 +index c612ab5..f759352 100644
6429 +--- a/drivers/staging/vt6656/usbpipe.c
6430 ++++ b/drivers/staging/vt6656/usbpipe.c
6431 +@@ -168,6 +168,11 @@ int PIPEnsControlOut(
6432 + if (pDevice->Flags & fMP_CONTROL_WRITES)
6433 + return STATUS_FAILURE;
6434 +
6435 ++ if (pDevice->Flags & fMP_CONTROL_READS)
6436 ++ return STATUS_FAILURE;
6437 ++
6438 ++ MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
6439 ++
6440 + pDevice->sUsbCtlRequest.bRequestType = 0x40;
6441 + pDevice->sUsbCtlRequest.bRequest = byRequest;
6442 + pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
6443 +@@ -182,12 +187,13 @@ int PIPEnsControlOut(
6444 +
6445 + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
6446 + if (ntStatus != 0) {
6447 +- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus);
6448 ++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
6449 ++ "control send request submission failed: %d\n",
6450 ++ ntStatus);
6451 ++ MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
6452 + return STATUS_FAILURE;
6453 + }
6454 +- else {
6455 +- MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
6456 +- }
6457 ++
6458 + spin_unlock_irq(&pDevice->lock);
6459 + for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
6460 +
6461 +@@ -227,6 +233,11 @@ int PIPEnsControlIn(
6462 + if (pDevice->Flags & fMP_CONTROL_READS)
6463 + return STATUS_FAILURE;
6464 +
6465 ++ if (pDevice->Flags & fMP_CONTROL_WRITES)
6466 ++ return STATUS_FAILURE;
6467 ++
6468 ++ MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
6469 ++
6470 + pDevice->sUsbCtlRequest.bRequestType = 0xC0;
6471 + pDevice->sUsbCtlRequest.bRequest = byRequest;
6472 + pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
6473 +@@ -240,10 +251,11 @@ int PIPEnsControlIn(
6474 +
6475 + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
6476 + if (ntStatus != 0) {
6477 +- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus);
6478 +- }else {
6479 +- MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
6480 +- }
6481 ++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
6482 ++ "control request submission failed: %d\n", ntStatus);
6483 ++ MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
6484 ++ return STATUS_FAILURE;
6485 ++ }
6486 +
6487 + spin_unlock_irq(&pDevice->lock);
6488 + for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
6489 +diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
6490 +index 26c62f0..4ecf9d6 100644
6491 +--- a/drivers/target/target_core_device.c
6492 ++++ b/drivers/target/target_core_device.c
6493 +@@ -1230,6 +1230,8 @@ int se_dev_set_max_sectors(struct se_device *dev, u32 max_sectors)
6494 +
6495 + int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
6496 + {
6497 ++ int block_size = dev->se_sub_dev->se_dev_attrib.block_size;
6498 ++
6499 + if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
6500 + pr_err("dev[%p]: Unable to change SE Device"
6501 + " fabric_max_sectors while dev_export_obj: %d count exists\n",
6502 +@@ -1267,8 +1269,12 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
6503 + /*
6504 + * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()
6505 + */
6506 ++ if (!block_size) {
6507 ++ block_size = 512;
6508 ++ pr_warn("Defaulting to 512 for zero block_size\n");
6509 ++ }
6510 + fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors,
6511 +- dev->se_sub_dev->se_dev_attrib.block_size);
6512 ++ block_size);
6513 +
6514 + dev->se_sub_dev->se_dev_attrib.fabric_max_sectors = fabric_max_sectors;
6515 + pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
6516 +diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
6517 +index 90dff82..4a418e4 100644
6518 +--- a/drivers/tty/n_gsm.c
6519 ++++ b/drivers/tty/n_gsm.c
6520 +@@ -1692,6 +1692,8 @@ static inline void dlci_put(struct gsm_dlci *dlci)
6521 + kref_put(&dlci->ref, gsm_dlci_free);
6522 + }
6523 +
6524 ++static void gsm_destroy_network(struct gsm_dlci *dlci);
6525 ++
6526 + /**
6527 + * gsm_dlci_release - release DLCI
6528 + * @dlci: DLCI to destroy
6529 +@@ -1705,9 +1707,19 @@ static void gsm_dlci_release(struct gsm_dlci *dlci)
6530 + {
6531 + struct tty_struct *tty = tty_port_tty_get(&dlci->port);
6532 + if (tty) {
6533 ++ mutex_lock(&dlci->mutex);
6534 ++ gsm_destroy_network(dlci);
6535 ++ mutex_unlock(&dlci->mutex);
6536 ++
6537 ++ /* tty_vhangup needs the tty_lock, so unlock and
6538 ++ relock after doing the hangup. */
6539 ++ tty_unlock();
6540 + tty_vhangup(tty);
6541 ++ tty_lock();
6542 ++ tty_port_tty_set(&dlci->port, NULL);
6543 + tty_kref_put(tty);
6544 + }
6545 ++ dlci->state = DLCI_CLOSED;
6546 + dlci_put(dlci);
6547 + }
6548 +
6549 +@@ -2933,6 +2945,8 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
6550 +
6551 + if (dlci == NULL)
6552 + return;
6553 ++ if (dlci->state == DLCI_CLOSED)
6554 ++ return;
6555 + mutex_lock(&dlci->mutex);
6556 + gsm_destroy_network(dlci);
6557 + mutex_unlock(&dlci->mutex);
6558 +@@ -2951,6 +2965,8 @@ out:
6559 + static void gsmtty_hangup(struct tty_struct *tty)
6560 + {
6561 + struct gsm_dlci *dlci = tty->driver_data;
6562 ++ if (dlci->state == DLCI_CLOSED)
6563 ++ return;
6564 + tty_port_hangup(&dlci->port);
6565 + gsm_dlci_begin_close(dlci);
6566 + }
6567 +@@ -2958,9 +2974,12 @@ static void gsmtty_hangup(struct tty_struct *tty)
6568 + static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
6569 + int len)
6570 + {
6571 ++ int sent;
6572 + struct gsm_dlci *dlci = tty->driver_data;
6573 ++ if (dlci->state == DLCI_CLOSED)
6574 ++ return -EINVAL;
6575 + /* Stuff the bytes into the fifo queue */
6576 +- int sent = kfifo_in_locked(dlci->fifo, buf, len, &dlci->lock);
6577 ++ sent = kfifo_in_locked(dlci->fifo, buf, len, &dlci->lock);
6578 + /* Need to kick the channel */
6579 + gsm_dlci_data_kick(dlci);
6580 + return sent;
6581 +@@ -2969,18 +2988,24 @@ static int gsmtty_write(struct tty_struct *tty, const unsigned char *buf,
6582 + static int gsmtty_write_room(struct tty_struct *tty)
6583 + {
6584 + struct gsm_dlci *dlci = tty->driver_data;
6585 ++ if (dlci->state == DLCI_CLOSED)
6586 ++ return -EINVAL;
6587 + return TX_SIZE - kfifo_len(dlci->fifo);
6588 + }
6589 +
6590 + static int gsmtty_chars_in_buffer(struct tty_struct *tty)
6591 + {
6592 + struct gsm_dlci *dlci = tty->driver_data;
6593 ++ if (dlci->state == DLCI_CLOSED)
6594 ++ return -EINVAL;
6595 + return kfifo_len(dlci->fifo);
6596 + }
6597 +
6598 + static void gsmtty_flush_buffer(struct tty_struct *tty)
6599 + {
6600 + struct gsm_dlci *dlci = tty->driver_data;
6601 ++ if (dlci->state == DLCI_CLOSED)
6602 ++ return;
6603 + /* Caution needed: If we implement reliable transport classes
6604 + then the data being transmitted can't simply be junked once
6605 + it has first hit the stack. Until then we can just blow it
6606 +@@ -2999,6 +3024,8 @@ static void gsmtty_wait_until_sent(struct tty_struct *tty, int timeout)
6607 + static int gsmtty_tiocmget(struct tty_struct *tty)
6608 + {
6609 + struct gsm_dlci *dlci = tty->driver_data;
6610 ++ if (dlci->state == DLCI_CLOSED)
6611 ++ return -EINVAL;
6612 + return dlci->modem_rx;
6613 + }
6614 +
6615 +@@ -3008,6 +3035,8 @@ static int gsmtty_tiocmset(struct tty_struct *tty,
6616 + struct gsm_dlci *dlci = tty->driver_data;
6617 + unsigned int modem_tx = dlci->modem_tx;
6618 +
6619 ++ if (dlci->state == DLCI_CLOSED)
6620 ++ return -EINVAL;
6621 + modem_tx &= ~clear;
6622 + modem_tx |= set;
6623 +
6624 +@@ -3026,6 +3055,8 @@ static int gsmtty_ioctl(struct tty_struct *tty,
6625 + struct gsm_netconfig nc;
6626 + int index;
6627 +
6628 ++ if (dlci->state == DLCI_CLOSED)
6629 ++ return -EINVAL;
6630 + switch (cmd) {
6631 + case GSMIOC_ENABLE_NET:
6632 + if (copy_from_user(&nc, (void __user *)arg, sizeof(nc)))
6633 +@@ -3052,6 +3083,9 @@ static int gsmtty_ioctl(struct tty_struct *tty,
6634 +
6635 + static void gsmtty_set_termios(struct tty_struct *tty, struct ktermios *old)
6636 + {
6637 ++ struct gsm_dlci *dlci = tty->driver_data;
6638 ++ if (dlci->state == DLCI_CLOSED)
6639 ++ return;
6640 + /* For the moment its fixed. In actual fact the speed information
6641 + for the virtual channel can be propogated in both directions by
6642 + the RPN control message. This however rapidly gets nasty as we
6643 +@@ -3063,6 +3097,8 @@ static void gsmtty_set_termios(struct tty_struct *tty, struct ktermios *old)
6644 + static void gsmtty_throttle(struct tty_struct *tty)
6645 + {
6646 + struct gsm_dlci *dlci = tty->driver_data;
6647 ++ if (dlci->state == DLCI_CLOSED)
6648 ++ return;
6649 + if (tty->termios->c_cflag & CRTSCTS)
6650 + dlci->modem_tx &= ~TIOCM_DTR;
6651 + dlci->throttled = 1;
6652 +@@ -3073,6 +3109,8 @@ static void gsmtty_throttle(struct tty_struct *tty)
6653 + static void gsmtty_unthrottle(struct tty_struct *tty)
6654 + {
6655 + struct gsm_dlci *dlci = tty->driver_data;
6656 ++ if (dlci->state == DLCI_CLOSED)
6657 ++ return;
6658 + if (tty->termios->c_cflag & CRTSCTS)
6659 + dlci->modem_tx |= TIOCM_DTR;
6660 + dlci->throttled = 0;
6661 +@@ -3084,6 +3122,8 @@ static int gsmtty_break_ctl(struct tty_struct *tty, int state)
6662 + {
6663 + struct gsm_dlci *dlci = tty->driver_data;
6664 + int encode = 0; /* Off */
6665 ++ if (dlci->state == DLCI_CLOSED)
6666 ++ return -EINVAL;
6667 +
6668 + if (state == -1) /* "On indefinitely" - we can't encode this
6669 + properly */
6670 +diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
6671 +index a1b9a2f..f8d03da 100644
6672 +--- a/drivers/tty/tty_ioctl.c
6673 ++++ b/drivers/tty/tty_ioctl.c
6674 +@@ -617,7 +617,7 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt)
6675 + if (opt & TERMIOS_WAIT) {
6676 + tty_wait_until_sent(tty, 0);
6677 + if (signal_pending(current))
6678 +- return -EINTR;
6679 ++ return -ERESTARTSYS;
6680 + }
6681 +
6682 + tty_set_termios(tty, &tmp_termios);
6683 +@@ -684,7 +684,7 @@ static int set_termiox(struct tty_struct *tty, void __user *arg, int opt)
6684 + if (opt & TERMIOS_WAIT) {
6685 + tty_wait_until_sent(tty, 0);
6686 + if (signal_pending(current))
6687 +- return -EINTR;
6688 ++ return -ERESTARTSYS;
6689 + }
6690 +
6691 + mutex_lock(&tty->termios_mutex);
6692 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
6693 +index 18d06be..268294c 100644
6694 +--- a/drivers/tty/vt/vt.c
6695 ++++ b/drivers/tty/vt/vt.c
6696 +@@ -656,7 +656,7 @@ static inline void save_screen(struct vc_data *vc)
6697 + * Redrawing of screen
6698 + */
6699 +
6700 +-static void clear_buffer_attributes(struct vc_data *vc)
6701 ++void clear_buffer_attributes(struct vc_data *vc)
6702 + {
6703 + unsigned short *p = (unsigned short *)vc->vc_origin;
6704 + int count = vc->vc_screenbuf_size / 2;
6705 +@@ -3017,7 +3017,7 @@ int __init vty_init(const struct file_operations *console_fops)
6706 +
6707 + static struct class *vtconsole_class;
6708 +
6709 +-static int bind_con_driver(const struct consw *csw, int first, int last,
6710 ++static int do_bind_con_driver(const struct consw *csw, int first, int last,
6711 + int deflt)
6712 + {
6713 + struct module *owner = csw->owner;
6714 +@@ -3028,7 +3028,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
6715 + if (!try_module_get(owner))
6716 + return -ENODEV;
6717 +
6718 +- console_lock();
6719 ++ WARN_CONSOLE_UNLOCKED();
6720 +
6721 + /* check if driver is registered */
6722 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
6723 +@@ -3113,11 +3113,22 @@ static int bind_con_driver(const struct consw *csw, int first, int last,
6724 +
6725 + retval = 0;
6726 + err:
6727 +- console_unlock();
6728 + module_put(owner);
6729 + return retval;
6730 + };
6731 +
6732 ++
6733 ++static int bind_con_driver(const struct consw *csw, int first, int last,
6734 ++ int deflt)
6735 ++{
6736 ++ int ret;
6737 ++
6738 ++ console_lock();
6739 ++ ret = do_bind_con_driver(csw, first, last, deflt);
6740 ++ console_unlock();
6741 ++ return ret;
6742 ++}
6743 ++
6744 + #ifdef CONFIG_VT_HW_CONSOLE_BINDING
6745 + static int con_is_graphics(const struct consw *csw, int first, int last)
6746 + {
6747 +@@ -3154,6 +3165,18 @@ static int con_is_graphics(const struct consw *csw, int first, int last)
6748 + */
6749 + int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6750 + {
6751 ++ int retval;
6752 ++
6753 ++ console_lock();
6754 ++ retval = do_unbind_con_driver(csw, first, last, deflt);
6755 ++ console_unlock();
6756 ++ return retval;
6757 ++}
6758 ++EXPORT_SYMBOL(unbind_con_driver);
6759 ++
6760 ++/* unlocked version of unbind_con_driver() */
6761 ++int do_unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6762 ++{
6763 + struct module *owner = csw->owner;
6764 + const struct consw *defcsw = NULL;
6765 + struct con_driver *con_driver = NULL, *con_back = NULL;
6766 +@@ -3162,7 +3185,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6767 + if (!try_module_get(owner))
6768 + return -ENODEV;
6769 +
6770 +- console_lock();
6771 ++ WARN_CONSOLE_UNLOCKED();
6772 +
6773 + /* check if driver is registered and if it is unbindable */
6774 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
6775 +@@ -3175,10 +3198,8 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6776 + }
6777 + }
6778 +
6779 +- if (retval) {
6780 +- console_unlock();
6781 ++ if (retval)
6782 + goto err;
6783 +- }
6784 +
6785 + retval = -ENODEV;
6786 +
6787 +@@ -3194,15 +3215,11 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6788 + }
6789 + }
6790 +
6791 +- if (retval) {
6792 +- console_unlock();
6793 ++ if (retval)
6794 + goto err;
6795 +- }
6796 +
6797 +- if (!con_is_bound(csw)) {
6798 +- console_unlock();
6799 ++ if (!con_is_bound(csw))
6800 + goto err;
6801 +- }
6802 +
6803 + first = max(first, con_driver->first);
6804 + last = min(last, con_driver->last);
6805 +@@ -3229,15 +3246,14 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt)
6806 + if (!con_is_bound(csw))
6807 + con_driver->flag &= ~CON_DRIVER_FLAG_INIT;
6808 +
6809 +- console_unlock();
6810 + /* ignore return value, binding should not fail */
6811 +- bind_con_driver(defcsw, first, last, deflt);
6812 ++ do_bind_con_driver(defcsw, first, last, deflt);
6813 + err:
6814 + module_put(owner);
6815 + return retval;
6816 +
6817 + }
6818 +-EXPORT_SYMBOL(unbind_con_driver);
6819 ++EXPORT_SYMBOL_GPL(do_unbind_con_driver);
6820 +
6821 + static int vt_bind(struct con_driver *con)
6822 + {
6823 +@@ -3522,28 +3538,18 @@ int con_debug_leave(void)
6824 + }
6825 + EXPORT_SYMBOL_GPL(con_debug_leave);
6826 +
6827 +-/**
6828 +- * register_con_driver - register console driver to console layer
6829 +- * @csw: console driver
6830 +- * @first: the first console to take over, minimum value is 0
6831 +- * @last: the last console to take over, maximum value is MAX_NR_CONSOLES -1
6832 +- *
6833 +- * DESCRIPTION: This function registers a console driver which can later
6834 +- * bind to a range of consoles specified by @first and @last. It will
6835 +- * also initialize the console driver by calling con_startup().
6836 +- */
6837 +-int register_con_driver(const struct consw *csw, int first, int last)
6838 ++static int do_register_con_driver(const struct consw *csw, int first, int last)
6839 + {
6840 + struct module *owner = csw->owner;
6841 + struct con_driver *con_driver;
6842 + const char *desc;
6843 + int i, retval = 0;
6844 +
6845 ++ WARN_CONSOLE_UNLOCKED();
6846 ++
6847 + if (!try_module_get(owner))
6848 + return -ENODEV;
6849 +
6850 +- console_lock();
6851 +-
6852 + for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
6853 + con_driver = &registered_con_driver[i];
6854 +
6855 +@@ -3596,10 +3602,29 @@ int register_con_driver(const struct consw *csw, int first, int last)
6856 + }
6857 +
6858 + err:
6859 +- console_unlock();
6860 + module_put(owner);
6861 + return retval;
6862 + }
6863 ++
6864 ++/**
6865 ++ * register_con_driver - register console driver to console layer
6866 ++ * @csw: console driver
6867 ++ * @first: the first console to take over, minimum value is 0
6868 ++ * @last: the last console to take over, maximum value is MAX_NR_CONSOLES -1
6869 ++ *
6870 ++ * DESCRIPTION: This function registers a console driver which can later
6871 ++ * bind to a range of consoles specified by @first and @last. It will
6872 ++ * also initialize the console driver by calling con_startup().
6873 ++ */
6874 ++int register_con_driver(const struct consw *csw, int first, int last)
6875 ++{
6876 ++ int retval;
6877 ++
6878 ++ console_lock();
6879 ++ retval = do_register_con_driver(csw, first, last);
6880 ++ console_unlock();
6881 ++ return retval;
6882 ++}
6883 + EXPORT_SYMBOL(register_con_driver);
6884 +
6885 + /**
6886 +@@ -3615,9 +3640,18 @@ EXPORT_SYMBOL(register_con_driver);
6887 + */
6888 + int unregister_con_driver(const struct consw *csw)
6889 + {
6890 +- int i, retval = -ENODEV;
6891 ++ int retval;
6892 +
6893 + console_lock();
6894 ++ retval = do_unregister_con_driver(csw);
6895 ++ console_unlock();
6896 ++ return retval;
6897 ++}
6898 ++EXPORT_SYMBOL(unregister_con_driver);
6899 ++
6900 ++int do_unregister_con_driver(const struct consw *csw)
6901 ++{
6902 ++ int i, retval = -ENODEV;
6903 +
6904 + /* cannot unregister a bound driver */
6905 + if (con_is_bound(csw))
6906 +@@ -3643,27 +3677,53 @@ int unregister_con_driver(const struct consw *csw)
6907 + }
6908 + }
6909 + err:
6910 +- console_unlock();
6911 + return retval;
6912 + }
6913 +-EXPORT_SYMBOL(unregister_con_driver);
6914 ++EXPORT_SYMBOL_GPL(do_unregister_con_driver);
6915 +
6916 + /*
6917 + * If we support more console drivers, this function is used
6918 + * when a driver wants to take over some existing consoles
6919 + * and become default driver for newly opened ones.
6920 + *
6921 +- * take_over_console is basically a register followed by unbind
6922 ++ * take_over_console is basically a register followed by unbind
6923 ++ */
6924 ++int do_take_over_console(const struct consw *csw, int first, int last, int deflt)
6925 ++{
6926 ++ int err;
6927 ++
6928 ++ err = do_register_con_driver(csw, first, last);
6929 ++ /*
6930 ++ * If we get an busy error we still want to bind the console driver
6931 ++ * and return success, as we may have unbound the console driver
6932 ++ * but not unregistered it.
6933 ++ */
6934 ++ if (err == -EBUSY)
6935 ++ err = 0;
6936 ++ if (!err)
6937 ++ do_bind_con_driver(csw, first, last, deflt);
6938 ++
6939 ++ return err;
6940 ++}
6941 ++EXPORT_SYMBOL_GPL(do_take_over_console);
6942 ++
6943 ++/*
6944 ++ * If we support more console drivers, this function is used
6945 ++ * when a driver wants to take over some existing consoles
6946 ++ * and become default driver for newly opened ones.
6947 ++ *
6948 ++ * take_over_console is basically a register followed by unbind
6949 + */
6950 + int take_over_console(const struct consw *csw, int first, int last, int deflt)
6951 + {
6952 + int err;
6953 +
6954 + err = register_con_driver(csw, first, last);
6955 +- /* if we get an busy error we still want to bind the console driver
6956 ++ /*
6957 ++ * If we get an busy error we still want to bind the console driver
6958 + * and return success, as we may have unbound the console driver
6959 +-  * but not unregistered it.
6960 +- */
6961 ++ * but not unregistered it.
6962 ++ */
6963 + if (err == -EBUSY)
6964 + err = 0;
6965 + if (!err)
6966 +diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
6967 +index e669c6a..12d3f28 100644
6968 +--- a/drivers/usb/host/ehci-omap.c
6969 ++++ b/drivers/usb/host/ehci-omap.c
6970 +@@ -371,7 +371,7 @@ static const struct hc_driver ehci_omap_hc_driver = {
6971 + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
6972 + };
6973 +
6974 +-MODULE_ALIAS("platform:omap-ehci");
6975 ++MODULE_ALIAS("platform:ehci-omap");
6976 + MODULE_AUTHOR("Texas Instruments, Inc.");
6977 + MODULE_AUTHOR("Felipe Balbi <felipe.balbi@×××××.com>");
6978 +
6979 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
6980 +index 7746944..87ef150 100644
6981 +--- a/drivers/usb/serial/ftdi_sio.c
6982 ++++ b/drivers/usb/serial/ftdi_sio.c
6983 +@@ -1919,24 +1919,22 @@ static void ftdi_dtr_rts(struct usb_serial_port *port, int on)
6984 + {
6985 + struct ftdi_private *priv = usb_get_serial_port_data(port);
6986 +
6987 +- mutex_lock(&port->serial->disc_mutex);
6988 +- if (!port->serial->disconnected) {
6989 +- /* Disable flow control */
6990 +- if (!on && usb_control_msg(port->serial->dev,
6991 ++ /* Disable flow control */
6992 ++ if (!on) {
6993 ++ if (usb_control_msg(port->serial->dev,
6994 + usb_sndctrlpipe(port->serial->dev, 0),
6995 + FTDI_SIO_SET_FLOW_CTRL_REQUEST,
6996 + FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
6997 + 0, priv->interface, NULL, 0,
6998 + WDR_TIMEOUT) < 0) {
6999 +- dev_err(&port->dev, "error from flowcontrol urb\n");
7000 ++ dev_err(&port->dev, "error from flowcontrol urb\n");
7001 + }
7002 +- /* drop RTS and DTR */
7003 +- if (on)
7004 +- set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
7005 +- else
7006 +- clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
7007 + }
7008 +- mutex_unlock(&port->serial->disc_mutex);
7009 ++ /* drop RTS and DTR */
7010 ++ if (on)
7011 ++ set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
7012 ++ else
7013 ++ clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
7014 + }
7015 +
7016 + /*
7017 +diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
7018 +index d0bf56d..933dd07 100644
7019 +--- a/drivers/usb/serial/mct_u232.c
7020 ++++ b/drivers/usb/serial/mct_u232.c
7021 +@@ -514,19 +514,15 @@ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on)
7022 + unsigned int control_state;
7023 + struct mct_u232_private *priv = usb_get_serial_port_data(port);
7024 +
7025 +- mutex_lock(&port->serial->disc_mutex);
7026 +- if (!port->serial->disconnected) {
7027 +- /* drop DTR and RTS */
7028 +- spin_lock_irq(&priv->lock);
7029 +- if (on)
7030 +- priv->control_state |= TIOCM_DTR | TIOCM_RTS;
7031 +- else
7032 +- priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS);
7033 +- control_state = priv->control_state;
7034 +- spin_unlock_irq(&priv->lock);
7035 +- mct_u232_set_modem_ctrl(port->serial, control_state);
7036 +- }
7037 +- mutex_unlock(&port->serial->disc_mutex);
7038 ++ spin_lock_irq(&priv->lock);
7039 ++ if (on)
7040 ++ priv->control_state |= TIOCM_DTR | TIOCM_RTS;
7041 ++ else
7042 ++ priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS);
7043 ++ control_state = priv->control_state;
7044 ++ spin_unlock_irq(&priv->lock);
7045 ++
7046 ++ mct_u232_set_modem_ctrl(port->serial, control_state);
7047 + }
7048 +
7049 + static void mct_u232_close(struct usb_serial_port *port)
7050 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
7051 +index 6c077a1..539247b 100644
7052 +--- a/drivers/usb/serial/option.c
7053 ++++ b/drivers/usb/serial/option.c
7054 +@@ -479,6 +479,7 @@ static const struct option_blacklist_info four_g_w14_blacklist = {
7055 +
7056 + static const struct option_blacklist_info alcatel_x200_blacklist = {
7057 + .sendsetup = BIT(0) | BIT(1),
7058 ++ .reserved = BIT(4),
7059 + };
7060 +
7061 + static const struct option_blacklist_info zte_0037_blacklist = {
7062 +@@ -575,8 +576,14 @@ static const struct usb_device_id option_ids[] = {
7063 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
7064 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) },
7065 + { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) },
7066 ++ { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42),
7067 ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
7068 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) },
7069 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
7070 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
7071 + .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
7072 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) },
7073 ++ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) },
7074 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
7075 + .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
7076 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
7077 +@@ -1215,7 +1222,14 @@ static const struct usb_device_id option_ids[] = {
7078 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
7079 + .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
7080 + },
7081 +- { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) },
7082 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
7083 ++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
7084 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x0052),
7085 ++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
7086 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b6),
7087 ++ .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
7088 ++ { USB_DEVICE(ALCATEL_VENDOR_ID, 0x00b7),
7089 ++ .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
7090 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V),
7091 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
7092 + { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
7093 +diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
7094 +index b622d69..8ec15c2 100644
7095 +--- a/drivers/usb/serial/sierra.c
7096 ++++ b/drivers/usb/serial/sierra.c
7097 +@@ -890,19 +890,13 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
7098 +
7099 + static void sierra_dtr_rts(struct usb_serial_port *port, int on)
7100 + {
7101 +- struct usb_serial *serial = port->serial;
7102 + struct sierra_port_private *portdata;
7103 +
7104 + portdata = usb_get_serial_port_data(port);
7105 + portdata->rts_state = on;
7106 + portdata->dtr_state = on;
7107 +
7108 +- if (serial->dev) {
7109 +- mutex_lock(&serial->disc_mutex);
7110 +- if (!serial->disconnected)
7111 +- sierra_send_setup(port);
7112 +- mutex_unlock(&serial->disc_mutex);
7113 +- }
7114 ++ sierra_send_setup(port);
7115 + }
7116 +
7117 + static int sierra_startup(struct usb_serial *serial)
7118 +diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
7119 +index 3cdc8a5..b8db69d 100644
7120 +--- a/drivers/usb/serial/ssu100.c
7121 ++++ b/drivers/usb/serial/ssu100.c
7122 +@@ -532,19 +532,16 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
7123 +
7124 + dbg("%s\n", __func__);
7125 +
7126 +- mutex_lock(&port->serial->disc_mutex);
7127 +- if (!port->serial->disconnected) {
7128 +- /* Disable flow control */
7129 +- if (!on &&
7130 +- ssu100_setregister(dev, 0, UART_MCR, 0) < 0)
7131 ++ /* Disable flow control */
7132 ++ if (!on) {
7133 ++ if (ssu100_setregister(dev, 0, UART_MCR, 0) < 0)
7134 + dev_err(&port->dev, "error from flowcontrol urb\n");
7135 +- /* drop RTS and DTR */
7136 +- if (on)
7137 +- set_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
7138 +- else
7139 +- clear_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
7140 + }
7141 +- mutex_unlock(&port->serial->disc_mutex);
7142 ++ /* drop RTS and DTR */
7143 ++ if (on)
7144 ++ set_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
7145 ++ else
7146 ++ clear_mctrl(dev, TIOCM_DTR | TIOCM_RTS);
7147 + }
7148 +
7149 + static void ssu100_update_msr(struct usb_serial_port *port, u8 msr)
7150 +diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
7151 +index c627ba2..e4b199c 100644
7152 +--- a/drivers/usb/serial/usb-serial.c
7153 ++++ b/drivers/usb/serial/usb-serial.c
7154 +@@ -699,10 +699,20 @@ static int serial_carrier_raised(struct tty_port *port)
7155 + static void serial_dtr_rts(struct tty_port *port, int on)
7156 + {
7157 + struct usb_serial_port *p = container_of(port, struct usb_serial_port, port);
7158 +- struct usb_serial_driver *drv = p->serial->type;
7159 ++ struct usb_serial *serial = p->serial;
7160 ++ struct usb_serial_driver *drv = serial->type;
7161 +
7162 +- if (drv->dtr_rts)
7163 ++ if (!drv->dtr_rts)
7164 ++ return;
7165 ++ /*
7166 ++ * Work-around bug in the tty-layer which can result in dtr_rts
7167 ++ * being called after a disconnect (and tty_unregister_device
7168 ++ * has returned). Remove once bug has been squashed.
7169 ++ */
7170 ++ mutex_lock(&serial->disc_mutex);
7171 ++ if (!serial->disconnected)
7172 + drv->dtr_rts(p, on);
7173 ++ mutex_unlock(&serial->disc_mutex);
7174 + }
7175 +
7176 + static const struct tty_port_operations serial_port_ops = {
7177 +diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
7178 +index c88657d..820436e 100644
7179 +--- a/drivers/usb/serial/usb_wwan.c
7180 ++++ b/drivers/usb/serial/usb_wwan.c
7181 +@@ -41,7 +41,6 @@ static bool debug;
7182 +
7183 + void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
7184 + {
7185 +- struct usb_serial *serial = port->serial;
7186 + struct usb_wwan_port_private *portdata;
7187 +
7188 + struct usb_wwan_intf_private *intfdata;
7189 +@@ -54,12 +53,11 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
7190 + return;
7191 +
7192 + portdata = usb_get_serial_port_data(port);
7193 +- mutex_lock(&serial->disc_mutex);
7194 ++ /* FIXME: locking */
7195 + portdata->rts_state = on;
7196 + portdata->dtr_state = on;
7197 +- if (serial->dev)
7198 +- intfdata->send_setup(port);
7199 +- mutex_unlock(&serial->disc_mutex);
7200 ++
7201 ++ intfdata->send_setup(port);
7202 + }
7203 + EXPORT_SYMBOL(usb_wwan_dtr_rts);
7204 +
7205 +diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c
7206 +index 16b0bf0..7ab9046 100644
7207 +--- a/drivers/usb/storage/initializers.c
7208 ++++ b/drivers/usb/storage/initializers.c
7209 +@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(struct us_data *us)
7210 + int idProduct;
7211 +
7212 + idesc = &us->pusb_intf->cur_altsetting->desc;
7213 +- idProduct = us->pusb_dev->descriptor.idProduct;
7214 ++ idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
7215 + /* The first port is CDROM,
7216 + * means the dongle in the single port mode,
7217 + * and a switch command is required to be sent. */
7218 +@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data *us)
7219 + int result = 0;
7220 +
7221 + if (usb_stor_huawei_dongles_pid(us)) {
7222 +- if (us->pusb_dev->descriptor.idProduct >= 0x1446)
7223 ++ if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
7224 + result = usb_stor_huawei_scsi_init(us);
7225 + else
7226 + result = usb_stor_huawei_feature_init(us);
7227 +diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h
7228 +index 2c85530..65a6a75 100644
7229 +--- a/drivers/usb/storage/unusual_cypress.h
7230 ++++ b/drivers/usb/storage/unusual_cypress.h
7231 +@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999,
7232 + "Cypress ISD-300LP",
7233 + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
7234 +
7235 +-UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999,
7236 ++UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219,
7237 + "Super Top",
7238 + "USB 2.0 SATA BRIDGE",
7239 + USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
7240 +diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
7241 +index 550dbf0..feda482 100644
7242 +--- a/drivers/video/backlight/adp8860_bl.c
7243 ++++ b/drivers/video/backlight/adp8860_bl.c
7244 +@@ -791,7 +791,7 @@ static int adp8860_i2c_suspend(struct i2c_client *client, pm_message_t message)
7245 +
7246 + static int adp8860_i2c_resume(struct i2c_client *client)
7247 + {
7248 +- adp8860_set_bits(client, ADP8860_MDCR, NSTBY);
7249 ++ adp8860_set_bits(client, ADP8860_MDCR, NSTBY | BLEN);
7250 +
7251 + return 0;
7252 + }
7253 +diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
7254 +index 9be58c6..c7a2c35 100644
7255 +--- a/drivers/video/backlight/adp8870_bl.c
7256 ++++ b/drivers/video/backlight/adp8870_bl.c
7257 +@@ -965,7 +965,7 @@ static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message)
7258 +
7259 + static int adp8870_i2c_resume(struct i2c_client *client)
7260 + {
7261 +- adp8870_set_bits(client, ADP8870_MDCR, NSTBY);
7262 ++ adp8870_set_bits(client, ADP8870_MDCR, NSTBY | BLEN);
7263 +
7264 + return 0;
7265 + }
7266 +diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
7267 +index 88e9204..5bf163e 100644
7268 +--- a/drivers/video/console/fbcon.c
7269 ++++ b/drivers/video/console/fbcon.c
7270 +@@ -529,6 +529,33 @@ static int search_for_mapped_con(void)
7271 + return retval;
7272 + }
7273 +
7274 ++static int do_fbcon_takeover(int show_logo)
7275 ++{
7276 ++ int err, i;
7277 ++
7278 ++ if (!num_registered_fb)
7279 ++ return -ENODEV;
7280 ++
7281 ++ if (!show_logo)
7282 ++ logo_shown = FBCON_LOGO_DONTSHOW;
7283 ++
7284 ++ for (i = first_fb_vc; i <= last_fb_vc; i++)
7285 ++ con2fb_map[i] = info_idx;
7286 ++
7287 ++ err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
7288 ++ fbcon_is_default);
7289 ++
7290 ++ if (err) {
7291 ++ for (i = first_fb_vc; i <= last_fb_vc; i++)
7292 ++ con2fb_map[i] = -1;
7293 ++ info_idx = -1;
7294 ++ } else {
7295 ++ fbcon_has_console_bind = 1;
7296 ++ }
7297 ++
7298 ++ return err;
7299 ++}
7300 ++
7301 + static int fbcon_takeover(int show_logo)
7302 + {
7303 + int err, i;
7304 +@@ -990,7 +1017,7 @@ static const char *fbcon_startup(void)
7305 + }
7306 +
7307 + /* Setup default font */
7308 +- if (!p->fontdata) {
7309 ++ if (!p->fontdata && !vc->vc_font.data) {
7310 + if (!fontname[0] || !(font = find_font(fontname)))
7311 + font = get_default_font(info->var.xres,
7312 + info->var.yres,
7313 +@@ -1000,6 +1027,8 @@ static const char *fbcon_startup(void)
7314 + vc->vc_font.height = font->height;
7315 + vc->vc_font.data = (void *)(p->fontdata = font->data);
7316 + vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */
7317 ++ } else {
7318 ++ p->fontdata = vc->vc_font.data;
7319 + }
7320 +
7321 + cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
7322 +@@ -1159,9 +1188,9 @@ static void fbcon_init(struct vc_data *vc, int init)
7323 + ops->p = &fb_display[fg_console];
7324 + }
7325 +
7326 +-static void fbcon_free_font(struct display *p)
7327 ++static void fbcon_free_font(struct display *p, bool freefont)
7328 + {
7329 +- if (p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0))
7330 ++ if (freefont && p->userfont && p->fontdata && (--REFCOUNT(p->fontdata) == 0))
7331 + kfree(p->fontdata - FONT_EXTRA_WORDS * sizeof(int));
7332 + p->fontdata = NULL;
7333 + p->userfont = 0;
7334 +@@ -1173,8 +1202,8 @@ static void fbcon_deinit(struct vc_data *vc)
7335 + struct fb_info *info;
7336 + struct fbcon_ops *ops;
7337 + int idx;
7338 ++ bool free_font = true;
7339 +
7340 +- fbcon_free_font(p);
7341 + idx = con2fb_map[vc->vc_num];
7342 +
7343 + if (idx == -1)
7344 +@@ -1185,6 +1214,8 @@ static void fbcon_deinit(struct vc_data *vc)
7345 + if (!info)
7346 + goto finished;
7347 +
7348 ++ if (info->flags & FBINFO_MISC_FIRMWARE)
7349 ++ free_font = false;
7350 + ops = info->fbcon_par;
7351 +
7352 + if (!ops)
7353 +@@ -1196,6 +1227,8 @@ static void fbcon_deinit(struct vc_data *vc)
7354 + ops->flags &= ~FBCON_FLAGS_INIT;
7355 + finished:
7356 +
7357 ++ fbcon_free_font(p, free_font);
7358 ++
7359 + if (!con_is_bound(&fb_con))
7360 + fbcon_exit();
7361 +
7362 +@@ -2977,7 +3010,7 @@ static int fbcon_unbind(void)
7363 + {
7364 + int ret;
7365 +
7366 +- ret = unbind_con_driver(&fb_con, first_fb_vc, last_fb_vc,
7367 ++ ret = do_unbind_con_driver(&fb_con, first_fb_vc, last_fb_vc,
7368 + fbcon_is_default);
7369 +
7370 + if (!ret)
7371 +@@ -3050,7 +3083,7 @@ static int fbcon_fb_unregistered(struct fb_info *info)
7372 + primary_device = -1;
7373 +
7374 + if (!num_registered_fb)
7375 +- unregister_con_driver(&fb_con);
7376 ++ do_unregister_con_driver(&fb_con);
7377 +
7378 + return 0;
7379 + }
7380 +@@ -3115,7 +3148,7 @@ static int fbcon_fb_registered(struct fb_info *info)
7381 + }
7382 +
7383 + if (info_idx != -1)
7384 +- ret = fbcon_takeover(1);
7385 ++ ret = do_fbcon_takeover(1);
7386 + } else {
7387 + for (i = first_fb_vc; i <= last_fb_vc; i++) {
7388 + if (con2fb_map_boot[i] == idx)
7389 +diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
7390 +index d449a74..5855d17 100644
7391 +--- a/drivers/video/console/vgacon.c
7392 ++++ b/drivers/video/console/vgacon.c
7393 +@@ -1064,7 +1064,7 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
7394 + unsigned short video_port_status = vga_video_port_reg + 6;
7395 + int font_select = 0x00, beg, i;
7396 + char *charmap;
7397 +-
7398 ++ bool clear_attribs = false;
7399 + if (vga_video_type != VIDEO_TYPE_EGAM) {
7400 + charmap = (char *) VGA_MAP_MEM(colourmap, 0);
7401 + beg = 0x0e;
7402 +@@ -1169,12 +1169,6 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
7403 +
7404 + /* if 512 char mode is already enabled don't re-enable it. */
7405 + if ((set) && (ch512 != vga_512_chars)) {
7406 +- /* attribute controller */
7407 +- for (i = 0; i < MAX_NR_CONSOLES; i++) {
7408 +- struct vc_data *c = vc_cons[i].d;
7409 +- if (c && c->vc_sw == &vga_con)
7410 +- c->vc_hi_font_mask = ch512 ? 0x0800 : 0;
7411 +- }
7412 + vga_512_chars = ch512;
7413 + /* 256-char: enable intensity bit
7414 + 512-char: disable intensity bit */
7415 +@@ -1185,8 +1179,22 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
7416 + it means, but it works, and it appears necessary */
7417 + inb_p(video_port_status);
7418 + vga_wattr(state->vgabase, VGA_AR_ENABLE_DISPLAY, 0);
7419 ++ clear_attribs = true;
7420 + }
7421 + raw_spin_unlock_irq(&vga_lock);
7422 ++
7423 ++ if (clear_attribs) {
7424 ++ for (i = 0; i < MAX_NR_CONSOLES; i++) {
7425 ++ struct vc_data *c = vc_cons[i].d;
7426 ++ if (c && c->vc_sw == &vga_con) {
7427 ++ /* force hi font mask to 0, so we always clear
7428 ++ the bit on either transition */
7429 ++ c->vc_hi_font_mask = 0x00;
7430 ++ clear_buffer_attributes(c);
7431 ++ c->vc_hi_font_mask = ch512 ? 0x0800 : 0;
7432 ++ }
7433 ++ }
7434 ++ }
7435 + return 0;
7436 + }
7437 +
7438 +diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
7439 +index c6ce416..90f1315 100644
7440 +--- a/drivers/video/fbmem.c
7441 ++++ b/drivers/video/fbmem.c
7442 +@@ -1642,7 +1642,9 @@ static int do_register_framebuffer(struct fb_info *fb_info)
7443 + event.info = fb_info;
7444 + if (!lock_fb_info(fb_info))
7445 + return -ENODEV;
7446 ++ console_lock();
7447 + fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
7448 ++ console_unlock();
7449 + unlock_fb_info(fb_info);
7450 + return 0;
7451 + }
7452 +@@ -1658,8 +1660,10 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
7453 +
7454 + if (!lock_fb_info(fb_info))
7455 + return -ENODEV;
7456 ++ console_lock();
7457 + event.info = fb_info;
7458 + ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event);
7459 ++ console_unlock();
7460 + unlock_fb_info(fb_info);
7461 +
7462 + if (ret)
7463 +@@ -1674,7 +1678,9 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
7464 + num_registered_fb--;
7465 + fb_cleanup_device(fb_info);
7466 + event.info = fb_info;
7467 ++ console_lock();
7468 + fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
7469 ++ console_unlock();
7470 +
7471 + /* this may free fb info */
7472 + put_fb_info(fb_info);
7473 +@@ -1845,11 +1851,8 @@ int fb_new_modelist(struct fb_info *info)
7474 + err = 1;
7475 +
7476 + if (!list_empty(&info->modelist)) {
7477 +- if (!lock_fb_info(info))
7478 +- return -ENODEV;
7479 + event.info = info;
7480 + err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
7481 +- unlock_fb_info(info);
7482 + }
7483 +
7484 + return err;
7485 +diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
7486 +index 67afa9c..303fb9f 100644
7487 +--- a/drivers/video/fbsysfs.c
7488 ++++ b/drivers/video/fbsysfs.c
7489 +@@ -175,6 +175,8 @@ static ssize_t store_modes(struct device *device,
7490 + if (i * sizeof(struct fb_videomode) != count)
7491 + return -EINVAL;
7492 +
7493 ++ if (!lock_fb_info(fb_info))
7494 ++ return -ENODEV;
7495 + console_lock();
7496 + list_splice(&fb_info->modelist, &old_list);
7497 + fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
7498 +@@ -186,6 +188,7 @@ static ssize_t store_modes(struct device *device,
7499 + fb_destroy_modelist(&old_list);
7500 +
7501 + console_unlock();
7502 ++ unlock_fb_info(fb_info);
7503 +
7504 + return 0;
7505 + }
7506 +diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
7507 +index 6af3f16..d02a538 100644
7508 +--- a/drivers/video/fsl-diu-fb.c
7509 ++++ b/drivers/video/fsl-diu-fb.c
7510 +@@ -923,7 +923,7 @@ static u32 fsl_diu_get_pixel_format(unsigned int bits_per_pixel)
7511 + #define PF_COMP_0_MASK 0x0000000F
7512 + #define PF_COMP_0_SHIFT 0
7513 +
7514 +-#define MAKE_PF(alpha, red, blue, green, size, c0, c1, c2, c3) \
7515 ++#define MAKE_PF(alpha, red, green, blue, size, c0, c1, c2, c3) \
7516 + cpu_to_le32(PF_BYTE_F | (alpha << PF_ALPHA_C_SHIFT) | \
7517 + (blue << PF_BLUE_C_SHIFT) | (green << PF_GREEN_C_SHIFT) | \
7518 + (red << PF_RED_C_SHIFT) | (c3 << PF_COMP_3_SHIFT) | \
7519 +@@ -933,10 +933,10 @@ static u32 fsl_diu_get_pixel_format(unsigned int bits_per_pixel)
7520 + switch (bits_per_pixel) {
7521 + case 32:
7522 + /* 0x88883316 */
7523 +- return MAKE_PF(3, 2, 0, 1, 3, 8, 8, 8, 8);
7524 ++ return MAKE_PF(3, 2, 1, 0, 3, 8, 8, 8, 8);
7525 + case 24:
7526 + /* 0x88082219 */
7527 +- return MAKE_PF(4, 0, 1, 2, 2, 0, 8, 8, 8);
7528 ++ return MAKE_PF(4, 0, 1, 2, 2, 8, 8, 8, 0);
7529 + case 16:
7530 + /* 0x65053118 */
7531 + return MAKE_PF(4, 2, 1, 0, 1, 5, 6, 5, 0);
7532 +diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
7533 +index b1f60a0..b2db77e 100644
7534 +--- a/drivers/xen/evtchn.c
7535 ++++ b/drivers/xen/evtchn.c
7536 +@@ -269,6 +269,14 @@ static int evtchn_bind_to_user(struct per_user_data *u, int port)
7537 + u->name, (void *)(unsigned long)port);
7538 + if (rc >= 0)
7539 + rc = evtchn_make_refcounted(port);
7540 ++ else {
7541 ++ /* bind failed, should close the port now */
7542 ++ struct evtchn_close close;
7543 ++ close.port = port;
7544 ++ if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
7545 ++ BUG();
7546 ++ set_port_user(port, NULL);
7547 ++ }
7548 +
7549 + return rc;
7550 + }
7551 +@@ -277,6 +285,8 @@ static void evtchn_unbind_from_user(struct per_user_data *u, int port)
7552 + {
7553 + int irq = irq_from_evtchn(port);
7554 +
7555 ++ BUG_ON(irq < 0);
7556 ++
7557 + unbind_from_irqhandler(irq, (void *)(unsigned long)port);
7558 +
7559 + set_port_user(port, NULL);
7560 +diff --git a/fs/block_dev.c b/fs/block_dev.c
7561 +index ba11c30..b3be92c 100644
7562 +--- a/fs/block_dev.c
7563 ++++ b/fs/block_dev.c
7564 +@@ -1047,6 +1047,7 @@ int revalidate_disk(struct gendisk *disk)
7565 +
7566 + mutex_lock(&bdev->bd_mutex);
7567 + check_disk_size_change(disk, bdev);
7568 ++ bdev->bd_invalidated = 0;
7569 + mutex_unlock(&bdev->bd_mutex);
7570 + bdput(bdev);
7571 + return ret;
7572 +diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
7573 +index 8392cb8..a3a0987 100644
7574 +--- a/fs/lockd/clntproc.c
7575 ++++ b/fs/lockd/clntproc.c
7576 +@@ -551,6 +551,9 @@ again:
7577 + status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT);
7578 + if (status < 0)
7579 + break;
7580 ++ /* Resend the blocking lock request after a server reboot */
7581 ++ if (resp->status == nlm_lck_denied_grace_period)
7582 ++ continue;
7583 + if (resp->status != nlm_lck_blocked)
7584 + break;
7585 + }
7586 +diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
7587 +index d16dae2..3a9c247 100644
7588 +--- a/fs/nfs/blocklayout/blocklayout.c
7589 ++++ b/fs/nfs/blocklayout/blocklayout.c
7590 +@@ -1155,6 +1155,7 @@ static const struct nfs_pageio_ops bl_pg_write_ops = {
7591 + static struct pnfs_layoutdriver_type blocklayout_type = {
7592 + .id = LAYOUT_BLOCK_VOLUME,
7593 + .name = "LAYOUT_BLOCK_VOLUME",
7594 ++ .owner = THIS_MODULE,
7595 + .read_pagelist = bl_read_pagelist,
7596 + .write_pagelist = bl_write_pagelist,
7597 + .alloc_layout_hdr = bl_alloc_layout_hdr,
7598 +diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
7599 +index 1afe74c..65538f5 100644
7600 +--- a/fs/nfs/objlayout/objio_osd.c
7601 ++++ b/fs/nfs/objlayout/objio_osd.c
7602 +@@ -589,6 +589,7 @@ static struct pnfs_layoutdriver_type objlayout_type = {
7603 + .flags = PNFS_LAYOUTRET_ON_SETATTR |
7604 + PNFS_LAYOUTRET_ON_ERROR,
7605 +
7606 ++ .owner = THIS_MODULE,
7607 + .alloc_layout_hdr = objlayout_alloc_layout_hdr,
7608 + .free_layout_hdr = objlayout_free_layout_hdr,
7609 +
7610 +diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
7611 +index 8445fbc..6f292dd 100644
7612 +--- a/fs/notify/inotify/inotify_user.c
7613 ++++ b/fs/notify/inotify/inotify_user.c
7614 +@@ -579,8 +579,6 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
7615 +
7616 + /* don't allow invalid bits: we don't want flags set */
7617 + mask = inotify_arg_to_mask(arg);
7618 +- if (unlikely(!(mask & IN_ALL_EVENTS)))
7619 +- return -EINVAL;
7620 +
7621 + fsn_mark = fsnotify_find_inode_mark(group, inode);
7622 + if (!fsn_mark)
7623 +@@ -632,8 +630,6 @@ static int inotify_new_watch(struct fsnotify_group *group,
7624 +
7625 + /* don't allow invalid bits: we don't want flags set */
7626 + mask = inotify_arg_to_mask(arg);
7627 +- if (unlikely(!(mask & IN_ALL_EVENTS)))
7628 +- return -EINVAL;
7629 +
7630 + tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
7631 + if (unlikely(!tmp_i_mark))
7632 +diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
7633 +index 81a4cd2..231eab2 100644
7634 +--- a/fs/ocfs2/dlmglue.c
7635 ++++ b/fs/ocfs2/dlmglue.c
7636 +@@ -2545,6 +2545,7 @@ int ocfs2_super_lock(struct ocfs2_super *osb,
7637 + * everything is up to the caller :) */
7638 + status = ocfs2_should_refresh_lock_res(lockres);
7639 + if (status < 0) {
7640 ++ ocfs2_cluster_unlock(osb, lockres, level);
7641 + mlog_errno(status);
7642 + goto bail;
7643 + }
7644 +@@ -2553,8 +2554,10 @@ int ocfs2_super_lock(struct ocfs2_super *osb,
7645 +
7646 + ocfs2_complete_lock_res_refresh(lockres, status);
7647 +
7648 +- if (status < 0)
7649 ++ if (status < 0) {
7650 ++ ocfs2_cluster_unlock(osb, lockres, level);
7651 + mlog_errno(status);
7652 ++ }
7653 + ocfs2_track_lock_refresh(lockres);
7654 + }
7655 + bail:
7656 +diff --git a/include/linux/console.h b/include/linux/console.h
7657 +index 7201ce4..f59e942 100644
7658 +--- a/include/linux/console.h
7659 ++++ b/include/linux/console.h
7660 +@@ -77,7 +77,9 @@ extern const struct consw prom_con; /* SPARC PROM console */
7661 + int con_is_bound(const struct consw *csw);
7662 + int register_con_driver(const struct consw *csw, int first, int last);
7663 + int unregister_con_driver(const struct consw *csw);
7664 ++int do_unregister_con_driver(const struct consw *csw);
7665 + int take_over_console(const struct consw *sw, int first, int last, int deflt);
7666 ++int do_take_over_console(const struct consw *sw, int first, int last, int deflt);
7667 + void give_up_console(const struct consw *sw);
7668 + #ifdef CONFIG_HW_CONSOLE
7669 + int con_debug_enter(struct vc_data *vc);
7670 +diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
7671 +index 561e130..9b0c614 100644
7672 +--- a/include/linux/if_vlan.h
7673 ++++ b/include/linux/if_vlan.h
7674 +@@ -327,7 +327,7 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
7675 + struct vlan_hdr *vhdr)
7676 + {
7677 + __be16 proto;
7678 +- unsigned char *rawp;
7679 ++ unsigned short *rawp;
7680 +
7681 + /*
7682 + * Was a VLAN packet, grab the encapsulated protocol, which the layer
7683 +@@ -340,8 +340,8 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
7684 + return;
7685 + }
7686 +
7687 +- rawp = skb->data;
7688 +- if (*(unsigned short *) rawp == 0xFFFF)
7689 ++ rawp = (unsigned short *)(vhdr + 1);
7690 ++ if (*rawp == 0xFFFF)
7691 + /*
7692 + * This is a magic hack to spot IPX packets. Older Novell
7693 + * breaks the protocol design and runs IPX over 802.3 without
7694 +diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
7695 +index 1d1b1e1..ee2baf0 100644
7696 +--- a/include/linux/mmu_notifier.h
7697 ++++ b/include/linux/mmu_notifier.h
7698 +@@ -4,6 +4,7 @@
7699 + #include <linux/list.h>
7700 + #include <linux/spinlock.h>
7701 + #include <linux/mm_types.h>
7702 ++#include <linux/srcu.h>
7703 +
7704 + struct mmu_notifier;
7705 + struct mmu_notifier_ops;
7706 +diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
7707 +index a54b825..6f8b026 100644
7708 +--- a/include/linux/usb/audio.h
7709 ++++ b/include/linux/usb/audio.h
7710 +@@ -384,14 +384,16 @@ static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_de
7711 + int protocol)
7712 + {
7713 + __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
7714 +- return desc->baSourceID[desc->bNrInPins + control_size];
7715 ++ return *(uac_processing_unit_bmControls(desc, protocol)
7716 ++ + control_size);
7717 + }
7718 +
7719 + static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
7720 + int protocol)
7721 + {
7722 + __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
7723 +- return &desc->baSourceID[desc->bNrInPins + control_size + 1];
7724 ++ return uac_processing_unit_bmControls(desc, protocol)
7725 ++ + control_size + 1;
7726 + }
7727 +
7728 + /* 4.5.2 Class-Specific AS Interface Descriptor */
7729 +diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
7730 +index e33d77f..57eeb14 100644
7731 +--- a/include/linux/vt_kern.h
7732 ++++ b/include/linux/vt_kern.h
7733 +@@ -47,6 +47,7 @@ int con_set_cmap(unsigned char __user *cmap);
7734 + int con_get_cmap(unsigned char __user *cmap);
7735 + void scrollback(struct vc_data *vc, int lines);
7736 + void scrollfront(struct vc_data *vc, int lines);
7737 ++void clear_buffer_attributes(struct vc_data *vc);
7738 + void update_region(struct vc_data *vc, unsigned long start, int count);
7739 + void redraw_screen(struct vc_data *vc, int is_switch);
7740 + #define update_screen(x) redraw_screen(x, 0)
7741 +@@ -131,6 +132,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
7742 + int vt_waitactive(int n);
7743 + void change_console(struct vc_data *new_vc);
7744 + void reset_vc(struct vc_data *vc);
7745 ++extern int do_unbind_con_driver(const struct consw *csw, int first, int last,
7746 ++ int deflt);
7747 + extern int unbind_con_driver(const struct consw *csw, int first, int last,
7748 + int deflt);
7749 + int vty_init(const struct file_operations *console_fops);
7750 +diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
7751 +index 00cbb43..2da45ce 100644
7752 +--- a/include/net/inet6_hashtables.h
7753 ++++ b/include/net/inet6_hashtables.h
7754 +@@ -28,16 +28,16 @@
7755 +
7756 + struct inet_hashinfo;
7757 +
7758 +-/* I have no idea if this is a good hash for v6 or not. -DaveM */
7759 + static inline unsigned int inet6_ehashfn(struct net *net,
7760 + const struct in6_addr *laddr, const u16 lport,
7761 + const struct in6_addr *faddr, const __be16 fport)
7762 + {
7763 +- u32 ports = (lport ^ (__force u16)fport);
7764 ++ u32 ports = (((u32)lport) << 16) | (__force u32)fport;
7765 +
7766 + return jhash_3words((__force u32)laddr->s6_addr32[3],
7767 +- (__force u32)faddr->s6_addr32[3],
7768 +- ports, inet_ehash_secret + net_hash_mix(net));
7769 ++ ipv6_addr_jhash(faddr),
7770 ++ ports,
7771 ++ inet_ehash_secret + net_hash_mix(net));
7772 + }
7773 +
7774 + static inline int inet6_sk_ehashfn(const struct sock *sk)
7775 +diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
7776 +index ae17e13..8cd2e1d 100644
7777 +--- a/include/net/inet_sock.h
7778 ++++ b/include/net/inet_sock.h
7779 +@@ -202,6 +202,7 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
7780 + extern int inet_sk_rebuild_header(struct sock *sk);
7781 +
7782 + extern u32 inet_ehash_secret;
7783 ++extern u32 ipv6_hash_secret;
7784 + extern void build_ehash_secret(void);
7785 +
7786 + static inline unsigned int inet_ehashfn(struct net *net,
7787 +diff --git a/include/net/ipv6.h b/include/net/ipv6.h
7788 +index e4170a2..12a1bd2 100644
7789 +--- a/include/net/ipv6.h
7790 ++++ b/include/net/ipv6.h
7791 +@@ -15,6 +15,7 @@
7792 +
7793 + #include <linux/ipv6.h>
7794 + #include <linux/hardirq.h>
7795 ++#include <linux/jhash.h>
7796 + #include <net/if_inet6.h>
7797 + #include <net/ndisc.h>
7798 + #include <net/flow.h>
7799 +@@ -390,6 +391,17 @@ struct ip6_create_arg {
7800 + void ip6_frag_init(struct inet_frag_queue *q, void *a);
7801 + int ip6_frag_match(struct inet_frag_queue *q, void *a);
7802 +
7803 ++/* more secured version of ipv6_addr_hash() */
7804 ++static inline u32 ipv6_addr_jhash(const struct in6_addr *a)
7805 ++{
7806 ++ u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1];
7807 ++
7808 ++ return jhash_3words(v,
7809 ++ (__force u32)a->s6_addr32[2],
7810 ++ (__force u32)a->s6_addr32[3],
7811 ++ ipv6_hash_secret);
7812 ++}
7813 ++
7814 + static inline int ipv6_addr_any(const struct in6_addr *a)
7815 + {
7816 + return (a->s6_addr32[0] | a->s6_addr32[1] |
7817 +diff --git a/include/net/sock.h b/include/net/sock.h
7818 +index 5878118..59a8947 100644
7819 +--- a/include/net/sock.h
7820 ++++ b/include/net/sock.h
7821 +@@ -944,7 +944,7 @@ static inline void sk_refcnt_debug_dec(struct sock *sk)
7822 + sk->sk_prot->name, sk, atomic_read(&sk->sk_prot->socks));
7823 + }
7824 +
7825 +-inline void sk_refcnt_debug_release(const struct sock *sk)
7826 ++static inline void sk_refcnt_debug_release(const struct sock *sk)
7827 + {
7828 + if (atomic_read(&sk->sk_refcnt) != 1)
7829 + printk(KERN_DEBUG "Destruction of the %s socket %p delayed, refcnt=%d\n",
7830 +diff --git a/kernel/futex.c b/kernel/futex.c
7831 +index 19eb089..8879430 100644
7832 +--- a/kernel/futex.c
7833 ++++ b/kernel/futex.c
7834 +@@ -2471,8 +2471,6 @@ SYSCALL_DEFINE3(get_robust_list, int, pid,
7835 + if (!futex_cmpxchg_enabled)
7836 + return -ENOSYS;
7837 +
7838 +- WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");
7839 +-
7840 + rcu_read_lock();
7841 +
7842 + ret = -ESRCH;
7843 +diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
7844 +index 83e368b..a9642d5 100644
7845 +--- a/kernel/futex_compat.c
7846 ++++ b/kernel/futex_compat.c
7847 +@@ -142,8 +142,6 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
7848 + if (!futex_cmpxchg_enabled)
7849 + return -ENOSYS;
7850 +
7851 +- WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n");
7852 +-
7853 + rcu_read_lock();
7854 +
7855 + ret = -ESRCH;
7856 +diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
7857 +index 6db7a5e..cdd5607 100644
7858 +--- a/kernel/hrtimer.c
7859 ++++ b/kernel/hrtimer.c
7860 +@@ -640,21 +640,9 @@ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base)
7861 + * and expiry check is done in the hrtimer_interrupt or in the softirq.
7862 + */
7863 + static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
7864 +- struct hrtimer_clock_base *base,
7865 +- int wakeup)
7866 ++ struct hrtimer_clock_base *base)
7867 + {
7868 +- if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) {
7869 +- if (wakeup) {
7870 +- raw_spin_unlock(&base->cpu_base->lock);
7871 +- raise_softirq_irqoff(HRTIMER_SOFTIRQ);
7872 +- raw_spin_lock(&base->cpu_base->lock);
7873 +- } else
7874 +- __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
7875 +-
7876 +- return 1;
7877 +- }
7878 +-
7879 +- return 0;
7880 ++ return base->cpu_base->hres_active && hrtimer_reprogram(timer, base);
7881 + }
7882 +
7883 + static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
7884 +@@ -735,8 +723,7 @@ static inline int hrtimer_switch_to_hres(void) { return 0; }
7885 + static inline void
7886 + hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { }
7887 + static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
7888 +- struct hrtimer_clock_base *base,
7889 +- int wakeup)
7890 ++ struct hrtimer_clock_base *base)
7891 + {
7892 + return 0;
7893 + }
7894 +@@ -995,8 +982,21 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
7895 + *
7896 + * XXX send_remote_softirq() ?
7897 + */
7898 +- if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases))
7899 +- hrtimer_enqueue_reprogram(timer, new_base, wakeup);
7900 ++ if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)
7901 ++ && hrtimer_enqueue_reprogram(timer, new_base)) {
7902 ++ if (wakeup) {
7903 ++ /*
7904 ++ * We need to drop cpu_base->lock to avoid a
7905 ++ * lock ordering issue vs. rq->lock.
7906 ++ */
7907 ++ raw_spin_unlock(&new_base->cpu_base->lock);
7908 ++ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
7909 ++ local_irq_restore(flags);
7910 ++ return ret;
7911 ++ } else {
7912 ++ __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
7913 ++ }
7914 ++ }
7915 +
7916 + unlock_hrtimer_base(timer, &flags);
7917 +
7918 +diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
7919 +index 611cd60..7b5f012 100644
7920 +--- a/kernel/irq/spurious.c
7921 ++++ b/kernel/irq/spurious.c
7922 +@@ -80,13 +80,11 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
7923 +
7924 + /*
7925 + * All handlers must agree on IRQF_SHARED, so we test just the
7926 +- * first. Check for action->next as well.
7927 ++ * first.
7928 + */
7929 + action = desc->action;
7930 + if (!action || !(action->flags & IRQF_SHARED) ||
7931 +- (action->flags & __IRQF_TIMER) ||
7932 +- (action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
7933 +- !action->next)
7934 ++ (action->flags & __IRQF_TIMER))
7935 + goto out;
7936 +
7937 + /* Already running on another processor */
7938 +@@ -104,6 +102,7 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
7939 + do {
7940 + if (handle_irq_event(desc) == IRQ_HANDLED)
7941 + ret = IRQ_HANDLED;
7942 ++ /* Make sure that there is still a valid action */
7943 + action = desc->action;
7944 + } while ((desc->istate & IRQS_PENDING) && action);
7945 + desc->istate &= ~IRQS_POLL_INPROGRESS;
7946 +diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
7947 +index 125cb67..acbb79c 100644
7948 +--- a/kernel/posix-cpu-timers.c
7949 ++++ b/kernel/posix-cpu-timers.c
7950 +@@ -1422,8 +1422,10 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
7951 + while (!signal_pending(current)) {
7952 + if (timer.it.cpu.expires.sched == 0) {
7953 + /*
7954 +- * Our timer fired and was reset.
7955 ++ * Our timer fired and was reset, below
7956 ++ * deletion can not fail.
7957 + */
7958 ++ posix_cpu_timer_del(&timer);
7959 + spin_unlock_irq(&timer.it_lock);
7960 + return 0;
7961 + }
7962 +@@ -1441,9 +1443,26 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
7963 + * We were interrupted by a signal.
7964 + */
7965 + sample_to_timespec(which_clock, timer.it.cpu.expires, rqtp);
7966 +- posix_cpu_timer_set(&timer, 0, &zero_it, it);
7967 ++ error = posix_cpu_timer_set(&timer, 0, &zero_it, it);
7968 ++ if (!error) {
7969 ++ /*
7970 ++ * Timer is now unarmed, deletion can not fail.
7971 ++ */
7972 ++ posix_cpu_timer_del(&timer);
7973 ++ }
7974 + spin_unlock_irq(&timer.it_lock);
7975 +
7976 ++ while (error == TIMER_RETRY) {
7977 ++ /*
7978 ++ * We need to handle case when timer was or is in the
7979 ++ * middle of firing. In other cases we already freed
7980 ++ * resources.
7981 ++ */
7982 ++ spin_lock_irq(&timer.it_lock);
7983 ++ error = posix_cpu_timer_del(&timer);
7984 ++ spin_unlock_irq(&timer.it_lock);
7985 ++ }
7986 ++
7987 + if ((it->it_value.tv_sec | it->it_value.tv_nsec) == 0) {
7988 + /*
7989 + * It actually did fire already.
7990 +diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
7991 +index eb51d76..3f42652 100644
7992 +--- a/kernel/timeconst.pl
7993 ++++ b/kernel/timeconst.pl
7994 +@@ -369,10 +369,8 @@ if ($hz eq '--can') {
7995 + die "Usage: $0 HZ\n";
7996 + }
7997 +
7998 +- @val = @{$canned_values{$hz}};
7999 +- if (!defined(@val)) {
8000 +- @val = compute_values($hz);
8001 +- }
8002 ++ $cv = $canned_values{$hz};
8003 ++ @val = defined($cv) ? @$cv : compute_values($hz);
8004 + output($hz, @val);
8005 + }
8006 + exit 0;
8007 +diff --git a/mm/fadvise.c b/mm/fadvise.c
8008 +index 469491e0..dcb9872 100644
8009 +--- a/mm/fadvise.c
8010 ++++ b/mm/fadvise.c
8011 +@@ -17,6 +17,7 @@
8012 + #include <linux/fadvise.h>
8013 + #include <linux/writeback.h>
8014 + #include <linux/syscalls.h>
8015 ++#include <linux/swap.h>
8016 +
8017 + #include <asm/unistd.h>
8018 +
8019 +@@ -124,9 +125,22 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
8020 + start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
8021 + end_index = (endbyte >> PAGE_CACHE_SHIFT);
8022 +
8023 +- if (end_index >= start_index)
8024 +- invalidate_mapping_pages(mapping, start_index,
8025 ++ if (end_index >= start_index) {
8026 ++ unsigned long count = invalidate_mapping_pages(mapping,
8027 ++ start_index, end_index);
8028 ++
8029 ++ /*
8030 ++ * If fewer pages were invalidated than expected then
8031 ++ * it is possible that some of the pages were on
8032 ++ * a per-cpu pagevec for a remote CPU. Drain all
8033 ++ * pagevecs and try again.
8034 ++ */
8035 ++ if (count < (end_index - start_index + 1)) {
8036 ++ lru_add_drain_all();
8037 ++ invalidate_mapping_pages(mapping, start_index,
8038 + end_index);
8039 ++ }
8040 ++ }
8041 + break;
8042 + default:
8043 + ret = -EINVAL;
8044 +diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
8045 +index 862b608..8d1ca2d 100644
8046 +--- a/mm/mmu_notifier.c
8047 ++++ b/mm/mmu_notifier.c
8048 +@@ -14,10 +14,14 @@
8049 + #include <linux/export.h>
8050 + #include <linux/mm.h>
8051 + #include <linux/err.h>
8052 ++#include <linux/srcu.h>
8053 + #include <linux/rcupdate.h>
8054 + #include <linux/sched.h>
8055 + #include <linux/slab.h>
8056 +
8057 ++/* global SRCU for all MMs */
8058 ++static struct srcu_struct srcu;
8059 ++
8060 + /*
8061 + * This function can't run concurrently against mmu_notifier_register
8062 + * because mm->mm_users > 0 during mmu_notifier_register and exit_mmap
8063 +@@ -25,58 +29,61 @@
8064 + * in parallel despite there being no task using this mm any more,
8065 + * through the vmas outside of the exit_mmap context, such as with
8066 + * vmtruncate. This serializes against mmu_notifier_unregister with
8067 +- * the mmu_notifier_mm->lock in addition to RCU and it serializes
8068 +- * against the other mmu notifiers with RCU. struct mmu_notifier_mm
8069 ++ * the mmu_notifier_mm->lock in addition to SRCU and it serializes
8070 ++ * against the other mmu notifiers with SRCU. struct mmu_notifier_mm
8071 + * can't go away from under us as exit_mmap holds an mm_count pin
8072 + * itself.
8073 + */
8074 + void __mmu_notifier_release(struct mm_struct *mm)
8075 + {
8076 + struct mmu_notifier *mn;
8077 +- struct hlist_node *n;
8078 ++ int id;
8079 +
8080 + /*
8081 +- * RCU here will block mmu_notifier_unregister until
8082 +- * ->release returns.
8083 ++ * srcu_read_lock() here will block synchronize_srcu() in
8084 ++ * mmu_notifier_unregister() until all registered
8085 ++ * ->release() callouts this function makes have
8086 ++ * returned.
8087 + */
8088 +- rcu_read_lock();
8089 +- hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist)
8090 +- /*
8091 +- * if ->release runs before mmu_notifier_unregister it
8092 +- * must be handled as it's the only way for the driver
8093 +- * to flush all existing sptes and stop the driver
8094 +- * from establishing any more sptes before all the
8095 +- * pages in the mm are freed.
8096 +- */
8097 +- if (mn->ops->release)
8098 +- mn->ops->release(mn, mm);
8099 +- rcu_read_unlock();
8100 +-
8101 ++ id = srcu_read_lock(&srcu);
8102 + spin_lock(&mm->mmu_notifier_mm->lock);
8103 + while (unlikely(!hlist_empty(&mm->mmu_notifier_mm->list))) {
8104 + mn = hlist_entry(mm->mmu_notifier_mm->list.first,
8105 + struct mmu_notifier,
8106 + hlist);
8107 ++
8108 + /*
8109 +- * We arrived before mmu_notifier_unregister so
8110 +- * mmu_notifier_unregister will do nothing other than
8111 +- * to wait ->release to finish and
8112 +- * mmu_notifier_unregister to return.
8113 ++ * Unlink. This will prevent mmu_notifier_unregister()
8114 ++ * from also making the ->release() callout.
8115 + */
8116 + hlist_del_init_rcu(&mn->hlist);
8117 ++ spin_unlock(&mm->mmu_notifier_mm->lock);
8118 ++
8119 ++ /*
8120 ++ * Clear sptes. (see 'release' description in mmu_notifier.h)
8121 ++ */
8122 ++ if (mn->ops->release)
8123 ++ mn->ops->release(mn, mm);
8124 ++
8125 ++ spin_lock(&mm->mmu_notifier_mm->lock);
8126 + }
8127 + spin_unlock(&mm->mmu_notifier_mm->lock);
8128 +
8129 + /*
8130 +- * synchronize_rcu here prevents mmu_notifier_release to
8131 +- * return to exit_mmap (which would proceed freeing all pages
8132 +- * in the mm) until the ->release method returns, if it was
8133 +- * invoked by mmu_notifier_unregister.
8134 +- *
8135 +- * The mmu_notifier_mm can't go away from under us because one
8136 +- * mm_count is hold by exit_mmap.
8137 ++ * All callouts to ->release() which we have done are complete.
8138 ++ * Allow synchronize_srcu() in mmu_notifier_unregister() to complete
8139 ++ */
8140 ++ srcu_read_unlock(&srcu, id);
8141 ++
8142 ++ /*
8143 ++ * mmu_notifier_unregister() may have unlinked a notifier and may
8144 ++ * still be calling out to it. Additionally, other notifiers
8145 ++ * may have been active via vmtruncate() et. al. Block here
8146 ++ * to ensure that all notifier callouts for this mm have been
8147 ++ * completed and the sptes are really cleaned up before returning
8148 ++ * to exit_mmap().
8149 + */
8150 +- synchronize_rcu();
8151 ++ synchronize_srcu(&srcu);
8152 + }
8153 +
8154 + /*
8155 +@@ -89,14 +96,14 @@ int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
8156 + {
8157 + struct mmu_notifier *mn;
8158 + struct hlist_node *n;
8159 +- int young = 0;
8160 ++ int young = 0, id;
8161 +
8162 +- rcu_read_lock();
8163 ++ id = srcu_read_lock(&srcu);
8164 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8165 + if (mn->ops->clear_flush_young)
8166 + young |= mn->ops->clear_flush_young(mn, mm, address);
8167 + }
8168 +- rcu_read_unlock();
8169 ++ srcu_read_unlock(&srcu, id);
8170 +
8171 + return young;
8172 + }
8173 +@@ -106,9 +113,9 @@ int __mmu_notifier_test_young(struct mm_struct *mm,
8174 + {
8175 + struct mmu_notifier *mn;
8176 + struct hlist_node *n;
8177 +- int young = 0;
8178 ++ int young = 0, id;
8179 +
8180 +- rcu_read_lock();
8181 ++ id = srcu_read_lock(&srcu);
8182 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8183 + if (mn->ops->test_young) {
8184 + young = mn->ops->test_young(mn, mm, address);
8185 +@@ -116,7 +123,7 @@ int __mmu_notifier_test_young(struct mm_struct *mm,
8186 + break;
8187 + }
8188 + }
8189 +- rcu_read_unlock();
8190 ++ srcu_read_unlock(&srcu, id);
8191 +
8192 + return young;
8193 + }
8194 +@@ -126,8 +133,9 @@ void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
8195 + {
8196 + struct mmu_notifier *mn;
8197 + struct hlist_node *n;
8198 ++ int id;
8199 +
8200 +- rcu_read_lock();
8201 ++ id = srcu_read_lock(&srcu);
8202 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8203 + if (mn->ops->change_pte)
8204 + mn->ops->change_pte(mn, mm, address, pte);
8205 +@@ -138,7 +146,7 @@ void __mmu_notifier_change_pte(struct mm_struct *mm, unsigned long address,
8206 + else if (mn->ops->invalidate_page)
8207 + mn->ops->invalidate_page(mn, mm, address);
8208 + }
8209 +- rcu_read_unlock();
8210 ++ srcu_read_unlock(&srcu, id);
8211 + }
8212 +
8213 + void __mmu_notifier_invalidate_page(struct mm_struct *mm,
8214 +@@ -146,13 +154,14 @@ void __mmu_notifier_invalidate_page(struct mm_struct *mm,
8215 + {
8216 + struct mmu_notifier *mn;
8217 + struct hlist_node *n;
8218 ++ int id;
8219 +
8220 +- rcu_read_lock();
8221 ++ id = srcu_read_lock(&srcu);
8222 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8223 + if (mn->ops->invalidate_page)
8224 + mn->ops->invalidate_page(mn, mm, address);
8225 + }
8226 +- rcu_read_unlock();
8227 ++ srcu_read_unlock(&srcu, id);
8228 + }
8229 +
8230 + void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
8231 +@@ -160,13 +169,14 @@ void __mmu_notifier_invalidate_range_start(struct mm_struct *mm,
8232 + {
8233 + struct mmu_notifier *mn;
8234 + struct hlist_node *n;
8235 ++ int id;
8236 +
8237 +- rcu_read_lock();
8238 ++ id = srcu_read_lock(&srcu);
8239 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8240 + if (mn->ops->invalidate_range_start)
8241 + mn->ops->invalidate_range_start(mn, mm, start, end);
8242 + }
8243 +- rcu_read_unlock();
8244 ++ srcu_read_unlock(&srcu, id);
8245 + }
8246 +
8247 + void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
8248 +@@ -174,13 +184,14 @@ void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
8249 + {
8250 + struct mmu_notifier *mn;
8251 + struct hlist_node *n;
8252 ++ int id;
8253 +
8254 +- rcu_read_lock();
8255 ++ id = srcu_read_lock(&srcu);
8256 + hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist) {
8257 + if (mn->ops->invalidate_range_end)
8258 + mn->ops->invalidate_range_end(mn, mm, start, end);
8259 + }
8260 +- rcu_read_unlock();
8261 ++ srcu_read_unlock(&srcu, id);
8262 + }
8263 +
8264 + static int do_mmu_notifier_register(struct mmu_notifier *mn,
8265 +@@ -192,6 +203,12 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
8266 +
8267 + BUG_ON(atomic_read(&mm->mm_users) <= 0);
8268 +
8269 ++ /*
8270 ++ * Verify that mmu_notifier_init() already run and the global srcu is
8271 ++ * initialized.
8272 ++ */
8273 ++ BUG_ON(!srcu.per_cpu_ref);
8274 ++
8275 + ret = -ENOMEM;
8276 + mmu_notifier_mm = kmalloc(sizeof(struct mmu_notifier_mm), GFP_KERNEL);
8277 + if (unlikely(!mmu_notifier_mm))
8278 +@@ -274,8 +291,8 @@ void __mmu_notifier_mm_destroy(struct mm_struct *mm)
8279 + /*
8280 + * This releases the mm_count pin automatically and frees the mm
8281 + * structure if it was the last user of it. It serializes against
8282 +- * running mmu notifiers with RCU and against mmu_notifier_unregister
8283 +- * with the unregister lock + RCU. All sptes must be dropped before
8284 ++ * running mmu notifiers with SRCU and against mmu_notifier_unregister
8285 ++ * with the unregister lock + SRCU. All sptes must be dropped before
8286 + * calling mmu_notifier_unregister. ->release or any other notifier
8287 + * method may be invoked concurrently with mmu_notifier_unregister,
8288 + * and only after mmu_notifier_unregister returned we're guaranteed
8289 +@@ -285,35 +302,43 @@ void mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm)
8290 + {
8291 + BUG_ON(atomic_read(&mm->mm_count) <= 0);
8292 +
8293 ++ spin_lock(&mm->mmu_notifier_mm->lock);
8294 + if (!hlist_unhashed(&mn->hlist)) {
8295 +- /*
8296 +- * RCU here will force exit_mmap to wait ->release to finish
8297 +- * before freeing the pages.
8298 +- */
8299 +- rcu_read_lock();
8300 ++ int id;
8301 +
8302 + /*
8303 +- * exit_mmap will block in mmu_notifier_release to
8304 +- * guarantee ->release is called before freeing the
8305 +- * pages.
8306 ++ * Ensure we synchronize up with __mmu_notifier_release().
8307 + */
8308 ++ id = srcu_read_lock(&srcu);
8309 ++
8310 ++ hlist_del_rcu(&mn->hlist);
8311 ++ spin_unlock(&mm->mmu_notifier_mm->lock);
8312 ++
8313 + if (mn->ops->release)
8314 + mn->ops->release(mn, mm);
8315 +- rcu_read_unlock();
8316 +
8317 +- spin_lock(&mm->mmu_notifier_mm->lock);
8318 +- hlist_del_rcu(&mn->hlist);
8319 ++ /*
8320 ++ * Allow __mmu_notifier_release() to complete.
8321 ++ */
8322 ++ srcu_read_unlock(&srcu, id);
8323 ++ } else
8324 + spin_unlock(&mm->mmu_notifier_mm->lock);
8325 +- }
8326 +
8327 + /*
8328 +- * Wait any running method to finish, of course including
8329 +- * ->release if it was run by mmu_notifier_relase instead of us.
8330 ++ * Wait for any running method to finish, including ->release() if it
8331 ++ * was run by __mmu_notifier_release() instead of us.
8332 + */
8333 +- synchronize_rcu();
8334 ++ synchronize_srcu(&srcu);
8335 +
8336 + BUG_ON(atomic_read(&mm->mm_count) <= 0);
8337 +
8338 + mmdrop(mm);
8339 + }
8340 + EXPORT_SYMBOL_GPL(mmu_notifier_unregister);
8341 ++
8342 ++static int __init mmu_notifier_init(void)
8343 ++{
8344 ++ return init_srcu_struct(&srcu);
8345 ++}
8346 ++
8347 ++module_init(mmu_notifier_init);
8348 +diff --git a/mm/page_alloc.c b/mm/page_alloc.c
8349 +index 691b8ec..533ea80 100644
8350 +--- a/mm/page_alloc.c
8351 ++++ b/mm/page_alloc.c
8352 +@@ -4216,10 +4216,11 @@ static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
8353 + * round what is now in bits to nearest long in bits, then return it in
8354 + * bytes.
8355 + */
8356 +-static unsigned long __init usemap_size(unsigned long zonesize)
8357 ++static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned long zonesize)
8358 + {
8359 + unsigned long usemapsize;
8360 +
8361 ++ zonesize += zone_start_pfn & (pageblock_nr_pages-1);
8362 + usemapsize = roundup(zonesize, pageblock_nr_pages);
8363 + usemapsize = usemapsize >> pageblock_order;
8364 + usemapsize *= NR_PAGEBLOCK_BITS;
8365 +@@ -4229,17 +4230,19 @@ static unsigned long __init usemap_size(unsigned long zonesize)
8366 + }
8367 +
8368 + static void __init setup_usemap(struct pglist_data *pgdat,
8369 +- struct zone *zone, unsigned long zonesize)
8370 ++ struct zone *zone,
8371 ++ unsigned long zone_start_pfn,
8372 ++ unsigned long zonesize)
8373 + {
8374 +- unsigned long usemapsize = usemap_size(zonesize);
8375 ++ unsigned long usemapsize = usemap_size(zone_start_pfn, zonesize);
8376 + zone->pageblock_flags = NULL;
8377 + if (usemapsize)
8378 + zone->pageblock_flags = alloc_bootmem_node_nopanic(pgdat,
8379 + usemapsize);
8380 + }
8381 + #else
8382 +-static inline void setup_usemap(struct pglist_data *pgdat,
8383 +- struct zone *zone, unsigned long zonesize) {}
8384 ++static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone,
8385 ++ unsigned long zone_start_pfn, unsigned long zonesize) {}
8386 + #endif /* CONFIG_SPARSEMEM */
8387 +
8388 + #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
8389 +@@ -4367,7 +4370,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
8390 + continue;
8391 +
8392 + set_pageblock_order(pageblock_default_order());
8393 +- setup_usemap(pgdat, zone, size);
8394 ++ setup_usemap(pgdat, zone, zone_start_pfn, size);
8395 + ret = init_currently_empty_zone(zone, zone_start_pfn,
8396 + size, MEMMAP_EARLY);
8397 + BUG_ON(ret);
8398 +diff --git a/mm/shmem.c b/mm/shmem.c
8399 +index a409bd8..58c4a47 100644
8400 +--- a/mm/shmem.c
8401 ++++ b/mm/shmem.c
8402 +@@ -2177,6 +2177,7 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
8403 + unsigned long inodes;
8404 + int error = -EINVAL;
8405 +
8406 ++ config.mpol = NULL;
8407 + if (shmem_parse_options(data, &config, true))
8408 + return error;
8409 +
8410 +@@ -2201,8 +2202,13 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
8411 + sbinfo->max_inodes = config.max_inodes;
8412 + sbinfo->free_inodes = config.max_inodes - inodes;
8413 +
8414 +- mpol_put(sbinfo->mpol);
8415 +- sbinfo->mpol = config.mpol; /* transfers initial ref */
8416 ++ /*
8417 ++ * Preserve previous mempolicy unless mpol remount option was specified.
8418 ++ */
8419 ++ if (config.mpol) {
8420 ++ mpol_put(sbinfo->mpol);
8421 ++ sbinfo->mpol = config.mpol; /* transfers initial ref */
8422 ++ }
8423 + out:
8424 + spin_unlock(&sbinfo->stat_lock);
8425 + return error;
8426 +diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
8427 +index e16aade..718cbe8 100644
8428 +--- a/net/bridge/br_stp_bpdu.c
8429 ++++ b/net/bridge/br_stp_bpdu.c
8430 +@@ -16,6 +16,7 @@
8431 + #include <linux/etherdevice.h>
8432 + #include <linux/llc.h>
8433 + #include <linux/slab.h>
8434 ++#include <linux/pkt_sched.h>
8435 + #include <net/net_namespace.h>
8436 + #include <net/llc.h>
8437 + #include <net/llc_pdu.h>
8438 +@@ -40,6 +41,7 @@ static void br_send_bpdu(struct net_bridge_port *p,
8439 +
8440 + skb->dev = p->dev;
8441 + skb->protocol = htons(ETH_P_802_2);
8442 ++ skb->priority = TC_PRIO_CONTROL;
8443 +
8444 + skb_reserve(skb, LLC_RESERVE);
8445 + memcpy(__skb_put(skb, length), data, length);
8446 +diff --git a/net/core/datagram.c b/net/core/datagram.c
8447 +index e4fbfd6..da7e0c8 100644
8448 +--- a/net/core/datagram.c
8449 ++++ b/net/core/datagram.c
8450 +@@ -187,7 +187,7 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
8451 + skb_queue_walk(queue, skb) {
8452 + *peeked = skb->peeked;
8453 + if (flags & MSG_PEEK) {
8454 +- if (*off >= skb->len) {
8455 ++ if (*off >= skb->len && skb->len) {
8456 + *off -= skb->len;
8457 + continue;
8458 + }
8459 +diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
8460 +index b9868e1..aa74be4 100644
8461 +--- a/net/core/sock_diag.c
8462 ++++ b/net/core/sock_diag.c
8463 +@@ -126,6 +126,9 @@ static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
8464 + if (nlmsg_len(nlh) < sizeof(*req))
8465 + return -EINVAL;
8466 +
8467 ++ if (req->sdiag_family >= AF_MAX)
8468 ++ return -EINVAL;
8469 ++
8470 + hndl = sock_diag_lock_handler(req->sdiag_family);
8471 + if (hndl == NULL)
8472 + err = -ENOENT;
8473 +diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
8474 +index 10e3751..78ec298 100644
8475 +--- a/net/ipv4/af_inet.c
8476 ++++ b/net/ipv4/af_inet.c
8477 +@@ -227,8 +227,12 @@ EXPORT_SYMBOL(inet_listen);
8478 + u32 inet_ehash_secret __read_mostly;
8479 + EXPORT_SYMBOL(inet_ehash_secret);
8480 +
8481 ++u32 ipv6_hash_secret __read_mostly;
8482 ++EXPORT_SYMBOL(ipv6_hash_secret);
8483 ++
8484 + /*
8485 +- * inet_ehash_secret must be set exactly once
8486 ++ * inet_ehash_secret must be set exactly once, and to a non nul value
8487 ++ * ipv6_hash_secret must be set exactly once.
8488 + */
8489 + void build_ehash_secret(void)
8490 + {
8491 +@@ -238,7 +242,8 @@ void build_ehash_secret(void)
8492 + get_random_bytes(&rnd, sizeof(rnd));
8493 + } while (rnd == 0);
8494 +
8495 +- cmpxchg(&inet_ehash_secret, 0, rnd);
8496 ++ if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0)
8497 ++ get_random_bytes(&ipv6_hash_secret, sizeof(ipv6_hash_secret));
8498 + }
8499 + EXPORT_SYMBOL(build_ehash_secret);
8500 +
8501 +diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
8502 +index 50009c7..c234bda 100644
8503 +--- a/net/ipv4/ping.c
8504 ++++ b/net/ipv4/ping.c
8505 +@@ -321,8 +321,8 @@ void ping_err(struct sk_buff *skb, u32 info)
8506 + struct iphdr *iph = (struct iphdr *)skb->data;
8507 + struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2));
8508 + struct inet_sock *inet_sock;
8509 +- int type = icmph->type;
8510 +- int code = icmph->code;
8511 ++ int type = icmp_hdr(skb)->type;
8512 ++ int code = icmp_hdr(skb)->code;
8513 + struct net *net = dev_net(skb->dev);
8514 + struct sock *sk;
8515 + int harderr;
8516 +diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
8517 +index bdd6164..131fd1f 100644
8518 +--- a/sound/pci/ali5451/ali5451.c
8519 ++++ b/sound/pci/ali5451/ali5451.c
8520 +@@ -1435,7 +1435,7 @@ static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream)
8521 +
8522 + spin_lock(&codec->reg_lock);
8523 + if (!pvoice->running) {
8524 +- spin_unlock_irq(&codec->reg_lock);
8525 ++ spin_unlock(&codec->reg_lock);
8526 + return 0;
8527 + }
8528 + outb(pvoice->number, ALI_REG(codec, ALI_GC_CIR));
8529 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
8530 +index d1b805a..02a6e3f 100644
8531 +--- a/sound/pci/hda/patch_hdmi.c
8532 ++++ b/sound/pci/hda/patch_hdmi.c
8533 +@@ -924,8 +924,12 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
8534 + if (!static_hdmi_pcm && eld->eld_valid) {
8535 + snd_hdmi_eld_update_pcm_info(eld, hinfo);
8536 + if (hinfo->channels_min > hinfo->channels_max ||
8537 +- !hinfo->rates || !hinfo->formats)
8538 ++ !hinfo->rates || !hinfo->formats) {
8539 ++ per_cvt->assigned = 0;
8540 ++ hinfo->nid = 0;
8541 ++ snd_hda_spdif_ctls_unassign(codec, pin_idx);
8542 + return -ENODEV;
8543 ++ }
8544 + }
8545 +
8546 + /* Store the updated parameters */
8547 +@@ -989,6 +993,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
8548 + "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
8549 + codec->addr, pin_nid, eld->monitor_present, eld_valid);
8550 +
8551 ++ eld->eld_valid = false;
8552 + if (eld_valid) {
8553 + if (!snd_hdmi_get_eld(eld, codec, pin_nid))
8554 + snd_hdmi_show_eld(eld);
8555 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
8556 +index f7f8776..adb97d6 100644
8557 +--- a/sound/pci/hda/patch_realtek.c
8558 ++++ b/sound/pci/hda/patch_realtek.c
8559 +@@ -5440,6 +5440,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8560 + SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
8561 + SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
8562 + SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
8563 ++ SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
8564 +
8565 + /* All Apple entries are in codec SSIDs */
8566 + SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
8567 +diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
8568 +index b4819d5..64da910 100644
8569 +--- a/sound/pci/rme32.c
8570 ++++ b/sound/pci/rme32.c
8571 +@@ -1017,7 +1017,7 @@ static int snd_rme32_capture_close(struct snd_pcm_substream *substream)
8572 + spin_lock_irq(&rme32->lock);
8573 + rme32->capture_substream = NULL;
8574 + rme32->capture_periodsize = 0;
8575 +- spin_unlock(&rme32->lock);
8576 ++ spin_unlock_irq(&rme32->lock);
8577 + return 0;
8578 + }
8579 +
8580 +diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c
8581 +index 8e0cf14..9932aac 100644
8582 +--- a/sound/soc/codecs/wm2200.c
8583 ++++ b/sound/soc/codecs/wm2200.c
8584 +@@ -990,9 +990,9 @@ SOC_DOUBLE_R_TLV("IN3 Volume", WM2200_IN3L_CONTROL, WM2200_IN3R_CONTROL,
8585 +
8586 + SOC_DOUBLE_R("IN1 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
8587 + WM2200_ADC_DIGITAL_VOLUME_1R, WM2200_IN1L_MUTE_SHIFT, 1, 1),
8588 +-SOC_DOUBLE_R("IN2 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
8589 ++SOC_DOUBLE_R("IN2 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_2L,
8590 + WM2200_ADC_DIGITAL_VOLUME_2R, WM2200_IN2L_MUTE_SHIFT, 1, 1),
8591 +-SOC_DOUBLE_R("IN3 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
8592 ++SOC_DOUBLE_R("IN3 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_3L,
8593 + WM2200_ADC_DIGITAL_VOLUME_3R, WM2200_IN3L_MUTE_SHIFT, 1, 1),
8594 +
8595 + SOC_DOUBLE_R_TLV("IN1 Digital Volume", WM2200_ADC_DIGITAL_VOLUME_1L,
8596 +diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
8597 +index 63128cd..fa4c2f7 100644
8598 +--- a/sound/usb/quirks-table.h
8599 ++++ b/sound/usb/quirks-table.h
8600 +@@ -1658,7 +1658,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
8601 + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
8602 + /* .vendor_name = "Roland", */
8603 + /* .product_name = "A-PRO", */
8604 +- .ifnum = 1,
8605 ++ .ifnum = 0,
8606 + .type = QUIRK_MIDI_FIXED_ENDPOINT,
8607 + .data = & (const struct snd_usb_midi_endpoint_info) {
8608 + .out_cables = 0x0003,