Magellan Linux

Annotation of /trunk/kernel-magellan/patches-3.1.5-r1/0102-3.1.3-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1599 - (hide annotations) (download)
Mon Dec 12 13:47:29 2011 UTC (12 years, 5 months ago) by niro
File size: 68580 byte(s)
3.1.5-magellan-r1, updated to linux-3.1.5
1 niro 1599 diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
2     index 742b610..fed957a 100644
3     --- a/arch/arm/kernel/head.S
4     +++ b/arch/arm/kernel/head.S
5     @@ -356,7 +356,7 @@ __secondary_data:
6     * r13 = *virtual* address to jump to upon completion
7     */
8     __enable_mmu:
9     -#ifdef CONFIG_ALIGNMENT_TRAP
10     +#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
11     orr r0, r0, #CR_A
12     #else
13     bic r0, r0, #CR_A
14     diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
15     index 00ff00d..123d72a 100644
16     --- a/arch/s390/include/asm/kvm_host.h
17     +++ b/arch/s390/include/asm/kvm_host.h
18     @@ -47,7 +47,7 @@ struct sca_block {
19     #define KVM_HPAGE_MASK(x) (~(KVM_HPAGE_SIZE(x) - 1))
20     #define KVM_PAGES_PER_HPAGE(x) (KVM_HPAGE_SIZE(x) / PAGE_SIZE)
21    
22     -#define CPUSTAT_HOST 0x80000000
23     +#define CPUSTAT_STOPPED 0x80000000
24     #define CPUSTAT_WAIT 0x10000000
25     #define CPUSTAT_ECALL_PEND 0x08000000
26     #define CPUSTAT_STOP_INT 0x04000000
27     diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
28     index 9e4c841..5a5c084 100644
29     --- a/arch/s390/kvm/diag.c
30     +++ b/arch/s390/kvm/diag.c
31     @@ -42,7 +42,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
32     return -EOPNOTSUPP;
33     }
34    
35     - atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
36     + atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
37     vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM;
38     vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL;
39     vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT;
40     diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
41     index c7c5189..0243454 100644
42     --- a/arch/s390/kvm/intercept.c
43     +++ b/arch/s390/kvm/intercept.c
44     @@ -132,7 +132,6 @@ static int handle_stop(struct kvm_vcpu *vcpu)
45     int rc = 0;
46    
47     vcpu->stat.exit_stop_request++;
48     - atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
49     spin_lock_bh(&vcpu->arch.local_int.lock);
50     if (vcpu->arch.local_int.action_bits & ACTION_STORE_ON_STOP) {
51     vcpu->arch.local_int.action_bits &= ~ACTION_STORE_ON_STOP;
52     @@ -149,6 +148,8 @@ static int handle_stop(struct kvm_vcpu *vcpu)
53     }
54    
55     if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
56     + atomic_set_mask(CPUSTAT_STOPPED,
57     + &vcpu->arch.sie_block->cpuflags);
58     vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
59     VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
60     rc = -EOPNOTSUPP;
61     diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
62     index c9aeb4b..d4bd4c7 100644
63     --- a/arch/s390/kvm/interrupt.c
64     +++ b/arch/s390/kvm/interrupt.c
65     @@ -224,6 +224,7 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
66     offsetof(struct _lowcore, restart_psw), sizeof(psw_t));
67     if (rc == -EFAULT)
68     exception = 1;
69     + atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
70     break;
71    
72     case KVM_S390_PROGRAM_INT:
73     diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
74     index 0cba935..8cdb1bd 100644
75     --- a/arch/s390/kvm/kvm-s390.c
76     +++ b/arch/s390/kvm/kvm-s390.c
77     @@ -265,10 +265,12 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
78     restore_fp_regs(&vcpu->arch.guest_fpregs);
79     restore_access_regs(vcpu->arch.guest_acrs);
80     gmap_enable(vcpu->arch.gmap);
81     + atomic_set_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
82     }
83    
84     void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
85     {
86     + atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
87     gmap_disable(vcpu->arch.gmap);
88     save_fp_regs(&vcpu->arch.guest_fpregs);
89     save_access_regs(vcpu->arch.guest_acrs);
90     @@ -296,7 +298,9 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
91    
92     int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
93     {
94     - atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH | CPUSTAT_SM);
95     + atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH |
96     + CPUSTAT_SM |
97     + CPUSTAT_STOPPED);
98     vcpu->arch.sie_block->ecb = 6;
99     vcpu->arch.sie_block->eca = 0xC1002001U;
100     vcpu->arch.sie_block->fac = (int) (long) facilities;
101     @@ -421,7 +425,7 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)
102     {
103     int rc = 0;
104    
105     - if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING)
106     + if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOPPED))
107     rc = -EBUSY;
108     else {
109     vcpu->run->psw_mask = psw.mask;
110     @@ -494,7 +498,7 @@ rerun_vcpu:
111     if (vcpu->sigset_active)
112     sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
113    
114     - atomic_set_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
115     + atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
116    
117     BUG_ON(vcpu->kvm->arch.float_int.local_int[vcpu->vcpu_id] == NULL);
118    
119     diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
120     index d6a50c1..2a129bf 100644
121     --- a/arch/s390/kvm/sigp.c
122     +++ b/arch/s390/kvm/sigp.c
123     @@ -57,8 +57,8 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr,
124     spin_lock(&fi->lock);
125     if (fi->local_int[cpu_addr] == NULL)
126     rc = 3; /* not operational */
127     - else if (atomic_read(fi->local_int[cpu_addr]->cpuflags)
128     - & CPUSTAT_RUNNING) {
129     + else if (!(atomic_read(fi->local_int[cpu_addr]->cpuflags)
130     + & CPUSTAT_STOPPED)) {
131     *reg &= 0xffffffff00000000UL;
132     rc = 1; /* status stored */
133     } else {
134     @@ -212,7 +212,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
135    
136     spin_lock_bh(&li->lock);
137     /* cpu must be in stopped state */
138     - if (atomic_read(li->cpuflags) & CPUSTAT_RUNNING) {
139     + if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) {
140     rc = 1; /* incorrect state */
141     *reg &= SIGP_STAT_INCORRECT_STATE;
142     kfree(inti);
143     diff --git a/drivers/base/core.c b/drivers/base/core.c
144     index bc8729d..78445f4 100644
145     --- a/drivers/base/core.c
146     +++ b/drivers/base/core.c
147     @@ -22,6 +22,7 @@
148     #include <linux/kallsyms.h>
149     #include <linux/mutex.h>
150     #include <linux/async.h>
151     +#include <linux/pm_runtime.h>
152    
153     #include "base.h"
154     #include "power/power.h"
155     @@ -1742,6 +1743,8 @@ void device_shutdown(void)
156     */
157     list_del_init(&dev->kobj.entry);
158     spin_unlock(&devices_kset->list_lock);
159     + /* Disable all device's runtime power management */
160     + pm_runtime_disable(dev);
161    
162     if (dev->bus && dev->bus->shutdown) {
163     dev_dbg(dev, "shutdown\n");
164     diff --git a/drivers/base/node.c b/drivers/base/node.c
165     index 793f796..5693ece 100644
166     --- a/drivers/base/node.c
167     +++ b/drivers/base/node.c
168     @@ -127,12 +127,13 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
169     nid, K(node_page_state(nid, NR_WRITEBACK)),
170     nid, K(node_page_state(nid, NR_FILE_PAGES)),
171     nid, K(node_page_state(nid, NR_FILE_MAPPED)),
172     - nid, K(node_page_state(nid, NR_ANON_PAGES)
173     #ifdef CONFIG_TRANSPARENT_HUGEPAGE
174     + nid, K(node_page_state(nid, NR_ANON_PAGES)
175     + node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
176     - HPAGE_PMD_NR
177     + HPAGE_PMD_NR),
178     +#else
179     + nid, K(node_page_state(nid, NR_ANON_PAGES)),
180     #endif
181     - ),
182     nid, K(node_page_state(nid, NR_SHMEM)),
183     nid, node_page_state(nid, NR_KERNEL_STACK) *
184     THREAD_SIZE / 1024,
185     @@ -143,13 +144,14 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
186     nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
187     node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
188     nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
189     - nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
190     #ifdef CONFIG_TRANSPARENT_HUGEPAGE
191     + nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
192     , nid,
193     K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
194     - HPAGE_PMD_NR)
195     + HPAGE_PMD_NR));
196     +#else
197     + nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
198     #endif
199     - );
200     n += hugetlb_report_node_meminfo(nid, buf + n);
201     return n;
202     }
203     diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
204     index 542453f..90587de 100644
205     --- a/drivers/gpu/drm/i915/i915_reg.h
206     +++ b/drivers/gpu/drm/i915/i915_reg.h
207     @@ -2554,10 +2554,18 @@
208     #define _CURBBASE 0x700c4
209     #define _CURBPOS 0x700c8
210    
211     +#define _CURBCNTR_IVB 0x71080
212     +#define _CURBBASE_IVB 0x71084
213     +#define _CURBPOS_IVB 0x71088
214     +
215     #define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR)
216     #define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE)
217     #define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS)
218    
219     +#define CURCNTR_IVB(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR_IVB)
220     +#define CURBASE_IVB(pipe) _PIPE(pipe, _CURABASE, _CURBBASE_IVB)
221     +#define CURPOS_IVB(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS_IVB)
222     +
223     /* Display A control */
224     #define _DSPACNTR 0x70180
225     #define DISPLAY_PLANE_ENABLE (1<<31)
226     @@ -3167,6 +3175,7 @@
227     #define FDI_LINK_TRAIN_NONE_IVB (3<<8)
228    
229     /* both Tx and Rx */
230     +#define FDI_COMPOSITE_SYNC (1<<11)
231     #define FDI_LINK_TRAIN_AUTO (1<<10)
232     #define FDI_SCRAMBLING_ENABLE (0<<7)
233     #define FDI_SCRAMBLING_DISABLE (1<<7)
234     diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
235     index 04411ad..e1340a2 100644
236     --- a/drivers/gpu/drm/i915/intel_display.c
237     +++ b/drivers/gpu/drm/i915/intel_display.c
238     @@ -2600,6 +2600,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc)
239     temp |= FDI_LINK_TRAIN_PATTERN_1_IVB;
240     temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK;
241     temp |= FDI_LINK_TRAIN_400MV_0DB_SNB_B;
242     + temp |= FDI_COMPOSITE_SYNC;
243     I915_WRITE(reg, temp | FDI_TX_ENABLE);
244    
245     reg = FDI_RX_CTL(pipe);
246     @@ -2607,6 +2608,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc)
247     temp &= ~FDI_LINK_TRAIN_AUTO;
248     temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT;
249     temp |= FDI_LINK_TRAIN_PATTERN_1_CPT;
250     + temp |= FDI_COMPOSITE_SYNC;
251     I915_WRITE(reg, temp | FDI_RX_ENABLE);
252    
253     POSTING_READ(reg);
254     @@ -5758,6 +5760,31 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
255     I915_WRITE(CURBASE(pipe), base);
256     }
257    
258     +static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
259     +{
260     + struct drm_device *dev = crtc->dev;
261     + struct drm_i915_private *dev_priv = dev->dev_private;
262     + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
263     + int pipe = intel_crtc->pipe;
264     + bool visible = base != 0;
265     +
266     + if (intel_crtc->cursor_visible != visible) {
267     + uint32_t cntl = I915_READ(CURCNTR_IVB(pipe));
268     + if (base) {
269     + cntl &= ~CURSOR_MODE;
270     + cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
271     + } else {
272     + cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
273     + cntl |= CURSOR_MODE_DISABLE;
274     + }
275     + I915_WRITE(CURCNTR_IVB(pipe), cntl);
276     +
277     + intel_crtc->cursor_visible = visible;
278     + }
279     + /* and commit changes on next vblank */
280     + I915_WRITE(CURBASE_IVB(pipe), base);
281     +}
282     +
283     /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
284     static void intel_crtc_update_cursor(struct drm_crtc *crtc,
285     bool on)
286     @@ -5805,11 +5832,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
287     if (!visible && !intel_crtc->cursor_visible)
288     return;
289    
290     - I915_WRITE(CURPOS(pipe), pos);
291     - if (IS_845G(dev) || IS_I865G(dev))
292     - i845_update_cursor(crtc, base);
293     - else
294     - i9xx_update_cursor(crtc, base);
295     + if (IS_IVYBRIDGE(dev)) {
296     + I915_WRITE(CURPOS_IVB(pipe), pos);
297     + ivb_update_cursor(crtc, base);
298     + } else {
299     + I915_WRITE(CURPOS(pipe), pos);
300     + if (IS_845G(dev) || IS_I865G(dev))
301     + i845_update_cursor(crtc, base);
302     + else
303     + i9xx_update_cursor(crtc, base);
304     + }
305    
306     if (visible)
307     intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj);
308     diff --git a/drivers/media/video/saa7164/saa7164-cards.c b/drivers/media/video/saa7164/saa7164-cards.c
309     index 69822a4..c713691 100644
310     --- a/drivers/media/video/saa7164/saa7164-cards.c
311     +++ b/drivers/media/video/saa7164/saa7164-cards.c
312     @@ -203,6 +203,66 @@ struct saa7164_board saa7164_boards[] = {
313     .i2c_reg_len = REGLEN_8bit,
314     } },
315     },
316     + [SAA7164_BOARD_HAUPPAUGE_HVR2200_4] = {
317     + .name = "Hauppauge WinTV-HVR2200",
318     + .porta = SAA7164_MPEG_DVB,
319     + .portb = SAA7164_MPEG_DVB,
320     + .portc = SAA7164_MPEG_ENCODER,
321     + .portd = SAA7164_MPEG_ENCODER,
322     + .porte = SAA7164_MPEG_VBI,
323     + .portf = SAA7164_MPEG_VBI,
324     + .chiprev = SAA7164_CHIP_REV3,
325     + .unit = {{
326     + .id = 0x1d,
327     + .type = SAA7164_UNIT_EEPROM,
328     + .name = "4K EEPROM",
329     + .i2c_bus_nr = SAA7164_I2C_BUS_0,
330     + .i2c_bus_addr = 0xa0 >> 1,
331     + .i2c_reg_len = REGLEN_8bit,
332     + }, {
333     + .id = 0x04,
334     + .type = SAA7164_UNIT_TUNER,
335     + .name = "TDA18271-1",
336     + .i2c_bus_nr = SAA7164_I2C_BUS_1,
337     + .i2c_bus_addr = 0xc0 >> 1,
338     + .i2c_reg_len = REGLEN_8bit,
339     + }, {
340     + .id = 0x05,
341     + .type = SAA7164_UNIT_ANALOG_DEMODULATOR,
342     + .name = "TDA8290-1",
343     + .i2c_bus_nr = SAA7164_I2C_BUS_1,
344     + .i2c_bus_addr = 0x84 >> 1,
345     + .i2c_reg_len = REGLEN_8bit,
346     + }, {
347     + .id = 0x1b,
348     + .type = SAA7164_UNIT_TUNER,
349     + .name = "TDA18271-2",
350     + .i2c_bus_nr = SAA7164_I2C_BUS_2,
351     + .i2c_bus_addr = 0xc0 >> 1,
352     + .i2c_reg_len = REGLEN_8bit,
353     + }, {
354     + .id = 0x1c,
355     + .type = SAA7164_UNIT_ANALOG_DEMODULATOR,
356     + .name = "TDA8290-2",
357     + .i2c_bus_nr = SAA7164_I2C_BUS_2,
358     + .i2c_bus_addr = 0x84 >> 1,
359     + .i2c_reg_len = REGLEN_8bit,
360     + }, {
361     + .id = 0x1e,
362     + .type = SAA7164_UNIT_DIGITAL_DEMODULATOR,
363     + .name = "TDA10048-1",
364     + .i2c_bus_nr = SAA7164_I2C_BUS_1,
365     + .i2c_bus_addr = 0x10 >> 1,
366     + .i2c_reg_len = REGLEN_8bit,
367     + }, {
368     + .id = 0x1f,
369     + .type = SAA7164_UNIT_DIGITAL_DEMODULATOR,
370     + .name = "TDA10048-2",
371     + .i2c_bus_nr = SAA7164_I2C_BUS_2,
372     + .i2c_bus_addr = 0x12 >> 1,
373     + .i2c_reg_len = REGLEN_8bit,
374     + } },
375     + },
376     [SAA7164_BOARD_HAUPPAUGE_HVR2250] = {
377     .name = "Hauppauge WinTV-HVR2250",
378     .porta = SAA7164_MPEG_DVB,
379     @@ -426,6 +486,10 @@ struct saa7164_subid saa7164_subids[] = {
380     .subvendor = 0x0070,
381     .subdevice = 0x8851,
382     .card = SAA7164_BOARD_HAUPPAUGE_HVR2250_2,
383     + }, {
384     + .subvendor = 0x0070,
385     + .subdevice = 0x8940,
386     + .card = SAA7164_BOARD_HAUPPAUGE_HVR2200_4,
387     },
388     };
389     const unsigned int saa7164_idcount = ARRAY_SIZE(saa7164_subids);
390     @@ -469,6 +533,7 @@ void saa7164_gpio_setup(struct saa7164_dev *dev)
391     case SAA7164_BOARD_HAUPPAUGE_HVR2200:
392     case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
393     case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
394     + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
395     case SAA7164_BOARD_HAUPPAUGE_HVR2250:
396     case SAA7164_BOARD_HAUPPAUGE_HVR2250_2:
397     case SAA7164_BOARD_HAUPPAUGE_HVR2250_3:
398     @@ -549,6 +614,7 @@ void saa7164_card_setup(struct saa7164_dev *dev)
399     case SAA7164_BOARD_HAUPPAUGE_HVR2200:
400     case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
401     case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
402     + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
403     case SAA7164_BOARD_HAUPPAUGE_HVR2250:
404     case SAA7164_BOARD_HAUPPAUGE_HVR2250_2:
405     case SAA7164_BOARD_HAUPPAUGE_HVR2250_3:
406     diff --git a/drivers/media/video/saa7164/saa7164-dvb.c b/drivers/media/video/saa7164/saa7164-dvb.c
407     index f65eab6..d377937 100644
408     --- a/drivers/media/video/saa7164/saa7164-dvb.c
409     +++ b/drivers/media/video/saa7164/saa7164-dvb.c
410     @@ -475,6 +475,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
411     case SAA7164_BOARD_HAUPPAUGE_HVR2200:
412     case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
413     case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
414     + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
415     i2c_bus = &dev->i2c_bus[port->nr + 1];
416     switch (port->nr) {
417     case 0:
418     diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h
419     index 6678bf1..35b6430 100644
420     --- a/drivers/media/video/saa7164/saa7164.h
421     +++ b/drivers/media/video/saa7164/saa7164.h
422     @@ -82,6 +82,7 @@
423     #define SAA7164_BOARD_HAUPPAUGE_HVR2200_3 6
424     #define SAA7164_BOARD_HAUPPAUGE_HVR2250_2 7
425     #define SAA7164_BOARD_HAUPPAUGE_HVR2250_3 8
426     +#define SAA7164_BOARD_HAUPPAUGE_HVR2200_4 9
427    
428     #define SAA7164_MAX_UNITS 8
429     #define SAA7164_TS_NUMBER_OF_LINES 312
430     diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
431     index 2d6423c..8563e9a 100644
432     --- a/drivers/misc/Kconfig
433     +++ b/drivers/misc/Kconfig
434     @@ -472,7 +472,7 @@ config BMP085
435     module will be called bmp085.
436    
437     config PCH_PHUB
438     - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) PHUB"
439     + tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) PHUB"
440     depends on PCI
441     help
442     This driver is for PCH(Platform controller Hub) PHUB(Packet Hub) of
443     @@ -480,12 +480,13 @@ config PCH_PHUB
444     processor. The Topcliff has MAC address and Option ROM data in SROM.
445     This driver can access MAC address and Option ROM data in SROM.
446    
447     - This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
448     - Output Hub), ML7213 and ML7223.
449     - ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
450     - for MP(Media Phone) use.
451     - ML7213/ML7223 is companion chip for Intel Atom E6xx series.
452     - ML7213/ML7223 is completely compatible for Intel EG20T PCH.
453     + This driver also can be used for LAPIS Semiconductor's IOH,
454     + ML7213/ML7223/ML7831.
455     + ML7213 which is for IVI(In-Vehicle Infotainment) use.
456     + ML7223 IOH is for MP(Media Phone) use.
457     + ML7831 IOH is for general purpose use.
458     + ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
459     + ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
460    
461     To compile this driver as a module, choose M here: the module will
462     be called pch_phub.
463     diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
464     index 0fd7e77..ba276ba 100644
465     --- a/drivers/misc/pch_phub.c
466     +++ b/drivers/misc/pch_phub.c
467     @@ -73,6 +73,9 @@
468     #define PCI_DEVICE_ID_ROHM_ML7223_mPHUB 0x8012 /* for Bus-m */
469     #define PCI_DEVICE_ID_ROHM_ML7223_nPHUB 0x8002 /* for Bus-n */
470    
471     +/* Macros for ML7831 */
472     +#define PCI_DEVICE_ID_ROHM_ML7831_PHUB 0x8801
473     +
474     /* SROM ACCESS Macro */
475     #define PCH_WORD_ADDR_MASK (~((1 << 2) - 1))
476    
477     @@ -464,7 +467,7 @@ static int pch_phub_write_gbe_mac_addr(struct pch_phub_reg *chip, u8 *data)
478     int retval;
479     int i;
480    
481     - if (chip->ioh_type == 1) /* EG20T */
482     + if ((chip->ioh_type == 1) || (chip->ioh_type == 5)) /* EG20T or ML7831*/
483     retval = pch_phub_gbe_serial_rom_conf(chip);
484     else /* ML7223 */
485     retval = pch_phub_gbe_serial_rom_conf_mp(chip);
486     @@ -757,6 +760,22 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
487     chip->pch_opt_rom_start_address =\
488     PCH_PHUB_ROM_START_ADDR_ML7223;
489     chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223;
490     + } else if (id->driver_data == 5) { /* ML7831 */
491     + retval = sysfs_create_file(&pdev->dev.kobj,
492     + &dev_attr_pch_mac.attr);
493     + if (retval)
494     + goto err_sysfs_create;
495     +
496     + retval = sysfs_create_bin_file(&pdev->dev.kobj, &pch_bin_attr);
497     + if (retval)
498     + goto exit_bin_attr;
499     +
500     + /* set the prefech value */
501     + iowrite32(0x000affaa, chip->pch_phub_base_address + 0x14);
502     + /* set the interrupt delay value */
503     + iowrite32(0x25, chip->pch_phub_base_address + 0x44);
504     + chip->pch_opt_rom_start_address = PCH_PHUB_ROM_START_ADDR_EG20T;
505     + chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_EG20T;
506     }
507    
508     chip->ioh_type = id->driver_data;
509     @@ -841,6 +860,7 @@ static struct pci_device_id pch_phub_pcidev_id[] = {
510     { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7213_PHUB), 2, },
511     { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_mPHUB), 3, },
512     { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_nPHUB), 4, },
513     + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7831_PHUB), 5, },
514     { }
515     };
516     MODULE_DEVICE_TABLE(pci, pch_phub_pcidev_id);
517     diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
518     index cfbddbe..43d073b 100644
519     --- a/drivers/misc/spear13xx_pcie_gadget.c
520     +++ b/drivers/misc/spear13xx_pcie_gadget.c
521     @@ -903,6 +903,6 @@ static void __exit spear_pcie_gadget_exit(void)
522     }
523     module_exit(spear_pcie_gadget_exit);
524    
525     -MODULE_ALIAS("pcie-gadget-spear");
526     +MODULE_ALIAS("platform:pcie-gadget-spear");
527     MODULE_AUTHOR("Pratyush Anand");
528     MODULE_LICENSE("GPL");
529     diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
530     index e0286cf..7be8b05 100644
531     --- a/drivers/net/wireless/libertas/if_spi.c
532     +++ b/drivers/net/wireless/libertas/if_spi.c
533     @@ -999,6 +999,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
534     spin_unlock_irqrestore(&card->buffer_lock, flags);
535     break;
536     default:
537     + kfree(packet);
538     netdev_err(priv->dev, "can't transfer buffer of type %d\n",
539     type);
540     err = -EINVAL;
541     diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
542     index f82bfeb..0415e47 100644
543     --- a/drivers/net/wireless/rt2x00/rt2x00.h
544     +++ b/drivers/net/wireless/rt2x00/rt2x00.h
545     @@ -923,6 +923,7 @@ struct rt2x00_dev {
546     * Powersaving work
547     */
548     struct delayed_work autowakeup_work;
549     + struct work_struct sleep_work;
550    
551     /*
552     * Data queue arrays for RX, TX, Beacon and ATIM.
553     diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
554     index 0955c94..9d05f87 100644
555     --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
556     +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
557     @@ -449,6 +449,23 @@ static u8 *rt2x00lib_find_ie(u8 *data, unsigned int len, u8 ie)
558     return NULL;
559     }
560    
561     +static void rt2x00lib_sleep(struct work_struct *work)
562     +{
563     + struct rt2x00_dev *rt2x00dev =
564     + container_of(work, struct rt2x00_dev, sleep_work);
565     +
566     + if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
567     + return;
568     +
569     + /*
570     + * Check again is powersaving is enabled, to prevent races from delayed
571     + * work execution.
572     + */
573     + if (!test_bit(CONFIG_POWERSAVING, &rt2x00dev->flags))
574     + rt2x00lib_config(rt2x00dev, &rt2x00dev->hw->conf,
575     + IEEE80211_CONF_CHANGE_PS);
576     +}
577     +
578     static void rt2x00lib_rxdone_check_ps(struct rt2x00_dev *rt2x00dev,
579     struct sk_buff *skb,
580     struct rxdone_entry_desc *rxdesc)
581     @@ -496,8 +513,7 @@ static void rt2x00lib_rxdone_check_ps(struct rt2x00_dev *rt2x00dev,
582     cam |= (tim_ie->bitmap_ctrl & 0x01);
583    
584     if (!cam && !test_bit(CONFIG_POWERSAVING, &rt2x00dev->flags))
585     - rt2x00lib_config(rt2x00dev, &rt2x00dev->hw->conf,
586     - IEEE80211_CONF_CHANGE_PS);
587     + queue_work(rt2x00dev->workqueue, &rt2x00dev->sleep_work);
588     }
589    
590     static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev,
591     @@ -1121,6 +1137,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
592    
593     INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
594     INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
595     + INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
596    
597     /*
598     * Let the driver probe the device to detect the capabilities.
599     @@ -1177,6 +1194,7 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
600     */
601     cancel_work_sync(&rt2x00dev->intf_work);
602     cancel_delayed_work_sync(&rt2x00dev->autowakeup_work);
603     + cancel_work_sync(&rt2x00dev->sleep_work);
604     if (rt2x00_is_usb(rt2x00dev)) {
605     del_timer_sync(&rt2x00dev->txstatus_timer);
606     cancel_work_sync(&rt2x00dev->rxdone_work);
607     diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
608     index 3382475..c7b6fed 100644
609     --- a/drivers/scsi/aacraid/linit.c
610     +++ b/drivers/scsi/aacraid/linit.c
611     @@ -38,6 +38,7 @@
612     #include <linux/module.h>
613     #include <linux/moduleparam.h>
614     #include <linux/pci.h>
615     +#include <linux/pci-aspm.h>
616     #include <linux/slab.h>
617     #include <linux/mutex.h>
618     #include <linux/spinlock.h>
619     @@ -1108,6 +1109,9 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
620     unique_id++;
621     }
622    
623     + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
624     + PCIE_LINK_STATE_CLKPM);
625     +
626     error = pci_enable_device(pdev);
627     if (error)
628     goto out;
629     diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
630     index 8c713d3..418ce83 100644
631     --- a/drivers/scsi/hpsa.c
632     +++ b/drivers/scsi/hpsa.c
633     @@ -23,6 +23,7 @@
634     #include <linux/interrupt.h>
635     #include <linux/types.h>
636     #include <linux/pci.h>
637     +#include <linux/pci-aspm.h>
638     #include <linux/kernel.h>
639     #include <linux/slab.h>
640     #include <linux/delay.h>
641     @@ -3887,6 +3888,10 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
642     dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
643     return -ENODEV;
644     }
645     +
646     + pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S |
647     + PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM);
648     +
649     err = pci_enable_device(h->pdev);
650     if (err) {
651     dev_warn(&h->pdev->dev, "unable to enable PCI device\n");
652     diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
653     index 72273a0..b3c6d95 100644
654     --- a/drivers/scsi/scsi_scan.c
655     +++ b/drivers/scsi/scsi_scan.c
656     @@ -319,11 +319,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
657     return sdev;
658    
659     out_device_destroy:
660     - scsi_device_set_state(sdev, SDEV_DEL);
661     - transport_destroy_device(&sdev->sdev_gendev);
662     - put_device(&sdev->sdev_dev);
663     - scsi_free_queue(sdev->request_queue);
664     - put_device(&sdev->sdev_gendev);
665     + __scsi_remove_device(sdev);
666     out:
667     if (display_failure_msg)
668     printk(ALLOC_FAILURE_MSG, __func__);
669     diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
670     index 435f6fa..44fbeba 100644
671     --- a/drivers/tty/hvc/hvc_dcc.c
672     +++ b/drivers/tty/hvc/hvc_dcc.c
673     @@ -46,6 +46,7 @@ static inline char __dcc_getchar(void)
674    
675     asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
676     : "=r" (__c));
677     + isb();
678    
679     return __c;
680     }
681     @@ -55,6 +56,7 @@ static inline void __dcc_putchar(char c)
682     asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char"
683     : /* no output register */
684     : "r" (c));
685     + isb();
686     }
687    
688     static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
689     diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
690     index 4dcb37b..abf6fa4 100644
691     --- a/drivers/tty/serial/Kconfig
692     +++ b/drivers/tty/serial/Kconfig
693     @@ -1570,7 +1570,7 @@ config SERIAL_IFX6X60
694     Support for the IFX6x60 modem devices on Intel MID platforms.
695    
696     config SERIAL_PCH_UART
697     - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) UART"
698     + tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) UART"
699     depends on PCI
700     select SERIAL_CORE
701     help
702     @@ -1578,12 +1578,12 @@ config SERIAL_PCH_UART
703     which is an IOH(Input/Output Hub) for x86 embedded processor.
704     Enabling PCH_DMA, this PCH UART works as DMA mode.
705    
706     - This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
707     - Output Hub), ML7213 and ML7223.
708     - ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
709     - for MP(Media Phone) use.
710     - ML7213/ML7223 is companion chip for Intel Atom E6xx series.
711     - ML7213/ML7223 is completely compatible for Intel EG20T PCH.
712     + This driver also can be used for LAPIS Semiconductor IOH(Input/
713     + Output Hub), ML7213, ML7223 and ML7831.
714     + ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
715     + for MP(Media Phone) use and ML7831 IOH is for general purpose use.
716     + ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
717     + ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
718    
719     config SERIAL_MSM_SMD
720     bool "Enable tty device interface for some SMD ports"
721     diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
722     index b46218d..f913ed0 100644
723     --- a/drivers/tty/serial/pch_uart.c
724     +++ b/drivers/tty/serial/pch_uart.c
725     @@ -256,6 +256,8 @@ enum pch_uart_num_t {
726     pch_ml7213_uart2,
727     pch_ml7223_uart0,
728     pch_ml7223_uart1,
729     + pch_ml7831_uart0,
730     + pch_ml7831_uart1,
731     };
732    
733     static struct pch_uart_driver_data drv_dat[] = {
734     @@ -268,6 +270,8 @@ static struct pch_uart_driver_data drv_dat[] = {
735     [pch_ml7213_uart2] = {PCH_UART_2LINE, 2},
736     [pch_ml7223_uart0] = {PCH_UART_8LINE, 0},
737     [pch_ml7223_uart1] = {PCH_UART_2LINE, 1},
738     + [pch_ml7831_uart0] = {PCH_UART_8LINE, 0},
739     + [pch_ml7831_uart1] = {PCH_UART_2LINE, 1},
740     };
741    
742     static unsigned int default_baud = 9600;
743     @@ -626,6 +630,7 @@ static void pch_request_dma(struct uart_port *port)
744     dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Rx)\n",
745     __func__);
746     dma_release_channel(priv->chan_tx);
747     + priv->chan_tx = NULL;
748     return;
749     }
750    
751     @@ -1213,8 +1218,7 @@ static void pch_uart_shutdown(struct uart_port *port)
752     dev_err(priv->port.dev,
753     "pch_uart_hal_set_fifo Failed(ret=%d)\n", ret);
754    
755     - if (priv->use_dma_flag)
756     - pch_free_dma(port);
757     + pch_free_dma(port);
758    
759     free_irq(priv->port.irq, priv);
760     }
761     @@ -1278,6 +1282,7 @@ static void pch_uart_set_termios(struct uart_port *port,
762     if (rtn)
763     goto out;
764    
765     + pch_uart_set_mctrl(&priv->port, priv->port.mctrl);
766     /* Don't rewrite B0 */
767     if (tty_termios_baud_rate(termios))
768     tty_termios_encode_baud_rate(termios, baud, baud);
769     @@ -1550,6 +1555,10 @@ static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = {
770     .driver_data = pch_ml7223_uart0},
771     {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x800D),
772     .driver_data = pch_ml7223_uart1},
773     + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8811),
774     + .driver_data = pch_ml7831_uart0},
775     + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8812),
776     + .driver_data = pch_ml7831_uart1},
777     {0,},
778     };
779    
780     diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
781     index ef925d5..a76c808 100644
782     --- a/drivers/tty/tty_ldisc.c
783     +++ b/drivers/tty/tty_ldisc.c
784     @@ -36,6 +36,7 @@
785    
786     #include <linux/kmod.h>
787     #include <linux/nsproxy.h>
788     +#include <linux/ratelimit.h>
789    
790     /*
791     * This guards the refcounted line discipline lists. The lock
792     @@ -548,15 +549,16 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
793     /**
794     * tty_ldisc_wait_idle - wait for the ldisc to become idle
795     * @tty: tty to wait for
796     + * @timeout: for how long to wait at most
797     *
798     * Wait for the line discipline to become idle. The discipline must
799     * have been halted for this to guarantee it remains idle.
800     */
801     -static int tty_ldisc_wait_idle(struct tty_struct *tty)
802     +static int tty_ldisc_wait_idle(struct tty_struct *tty, long timeout)
803     {
804     - int ret;
805     + long ret;
806     ret = wait_event_timeout(tty_ldisc_idle,
807     - atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
808     + atomic_read(&tty->ldisc->users) == 1, timeout);
809     if (ret < 0)
810     return ret;
811     return ret > 0 ? 0 : -EBUSY;
812     @@ -666,7 +668,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
813    
814     tty_ldisc_flush_works(tty);
815    
816     - retval = tty_ldisc_wait_idle(tty);
817     + retval = tty_ldisc_wait_idle(tty, 5 * HZ);
818    
819     tty_lock();
820     mutex_lock(&tty->ldisc_mutex);
821     @@ -763,8 +765,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
822     if (IS_ERR(ld))
823     return -1;
824    
825     - WARN_ON_ONCE(tty_ldisc_wait_idle(tty));
826     -
827     tty_ldisc_close(tty, tty->ldisc);
828     tty_ldisc_put(tty->ldisc);
829     tty->ldisc = NULL;
830     @@ -839,7 +839,7 @@ void tty_ldisc_hangup(struct tty_struct *tty)
831     tty_unlock();
832     cancel_work_sync(&tty->buf.work);
833     mutex_unlock(&tty->ldisc_mutex);
834     -
835     +retry:
836     tty_lock();
837     mutex_lock(&tty->ldisc_mutex);
838    
839     @@ -848,6 +848,22 @@ void tty_ldisc_hangup(struct tty_struct *tty)
840     it means auditing a lot of other paths so this is
841     a FIXME */
842     if (tty->ldisc) { /* Not yet closed */
843     + if (atomic_read(&tty->ldisc->users) != 1) {
844     + char cur_n[TASK_COMM_LEN], tty_n[64];
845     + long timeout = 3 * HZ;
846     + tty_unlock();
847     +
848     + while (tty_ldisc_wait_idle(tty, timeout) == -EBUSY) {
849     + timeout = MAX_SCHEDULE_TIMEOUT;
850     + printk_ratelimited(KERN_WARNING
851     + "%s: waiting (%s) for %s took too long, but we keep waiting...\n",
852     + __func__, get_task_comm(cur_n, current),
853     + tty_name(tty, tty_n));
854     + }
855     + mutex_unlock(&tty->ldisc_mutex);
856     + goto retry;
857     + }
858     +
859     if (reset == 0) {
860    
861     if (!tty_ldisc_reinit(tty, tty->termios->c_line))
862     diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
863     index 5112f57..2ffcaa0 100644
864     --- a/drivers/usb/class/cdc-acm.c
865     +++ b/drivers/usb/class/cdc-acm.c
866     @@ -539,7 +539,6 @@ static void acm_port_down(struct acm *acm)
867     {
868     int i;
869    
870     - mutex_lock(&open_mutex);
871     if (acm->dev) {
872     usb_autopm_get_interface(acm->control);
873     acm_set_control(acm, acm->ctrlout = 0);
874     @@ -551,14 +550,15 @@ static void acm_port_down(struct acm *acm)
875     acm->control->needs_remote_wakeup = 0;
876     usb_autopm_put_interface(acm->control);
877     }
878     - mutex_unlock(&open_mutex);
879     }
880    
881     static void acm_tty_hangup(struct tty_struct *tty)
882     {
883     struct acm *acm = tty->driver_data;
884     tty_port_hangup(&acm->port);
885     + mutex_lock(&open_mutex);
886     acm_port_down(acm);
887     + mutex_unlock(&open_mutex);
888     }
889    
890     static void acm_tty_close(struct tty_struct *tty, struct file *filp)
891     @@ -569,8 +569,9 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
892     shutdown */
893     if (!acm)
894     return;
895     +
896     + mutex_lock(&open_mutex);
897     if (tty_port_close_start(&acm->port, tty, filp) == 0) {
898     - mutex_lock(&open_mutex);
899     if (!acm->dev) {
900     tty_port_tty_set(&acm->port, NULL);
901     acm_tty_unregister(acm);
902     @@ -582,6 +583,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
903     acm_port_down(acm);
904     tty_port_close_end(&acm->port, tty);
905     tty_port_tty_set(&acm->port, NULL);
906     + mutex_unlock(&open_mutex);
907     }
908    
909     static int acm_tty_write(struct tty_struct *tty,
910     diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
911     index a428aa0..210e359 100644
912     --- a/drivers/usb/core/hub.c
913     +++ b/drivers/usb/core/hub.c
914     @@ -813,6 +813,12 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
915     USB_PORT_FEAT_C_PORT_LINK_STATE);
916     }
917    
918     + if ((portchange & USB_PORT_STAT_C_BH_RESET) &&
919     + hub_is_superspeed(hub->hdev)) {
920     + need_debounce_delay = true;
921     + clear_port_feature(hub->hdev, port1,
922     + USB_PORT_FEAT_C_BH_PORT_RESET);
923     + }
924     /* We can forget about a "removed" device when there's a
925     * physical disconnect or the connect status changes.
926     */
927     diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
928     index d6a8d82..ecf12e1 100644
929     --- a/drivers/usb/core/quirks.c
930     +++ b/drivers/usb/core/quirks.c
931     @@ -50,15 +50,42 @@ static const struct usb_device_id usb_quirk_list[] = {
932     /* Logitech Webcam B/C500 */
933     { USB_DEVICE(0x046d, 0x0807), .driver_info = USB_QUIRK_RESET_RESUME },
934    
935     + /* Logitech Webcam C600 */
936     + { USB_DEVICE(0x046d, 0x0808), .driver_info = USB_QUIRK_RESET_RESUME },
937     +
938     /* Logitech Webcam Pro 9000 */
939     { USB_DEVICE(0x046d, 0x0809), .driver_info = USB_QUIRK_RESET_RESUME },
940    
941     + /* Logitech Webcam C905 */
942     + { USB_DEVICE(0x046d, 0x080a), .driver_info = USB_QUIRK_RESET_RESUME },
943     +
944     + /* Logitech Webcam C210 */
945     + { USB_DEVICE(0x046d, 0x0819), .driver_info = USB_QUIRK_RESET_RESUME },
946     +
947     + /* Logitech Webcam C260 */
948     + { USB_DEVICE(0x046d, 0x081a), .driver_info = USB_QUIRK_RESET_RESUME },
949     +
950     /* Logitech Webcam C310 */
951     { USB_DEVICE(0x046d, 0x081b), .driver_info = USB_QUIRK_RESET_RESUME },
952    
953     + /* Logitech Webcam C910 */
954     + { USB_DEVICE(0x046d, 0x0821), .driver_info = USB_QUIRK_RESET_RESUME },
955     +
956     + /* Logitech Webcam C160 */
957     + { USB_DEVICE(0x046d, 0x0824), .driver_info = USB_QUIRK_RESET_RESUME },
958     +
959     /* Logitech Webcam C270 */
960     { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
961    
962     + /* Logitech Quickcam Pro 9000 */
963     + { USB_DEVICE(0x046d, 0x0990), .driver_info = USB_QUIRK_RESET_RESUME },
964     +
965     + /* Logitech Quickcam E3500 */
966     + { USB_DEVICE(0x046d, 0x09a4), .driver_info = USB_QUIRK_RESET_RESUME },
967     +
968     + /* Logitech Quickcam Vision Pro */
969     + { USB_DEVICE(0x046d, 0x09a6), .driver_info = USB_QUIRK_RESET_RESUME },
970     +
971     /* Logitech Harmony 700-series */
972     { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },
973    
974     diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
975     index 5a084b9..6f50491 100644
976     --- a/drivers/usb/gadget/Kconfig
977     +++ b/drivers/usb/gadget/Kconfig
978     @@ -442,7 +442,7 @@ config USB_LANGWELL
979     gadget drivers to also be dynamically linked.
980    
981     config USB_EG20T
982     - tristate "Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH UDC"
983     + tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC"
984     depends on PCI
985     select USB_GADGET_DUALSPEED
986     help
987     @@ -458,10 +458,11 @@ config USB_EG20T
988     This driver dose not support interrupt transfer or isochronous
989     transfer modes.
990    
991     - This driver also can be used for OKI SEMICONDUCTOR's ML7213 which is
992     + This driver also can be used for LAPIS Semiconductor's ML7213 which is
993     for IVI(In-Vehicle Infotainment) use.
994     - ML7213 is companion chip for Intel Atom E6xx series.
995     - ML7213 is completely compatible for Intel EG20T PCH.
996     + ML7831 is for general purpose use.
997     + ML7213/ML7831 is companion chip for Intel Atom E6xx series.
998     + ML7213/ML7831 is completely compatible for Intel EG20T PCH.
999    
1000     config USB_CI13XXX_MSM
1001     tristate "MIPS USB CI13xxx for MSM"
1002     diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
1003     index f96615a..06c40b1 100644
1004     --- a/drivers/usb/gadget/pch_udc.c
1005     +++ b/drivers/usb/gadget/pch_udc.c
1006     @@ -363,6 +363,7 @@ struct pch_udc_dev {
1007     #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808
1008     #define PCI_VENDOR_ID_ROHM 0x10DB
1009     #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D
1010     +#define PCI_DEVICE_ID_ML7831_IOH_UDC 0x8808
1011    
1012     static const char ep0_string[] = "ep0in";
1013     static DEFINE_SPINLOCK(udc_stall_spinlock); /* stall spin lock */
1014     @@ -2979,6 +2980,11 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {
1015     .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
1016     .class_mask = 0xffffffff,
1017     },
1018     + {
1019     + PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7831_IOH_UDC),
1020     + .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
1021     + .class_mask = 0xffffffff,
1022     + },
1023     { 0 },
1024     };
1025    
1026     diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
1027     index 29bec34..afef3df 100644
1028     --- a/drivers/usb/host/ehci-sched.c
1029     +++ b/drivers/usb/host/ehci-sched.c
1030     @@ -1480,10 +1480,15 @@ iso_stream_schedule (
1031    
1032     /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */
1033    
1034     - /* find a uframe slot with enough bandwidth */
1035     - next = start + period;
1036     - for (; start < next; start++) {
1037     -
1038     + /* find a uframe slot with enough bandwidth.
1039     + * Early uframes are more precious because full-speed
1040     + * iso IN transfers can't use late uframes,
1041     + * and therefore they should be allocated last.
1042     + */
1043     + next = start;
1044     + start += period;
1045     + do {
1046     + start--;
1047     /* check schedule: enough space? */
1048     if (stream->highspeed) {
1049     if (itd_slot_ok(ehci, mod, start,
1050     @@ -1496,7 +1501,7 @@ iso_stream_schedule (
1051     start, sched, period))
1052     break;
1053     }
1054     - }
1055     + } while (start > next);
1056    
1057     /* no room in the schedule */
1058     if (start == next) {
1059     diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
1060     index 629a968..a495d48 100644
1061     --- a/drivers/usb/host/pci-quirks.c
1062     +++ b/drivers/usb/host/pci-quirks.c
1063     @@ -626,7 +626,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
1064     void __iomem *base, *op_reg_base;
1065     u32 hcc_params, cap, val;
1066     u8 offset, cap_length;
1067     - int wait_time, delta, count = 256/4;
1068     + int wait_time, count = 256/4;
1069    
1070     if (!mmio_resource_enabled(pdev, 0))
1071     return;
1072     @@ -672,11 +672,10 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
1073     writel(val, op_reg_base + EHCI_USBCMD);
1074    
1075     wait_time = 2000;
1076     - delta = 100;
1077     do {
1078     writel(0x3f, op_reg_base + EHCI_USBSTS);
1079     - udelay(delta);
1080     - wait_time -= delta;
1081     + udelay(100);
1082     + wait_time -= 100;
1083     val = readl(op_reg_base + EHCI_USBSTS);
1084     if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) {
1085     break;
1086     diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
1087     index 3428528..d718033 100644
1088     --- a/drivers/usb/host/xhci-mem.c
1089     +++ b/drivers/usb/host/xhci-mem.c
1090     @@ -875,7 +875,6 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
1091     struct xhci_virt_device *dev;
1092     struct xhci_ep_ctx *ep0_ctx;
1093     struct xhci_slot_ctx *slot_ctx;
1094     - struct xhci_input_control_ctx *ctrl_ctx;
1095     u32 port_num;
1096     struct usb_device *top_dev;
1097    
1098     @@ -887,12 +886,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
1099     return -EINVAL;
1100     }
1101     ep0_ctx = xhci_get_ep_ctx(xhci, dev->in_ctx, 0);
1102     - ctrl_ctx = xhci_get_input_control_ctx(xhci, dev->in_ctx);
1103     slot_ctx = xhci_get_slot_ctx(xhci, dev->in_ctx);
1104    
1105     - /* 2) New slot context and endpoint 0 context are valid*/
1106     - ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG);
1107     -
1108     /* 3) Only the control endpoint is valid - one endpoint context */
1109     slot_ctx->dev_info |= cpu_to_le32(LAST_CTX(1) | udev->route);
1110     switch (udev->speed) {
1111     diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
1112     index dd3eb6f..2c07fff 100644
1113     --- a/drivers/usb/host/xhci-ring.c
1114     +++ b/drivers/usb/host/xhci-ring.c
1115     @@ -816,23 +816,24 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
1116     struct xhci_ring *ring;
1117     struct xhci_td *cur_td;
1118     int ret, i, j;
1119     + unsigned long flags;
1120    
1121     ep = (struct xhci_virt_ep *) arg;
1122     xhci = ep->xhci;
1123    
1124     - spin_lock(&xhci->lock);
1125     + spin_lock_irqsave(&xhci->lock, flags);
1126    
1127     ep->stop_cmds_pending--;
1128     if (xhci->xhc_state & XHCI_STATE_DYING) {
1129     xhci_dbg(xhci, "Stop EP timer ran, but another timer marked "
1130     "xHCI as DYING, exiting.\n");
1131     - spin_unlock(&xhci->lock);
1132     + spin_unlock_irqrestore(&xhci->lock, flags);
1133     return;
1134     }
1135     if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) {
1136     xhci_dbg(xhci, "Stop EP timer ran, but no command pending, "
1137     "exiting.\n");
1138     - spin_unlock(&xhci->lock);
1139     + spin_unlock_irqrestore(&xhci->lock, flags);
1140     return;
1141     }
1142    
1143     @@ -844,11 +845,11 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
1144     xhci->xhc_state |= XHCI_STATE_DYING;
1145     /* Disable interrupts from the host controller and start halting it */
1146     xhci_quiesce(xhci);
1147     - spin_unlock(&xhci->lock);
1148     + spin_unlock_irqrestore(&xhci->lock, flags);
1149    
1150     ret = xhci_halt(xhci);
1151    
1152     - spin_lock(&xhci->lock);
1153     + spin_lock_irqsave(&xhci->lock, flags);
1154     if (ret < 0) {
1155     /* This is bad; the host is not responding to commands and it's
1156     * not allowing itself to be halted. At least interrupts are
1157     @@ -896,7 +897,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
1158     }
1159     }
1160     }
1161     - spin_unlock(&xhci->lock);
1162     + spin_unlock_irqrestore(&xhci->lock, flags);
1163     xhci_dbg(xhci, "Calling usb_hc_died()\n");
1164     usb_hc_died(xhci_to_hcd(xhci)->primary_hcd);
1165     xhci_dbg(xhci, "xHCI host controller is dead.\n");
1166     diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1167     index 3770004..67900ff 100644
1168     --- a/drivers/usb/host/xhci.c
1169     +++ b/drivers/usb/host/xhci.c
1170     @@ -749,7 +749,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1171     u32 command, temp = 0;
1172     struct usb_hcd *hcd = xhci_to_hcd(xhci);
1173     struct usb_hcd *secondary_hcd;
1174     - int retval;
1175     + int retval = 0;
1176    
1177     /* Wait a bit if either of the roothubs need to settle from the
1178     * transition into bus suspend.
1179     @@ -759,6 +759,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1180     xhci->bus_state[1].next_statechange))
1181     msleep(100);
1182    
1183     + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1184     + set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
1185     +
1186     spin_lock_irq(&xhci->lock);
1187     if (xhci->quirks & XHCI_RESET_ON_RESUME)
1188     hibernated = true;
1189     @@ -828,20 +831,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1190     return retval;
1191     xhci_dbg(xhci, "Start the primary HCD\n");
1192     retval = xhci_run(hcd->primary_hcd);
1193     - if (retval)
1194     - goto failed_restart;
1195     -
1196     - xhci_dbg(xhci, "Start the secondary HCD\n");
1197     - retval = xhci_run(secondary_hcd);
1198     if (!retval) {
1199     - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1200     - set_bit(HCD_FLAG_HW_ACCESSIBLE,
1201     - &xhci->shared_hcd->flags);
1202     + xhci_dbg(xhci, "Start the secondary HCD\n");
1203     + retval = xhci_run(secondary_hcd);
1204     }
1205     -failed_restart:
1206     hcd->state = HC_STATE_SUSPENDED;
1207     xhci->shared_hcd->state = HC_STATE_SUSPENDED;
1208     - return retval;
1209     + goto done;
1210     }
1211    
1212     /* step 4: set Run/Stop bit */
1213     @@ -860,11 +856,14 @@ failed_restart:
1214     * Running endpoints by ringing their doorbells
1215     */
1216    
1217     - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1218     - set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
1219     -
1220     spin_unlock_irq(&xhci->lock);
1221     - return 0;
1222     +
1223     + done:
1224     + if (retval == 0) {
1225     + usb_hcd_resume_root_hub(hcd);
1226     + usb_hcd_resume_root_hub(xhci->shared_hcd);
1227     + }
1228     + return retval;
1229     }
1230     #endif /* CONFIG_PM */
1231    
1232     @@ -2873,6 +2872,10 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1233     /* Otherwise, update the control endpoint ring enqueue pointer. */
1234     else
1235     xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev);
1236     + ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1237     + ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG);
1238     + ctrl_ctx->drop_flags = 0;
1239     +
1240     xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1241     xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1242    
1243     @@ -2954,7 +2957,6 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1244     virt_dev->address = (le32_to_cpu(slot_ctx->dev_state) & DEV_ADDR_MASK)
1245     + 1;
1246     /* Zero the input context control for later use */
1247     - ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1248     ctrl_ctx->add_flags = 0;
1249     ctrl_ctx->drop_flags = 0;
1250    
1251     diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
1252     index 5cdb9d9..18e875b 100644
1253     --- a/drivers/usb/serial/ark3116.c
1254     +++ b/drivers/usb/serial/ark3116.c
1255     @@ -42,7 +42,7 @@ static int debug;
1256     * Version information
1257     */
1258    
1259     -#define DRIVER_VERSION "v0.6"
1260     +#define DRIVER_VERSION "v0.7"
1261     #define DRIVER_AUTHOR "Bart Hartgers <bart.hartgers+ark3116@gmail.com>"
1262     #define DRIVER_DESC "USB ARK3116 serial/IrDA driver"
1263     #define DRIVER_DEV_DESC "ARK3116 RS232/IrDA"
1264     @@ -380,10 +380,6 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
1265     goto err_out;
1266     }
1267    
1268     - /* setup termios */
1269     - if (tty)
1270     - ark3116_set_termios(tty, port, NULL);
1271     -
1272     /* remove any data still left: also clears error state */
1273     ark3116_read_reg(serial, UART_RX, buf);
1274    
1275     @@ -406,6 +402,10 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
1276     /* enable DMA */
1277     ark3116_write_reg(port->serial, UART_FCR, UART_FCR_DMA_SELECT);
1278    
1279     + /* setup termios */
1280     + if (tty)
1281     + ark3116_set_termios(tty, port, NULL);
1282     +
1283     err_out:
1284     kfree(buf);
1285     return result;
1286     diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1287     index f34f6ed..e16394c 100644
1288     --- a/drivers/usb/serial/ftdi_sio.c
1289     +++ b/drivers/usb/serial/ftdi_sio.c
1290     @@ -2083,13 +2083,19 @@ static void ftdi_set_termios(struct tty_struct *tty,
1291    
1292     cflag = termios->c_cflag;
1293    
1294     - /* FIXME -For this cut I don't care if the line is really changing or
1295     - not - so just do the change regardless - should be able to
1296     - compare old_termios and tty->termios */
1297     + if (old_termios->c_cflag == termios->c_cflag
1298     + && old_termios->c_ispeed == termios->c_ispeed
1299     + && old_termios->c_ospeed == termios->c_ospeed)
1300     + goto no_c_cflag_changes;
1301     +
1302     /* NOTE These routines can get interrupted by
1303     ftdi_sio_read_bulk_callback - need to examine what this means -
1304     don't see any problems yet */
1305    
1306     + if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
1307     + (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
1308     + goto no_data_parity_stop_changes;
1309     +
1310     /* Set number of data bits, parity, stop bits */
1311    
1312     urb_value = 0;
1313     @@ -2130,6 +2136,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
1314     }
1315    
1316     /* Now do the baudrate */
1317     +no_data_parity_stop_changes:
1318     if ((cflag & CBAUD) == B0) {
1319     /* Disable flow control */
1320     if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1321     @@ -2157,6 +2164,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
1322    
1323     /* Set flow control */
1324     /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
1325     +no_c_cflag_changes:
1326     if (cflag & CRTSCTS) {
1327     dbg("%s Setting to CRTSCTS flow control", __func__);
1328     if (usb_control_msg(dev,
1329     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1330     index 89ae1f6..3a47cbe 100644
1331     --- a/drivers/usb/serial/option.c
1332     +++ b/drivers/usb/serial/option.c
1333     @@ -156,6 +156,7 @@ static void option_instat_callback(struct urb *urb);
1334     #define HUAWEI_PRODUCT_K4511 0x14CC
1335     #define HUAWEI_PRODUCT_ETS1220 0x1803
1336     #define HUAWEI_PRODUCT_E353 0x1506
1337     +#define HUAWEI_PRODUCT_E173S 0x1C05
1338    
1339     #define QUANTA_VENDOR_ID 0x0408
1340     #define QUANTA_PRODUCT_Q101 0xEA02
1341     @@ -316,6 +317,9 @@ static void option_instat_callback(struct urb *urb);
1342     #define ZTE_PRODUCT_AC8710 0xfff1
1343     #define ZTE_PRODUCT_AC2726 0xfff5
1344     #define ZTE_PRODUCT_AC8710T 0xffff
1345     +#define ZTE_PRODUCT_MC2718 0xffe8
1346     +#define ZTE_PRODUCT_AD3812 0xffeb
1347     +#define ZTE_PRODUCT_MC2716 0xffed
1348    
1349     #define BENQ_VENDOR_ID 0x04a5
1350     #define BENQ_PRODUCT_H10 0x4068
1351     @@ -500,6 +504,18 @@ static const struct option_blacklist_info zte_k3765_z_blacklist = {
1352     .reserved = BIT(4),
1353     };
1354    
1355     +static const struct option_blacklist_info zte_ad3812_z_blacklist = {
1356     + .sendsetup = BIT(0) | BIT(1) | BIT(2),
1357     +};
1358     +
1359     +static const struct option_blacklist_info zte_mc2718_z_blacklist = {
1360     + .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4),
1361     +};
1362     +
1363     +static const struct option_blacklist_info zte_mc2716_z_blacklist = {
1364     + .sendsetup = BIT(1) | BIT(2) | BIT(3),
1365     +};
1366     +
1367     static const struct option_blacklist_info huawei_cdc12_blacklist = {
1368     .reserved = BIT(1) | BIT(2),
1369     };
1370     @@ -622,6 +638,7 @@ static const struct usb_device_id option_ids[] = {
1371     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
1372     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
1373     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
1374     + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173S, 0xff, 0xff, 0xff) },
1375     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
1376     .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
1377     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
1378     @@ -1043,6 +1060,12 @@ static const struct usb_device_id option_ids[] = {
1379     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
1380     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
1381     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) },
1382     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff),
1383     + .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist },
1384     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff),
1385     + .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
1386     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
1387     + .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
1388     { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
1389     { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
1390     { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
1391     diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
1392     index 614fabc..d44c669 100644
1393     --- a/drivers/usb/serial/pl2303.c
1394     +++ b/drivers/usb/serial/pl2303.c
1395     @@ -91,7 +91,6 @@ static const struct usb_device_id id_table[] = {
1396     { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
1397     { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
1398     { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
1399     - { USB_DEVICE(WINCHIPHEAD_VENDOR_ID, WINCHIPHEAD_USBSER_PRODUCT_ID) },
1400     { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
1401     { } /* Terminating entry */
1402     };
1403     diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
1404     index 3d10d7f..c38b8c0 100644
1405     --- a/drivers/usb/serial/pl2303.h
1406     +++ b/drivers/usb/serial/pl2303.h
1407     @@ -145,10 +145,6 @@
1408     #define ADLINK_VENDOR_ID 0x0b63
1409     #define ADLINK_ND6530_PRODUCT_ID 0x6530
1410    
1411     -/* WinChipHead USB->RS 232 adapter */
1412     -#define WINCHIPHEAD_VENDOR_ID 0x4348
1413     -#define WINCHIPHEAD_USBSER_PRODUCT_ID 0x5523
1414     -
1415     /* SMART USB Serial Adapter */
1416     #define SMART_VENDOR_ID 0x0b8c
1417     #define SMART_PRODUCT_ID 0x2303
1418     diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
1419     index fc310f7..0fded39 100644
1420     --- a/drivers/usb/storage/protocol.c
1421     +++ b/drivers/usb/storage/protocol.c
1422     @@ -58,7 +58,9 @@
1423    
1424     void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us)
1425     {
1426     - /* Pad the SCSI command with zeros out to 12 bytes
1427     + /*
1428     + * Pad the SCSI command with zeros out to 12 bytes. If the
1429     + * command already is 12 bytes or longer, leave it alone.
1430     *
1431     * NOTE: This only works because a scsi_cmnd struct field contains
1432     * a unsigned char cmnd[16], so we know we have storage available
1433     @@ -66,9 +68,6 @@ void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us)
1434     for (; srb->cmd_len<12; srb->cmd_len++)
1435     srb->cmnd[srb->cmd_len] = 0;
1436    
1437     - /* set command length to 12 bytes */
1438     - srb->cmd_len = 12;
1439     -
1440     /* send the command to the transport layer */
1441     usb_stor_invoke_transport(srb, us);
1442     }
1443     diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
1444     index b238d95..ac28990 100644
1445     --- a/fs/nfs/dir.c
1446     +++ b/fs/nfs/dir.c
1447     @@ -1468,12 +1468,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1448     res = NULL;
1449     goto out;
1450     /* This turned out not to be a regular file */
1451     + case -EISDIR:
1452     case -ENOTDIR:
1453     goto no_open;
1454     case -ELOOP:
1455     if (!(nd->intent.open.flags & O_NOFOLLOW))
1456     goto no_open;
1457     - /* case -EISDIR: */
1458     /* case -EINVAL: */
1459     default:
1460     res = ERR_CAST(inode);
1461     diff --git a/fs/nfs/file.c b/fs/nfs/file.c
1462     index 28b8c3f..5b3d984 100644
1463     --- a/fs/nfs/file.c
1464     +++ b/fs/nfs/file.c
1465     @@ -895,3 +895,35 @@ static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
1466     file->f_path.dentry->d_name.name, arg);
1467     return -EINVAL;
1468     }
1469     +
1470     +#ifdef CONFIG_NFS_V4
1471     +static int
1472     +nfs4_file_open(struct inode *inode, struct file *filp)
1473     +{
1474     + /*
1475     + * NFSv4 opens are handled in d_lookup and d_revalidate. If we get to
1476     + * this point, then something is very wrong
1477     + */
1478     + dprintk("NFS: %s called! inode=%p filp=%p\n", __func__, inode, filp);
1479     + return -ENOTDIR;
1480     +}
1481     +
1482     +const struct file_operations nfs4_file_operations = {
1483     + .llseek = nfs_file_llseek,
1484     + .read = do_sync_read,
1485     + .write = do_sync_write,
1486     + .aio_read = nfs_file_read,
1487     + .aio_write = nfs_file_write,
1488     + .mmap = nfs_file_mmap,
1489     + .open = nfs4_file_open,
1490     + .flush = nfs_file_flush,
1491     + .release = nfs_file_release,
1492     + .fsync = nfs_file_fsync,
1493     + .lock = nfs_lock,
1494     + .flock = nfs_flock,
1495     + .splice_read = nfs_file_splice_read,
1496     + .splice_write = nfs_file_splice_write,
1497     + .check_flags = nfs_check_flags,
1498     + .setlease = nfs_setlease,
1499     +};
1500     +#endif /* CONFIG_NFS_V4 */
1501     diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
1502     index fe12037..679d2f5 100644
1503     --- a/fs/nfs/inode.c
1504     +++ b/fs/nfs/inode.c
1505     @@ -291,7 +291,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
1506     */
1507     inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->file_inode_ops;
1508     if (S_ISREG(inode->i_mode)) {
1509     - inode->i_fop = &nfs_file_operations;
1510     + inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops;
1511     inode->i_data.a_ops = &nfs_file_aops;
1512     inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
1513     } else if (S_ISDIR(inode->i_mode)) {
1514     diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
1515     index 85f1690..d4bc9ed9 100644
1516     --- a/fs/nfs/nfs3proc.c
1517     +++ b/fs/nfs/nfs3proc.c
1518     @@ -853,6 +853,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
1519     .dentry_ops = &nfs_dentry_operations,
1520     .dir_inode_ops = &nfs3_dir_inode_operations,
1521     .file_inode_ops = &nfs3_file_inode_operations,
1522     + .file_ops = &nfs_file_operations,
1523     .getroot = nfs3_proc_get_root,
1524     .getattr = nfs3_proc_getattr,
1525     .setattr = nfs3_proc_setattr,
1526     diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1527     index 4700fae..2d8a169 100644
1528     --- a/fs/nfs/nfs4proc.c
1529     +++ b/fs/nfs/nfs4proc.c
1530     @@ -6267,6 +6267,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
1531     .dentry_ops = &nfs4_dentry_operations,
1532     .dir_inode_ops = &nfs4_dir_inode_operations,
1533     .file_inode_ops = &nfs4_file_inode_operations,
1534     + .file_ops = &nfs4_file_operations,
1535     .getroot = nfs4_proc_get_root,
1536     .getattr = nfs4_proc_getattr,
1537     .setattr = nfs4_proc_setattr,
1538     diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
1539     index ac40b85..f48125d 100644
1540     --- a/fs/nfs/proc.c
1541     +++ b/fs/nfs/proc.c
1542     @@ -710,6 +710,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
1543     .dentry_ops = &nfs_dentry_operations,
1544     .dir_inode_ops = &nfs_dir_inode_operations,
1545     .file_inode_ops = &nfs_file_inode_operations,
1546     + .file_ops = &nfs_file_operations,
1547     .getroot = nfs_proc_get_root,
1548     .getattr = nfs_proc_getattr,
1549     .setattr = nfs_proc_setattr,
1550     diff --git a/fs/super.c b/fs/super.c
1551     index 3f56a26..32a81f3 100644
1552     --- a/fs/super.c
1553     +++ b/fs/super.c
1554     @@ -61,7 +61,7 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
1555     return -1;
1556    
1557     if (!grab_super_passive(sb))
1558     - return -1;
1559     + return !sc->nr_to_scan ? 0 : -1;
1560    
1561     if (sb->s_op && sb->s_op->nr_cached_objects)
1562     fs_objects = sb->s_op->nr_cached_objects(sb);
1563     diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
1564     index eaac770..fc0fd15 100644
1565     --- a/include/linux/nfs_fs.h
1566     +++ b/include/linux/nfs_fs.h
1567     @@ -410,6 +410,9 @@ extern const struct inode_operations nfs_file_inode_operations;
1568     extern const struct inode_operations nfs3_file_inode_operations;
1569     #endif /* CONFIG_NFS_V3 */
1570     extern const struct file_operations nfs_file_operations;
1571     +#ifdef CONFIG_NFS_V4
1572     +extern const struct file_operations nfs4_file_operations;
1573     +#endif /* CONFIG_NFS_V4 */
1574     extern const struct address_space_operations nfs_file_aops;
1575     extern const struct address_space_operations nfs_dir_aops;
1576    
1577     diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
1578     index abd615d..8475f34 100644
1579     --- a/include/linux/nfs_xdr.h
1580     +++ b/include/linux/nfs_xdr.h
1581     @@ -1194,6 +1194,7 @@ struct nfs_rpc_ops {
1582     const struct dentry_operations *dentry_ops;
1583     const struct inode_operations *dir_inode_ops;
1584     const struct inode_operations *file_inode_ops;
1585     + const struct file_operations *file_ops;
1586    
1587     int (*getroot) (struct nfs_server *, struct nfs_fh *,
1588     struct nfs_fsinfo *);
1589     diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
1590     index 790651b..a83833a 100644
1591     --- a/include/linux/shrinker.h
1592     +++ b/include/linux/shrinker.h
1593     @@ -20,6 +20,7 @@ struct shrink_control {
1594     * 'nr_to_scan' entries and attempt to free them up. It should return
1595     * the number of objects which remain in the cache. If it returns -1, it means
1596     * it cannot do any scanning at this time (eg. there is a risk of deadlock).
1597     + * The callback must not return -1 if nr_to_scan is zero.
1598     *
1599     * The 'gfpmask' refers to the allocation we are currently trying to
1600     * fulfil.
1601     diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
1602     index aa57d5d..b5f4742 100644
1603     --- a/kernel/irq/spurious.c
1604     +++ b/kernel/irq/spurious.c
1605     @@ -115,7 +115,7 @@ static int misrouted_irq(int irq)
1606     struct irq_desc *desc;
1607     int i, ok = 0;
1608    
1609     - if (atomic_inc_return(&irq_poll_active) == 1)
1610     + if (atomic_inc_return(&irq_poll_active) != 1)
1611     goto out;
1612    
1613     irq_poll_cpu = smp_processor_id();
1614     diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
1615     index fb6931d..d58fd8b 100644
1616     --- a/net/batman-adv/translation-table.c
1617     +++ b/net/batman-adv/translation-table.c
1618     @@ -137,10 +137,22 @@ static void tt_local_entry_free_ref(struct tt_local_entry *tt_local_entry)
1619     kfree_rcu(tt_local_entry, rcu);
1620     }
1621    
1622     +static void tt_global_entry_free_rcu(struct rcu_head *rcu)
1623     +{
1624     + struct tt_global_entry *tt_global_entry;
1625     +
1626     + tt_global_entry = container_of(rcu, struct tt_global_entry, rcu);
1627     +
1628     + if (tt_global_entry->orig_node)
1629     + orig_node_free_ref(tt_global_entry->orig_node);
1630     +
1631     + kfree(tt_global_entry);
1632     +}
1633     +
1634     static void tt_global_entry_free_ref(struct tt_global_entry *tt_global_entry)
1635     {
1636     if (atomic_dec_and_test(&tt_global_entry->refcount))
1637     - kfree_rcu(tt_global_entry, rcu);
1638     + call_rcu(&tt_global_entry->rcu, tt_global_entry_free_rcu);
1639     }
1640    
1641     static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr,
1642     @@ -686,6 +698,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
1643     struct hlist_head *head;
1644     spinlock_t *list_lock; /* protects write access to the hash lists */
1645    
1646     + if (!hash)
1647     + return;
1648     +
1649     for (i = 0; i < hash->size; i++) {
1650     head = &hash->table[i];
1651     list_lock = &hash->list_locks[i];
1652     @@ -999,7 +1014,6 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1653     tt_response = (struct tt_query_packet *)skb_put(skb,
1654     tt_query_size + tt_len);
1655     tt_response->ttvn = ttvn;
1656     - tt_response->tt_data = htons(tt_tot);
1657    
1658     tt_change = (struct tt_change *)(skb->data + tt_query_size);
1659     tt_count = 0;
1660     @@ -1025,6 +1039,10 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
1661     }
1662     rcu_read_unlock();
1663    
1664     + /* store in the message the number of entries we have successfully
1665     + * copied */
1666     + tt_response->tt_data = htons(tt_count);
1667     +
1668     out:
1669     return skb;
1670     }
1671     @@ -1668,6 +1686,8 @@ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
1672     rcu_read_lock();
1673     hlist_for_each_entry_rcu(tt_local_entry, node,
1674     head, hash_entry) {
1675     + if (!(tt_local_entry->flags & flags))
1676     + continue;
1677     tt_local_entry->flags &= ~flags;
1678     atomic_inc(&bat_priv->num_local_tt);
1679     }
1680     diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
1681     index 25bd1db..51a0db7 100644
1682     --- a/net/batman-adv/types.h
1683     +++ b/net/batman-adv/types.h
1684     @@ -223,22 +223,22 @@ struct socket_packet {
1685    
1686     struct tt_local_entry {
1687     uint8_t addr[ETH_ALEN];
1688     + struct hlist_node hash_entry;
1689     unsigned long last_seen;
1690     uint16_t flags;
1691     atomic_t refcount;
1692     struct rcu_head rcu;
1693     - struct hlist_node hash_entry;
1694     };
1695    
1696     struct tt_global_entry {
1697     uint8_t addr[ETH_ALEN];
1698     + struct hlist_node hash_entry; /* entry in the global table */
1699     struct orig_node *orig_node;
1700     uint8_t ttvn;
1701     uint16_t flags; /* only TT_GLOBAL_ROAM is used */
1702     unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */
1703     atomic_t refcount;
1704     struct rcu_head rcu;
1705     - struct hlist_node hash_entry; /* entry in the global table */
1706     };
1707    
1708     struct tt_change_node {
1709     diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
1710     index 0bc9888..4e6922f 100644
1711     --- a/net/ipv6/ip6_tunnel.c
1712     +++ b/net/ipv6/ip6_tunnel.c
1713     @@ -289,6 +289,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
1714     if ((err = register_netdevice(dev)) < 0)
1715     goto failed_free;
1716    
1717     + strcpy(t->parms.name, dev->name);
1718     +
1719     dev_hold(dev);
1720     ip6_tnl_link(ip6n, t);
1721     return t;
1722     @@ -1397,7 +1399,6 @@ ip6_tnl_dev_init_gen(struct net_device *dev)
1723     struct ip6_tnl *t = netdev_priv(dev);
1724    
1725     t->dev = dev;
1726     - strcpy(t->parms.name, dev->name);
1727     dev->tstats = alloc_percpu(struct pcpu_tstats);
1728     if (!dev->tstats)
1729     return -ENOMEM;
1730     @@ -1477,6 +1478,7 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n)
1731     static int __net_init ip6_tnl_init_net(struct net *net)
1732     {
1733     struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1734     + struct ip6_tnl *t = NULL;
1735     int err;
1736    
1737     ip6n->tnls[0] = ip6n->tnls_wc;
1738     @@ -1497,6 +1499,10 @@ static int __net_init ip6_tnl_init_net(struct net *net)
1739     err = register_netdev(ip6n->fb_tnl_dev);
1740     if (err < 0)
1741     goto err_register;
1742     +
1743     + t = netdev_priv(ip6n->fb_tnl_dev);
1744     +
1745     + strcpy(t->parms.name, ip6n->fb_tnl_dev->name);
1746     return 0;
1747    
1748     err_register:
1749     diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
1750     index fe2c2a7..a961003 100644
1751     --- a/net/mac80211/rx.c
1752     +++ b/net/mac80211/rx.c
1753     @@ -140,8 +140,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
1754     pos++;
1755    
1756     /* IEEE80211_RADIOTAP_RATE */
1757     - if (status->flag & RX_FLAG_HT) {
1758     + if (!rate || status->flag & RX_FLAG_HT) {
1759     /*
1760     + * Without rate information don't add it. If we have,
1761     * MCS information is a separate field in radiotap,
1762     * added below. The byte here is needed as padding
1763     * for the channel though, so initialise it to 0.
1764     @@ -162,12 +163,14 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
1765     else if (status->flag & RX_FLAG_HT)
1766     put_unaligned_le16(IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ,
1767     pos);
1768     - else if (rate->flags & IEEE80211_RATE_ERP_G)
1769     + else if (rate && rate->flags & IEEE80211_RATE_ERP_G)
1770     put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
1771     pos);
1772     - else
1773     + else if (rate)
1774     put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
1775     pos);
1776     + else
1777     + put_unaligned_le16(IEEE80211_CHAN_2GHZ, pos);
1778     pos += 2;
1779    
1780     /* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
1781     diff --git a/net/mac80211/util.c b/net/mac80211/util.c
1782     index ddeb1b9..fd031e8 100644
1783     --- a/net/mac80211/util.c
1784     +++ b/net/mac80211/util.c
1785     @@ -1055,6 +1055,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1786     skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1787     ssid, ssid_len,
1788     buf, buf_len);
1789     + if (!skb)
1790     + goto out;
1791    
1792     if (dst) {
1793     mgmt = (struct ieee80211_mgmt *) skb->data;
1794     @@ -1063,6 +1065,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1795     }
1796    
1797     IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
1798     +
1799     + out:
1800     kfree(buf);
1801    
1802     return skb;
1803     diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
1804     index ea40d54..1308050 100644
1805     --- a/net/wireless/nl80211.c
1806     +++ b/net/wireless/nl80211.c
1807     @@ -126,8 +126,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
1808     [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED },
1809     [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG },
1810    
1811     - [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY,
1812     - .len = NL80211_HT_CAPABILITY_LEN },
1813     + [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN },
1814    
1815     [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 },
1816     [NL80211_ATTR_IE] = { .type = NLA_BINARY,
1817     diff --git a/net/wireless/reg.c b/net/wireless/reg.c
1818     index 68a471b..1658eff 100644
1819     --- a/net/wireless/reg.c
1820     +++ b/net/wireless/reg.c
1821     @@ -2254,6 +2254,9 @@ void /* __init_or_exit */ regulatory_exit(void)
1822    
1823     kfree(last_request);
1824    
1825     + last_request = NULL;
1826     + dev_set_uevent_suppress(&reg_pdev->dev, true);
1827     +
1828     platform_device_unregister(reg_pdev);
1829    
1830     spin_lock_bh(&reg_pending_beacons_lock);
1831     diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
1832     index c34f730..44f199c 100644
1833     --- a/sound/pci/hda/hda_eld.c
1834     +++ b/sound/pci/hda/hda_eld.c
1835     @@ -297,10 +297,10 @@ static int hdmi_update_eld(struct hdmi_eld *e,
1836     buf + ELD_FIXED_BYTES + mnl + 3 * i);
1837     }
1838    
1839     + e->eld_valid = true;
1840     return 0;
1841    
1842     out_fail:
1843     - e->eld_ver = 0;
1844     return -EINVAL;
1845     }
1846    
1847     @@ -318,9 +318,6 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
1848     int size;
1849     unsigned char *buf;
1850    
1851     - if (!eld->eld_valid)
1852     - return -ENOENT;
1853     -
1854     size = snd_hdmi_get_eld_size(codec, nid);
1855     if (size == 0) {
1856     /* wfg: workaround for ASUS P5E-VM HDMI board */
1857     diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
1858     index c45f3e6..4346ad2 100644
1859     --- a/sound/pci/hda/patch_cirrus.c
1860     +++ b/sound/pci/hda/patch_cirrus.c
1861     @@ -236,6 +236,15 @@ static int cs_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
1862     return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
1863     }
1864    
1865     +static void cs_update_input_select(struct hda_codec *codec)
1866     +{
1867     + struct cs_spec *spec = codec->spec;
1868     + if (spec->cur_adc)
1869     + snd_hda_codec_write(codec, spec->cur_adc, 0,
1870     + AC_VERB_SET_CONNECT_SEL,
1871     + spec->adc_idx[spec->cur_input]);
1872     +}
1873     +
1874     /*
1875     * Analog capture
1876     */
1877     @@ -249,6 +258,7 @@ static int cs_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
1878     spec->cur_adc = spec->adc_nid[spec->cur_input];
1879     spec->cur_adc_stream_tag = stream_tag;
1880     spec->cur_adc_format = format;
1881     + cs_update_input_select(codec);
1882     snd_hda_codec_setup_stream(codec, spec->cur_adc, stream_tag, 0, format);
1883     return 0;
1884     }
1885     @@ -688,10 +698,8 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx,
1886     spec->cur_adc_stream_tag, 0,
1887     spec->cur_adc_format);
1888     }
1889     - snd_hda_codec_write(codec, spec->cur_adc, 0,
1890     - AC_VERB_SET_CONNECT_SEL,
1891     - spec->adc_idx[idx]);
1892     spec->cur_input = idx;
1893     + cs_update_input_select(codec);
1894     return 1;
1895     }
1896    
1897     @@ -972,10 +980,7 @@ static void cs_automic(struct hda_codec *codec)
1898     } else {
1899     spec->cur_input = spec->last_input;
1900     }
1901     -
1902     - snd_hda_codec_write_cache(codec, spec->cur_adc, 0,
1903     - AC_VERB_SET_CONNECT_SEL,
1904     - spec->adc_idx[spec->cur_input]);
1905     + cs_update_input_select(codec);
1906     } else {
1907     if (present)
1908     change_cur_input(codec, spec->automic_idx, 0);
1909     @@ -1072,9 +1077,7 @@ static void init_input(struct hda_codec *codec)
1910     cs_automic(codec);
1911     else {
1912     spec->cur_adc = spec->adc_nid[spec->cur_input];
1913     - snd_hda_codec_write(codec, spec->cur_adc, 0,
1914     - AC_VERB_SET_CONNECT_SEL,
1915     - spec->adc_idx[spec->cur_input]);
1916     + cs_update_input_select(codec);
1917     }
1918     } else {
1919     change_cur_input(codec, spec->cur_input, 1);
1920     diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
1921     index 19cb72d..e287015 100644
1922     --- a/sound/pci/hda/patch_hdmi.c
1923     +++ b/sound/pci/hda/patch_hdmi.c
1924     @@ -920,20 +920,23 @@ static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
1925     * the unsolicited response to avoid custom WARs.
1926     */
1927     int present = snd_hda_pin_sense(codec, pin_nid);
1928     + bool eld_valid = false;
1929    
1930     - memset(eld, 0, sizeof(*eld));
1931     +#ifdef CONFIG_PROC_FS
1932     + memset(eld, 0, offsetof(struct hdmi_eld, proc_entry));
1933     +#else
1934     + memset(eld, 0, sizeof(struct hdmi_eld));
1935     +#endif
1936    
1937     eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
1938     if (eld->monitor_present)
1939     - eld->eld_valid = !!(present & AC_PINSENSE_ELDV);
1940     - else
1941     - eld->eld_valid = 0;
1942     + eld_valid = !!(present & AC_PINSENSE_ELDV);
1943    
1944     printk(KERN_INFO
1945     "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
1946     - codec->addr, pin_nid, eld->monitor_present, eld->eld_valid);
1947     + codec->addr, pin_nid, eld->monitor_present, eld_valid);
1948    
1949     - if (eld->eld_valid)
1950     + if (eld_valid)
1951     if (!snd_hdmi_get_eld(eld, codec, pin_nid))
1952     snd_hdmi_show_eld(eld);
1953