Magellan Linux

Contents of /trunk/kernel-magellan/patches-3.1.2-r2/0101-3.1.2-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1591 - (show annotations) (download)
Thu Dec 1 15:53:51 2011 UTC (12 years, 4 months ago) by niro
File size: 31175 byte(s)
-3.1.2-magellan-r2
1 diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
2 index d70c93b..f896140 100644
3 --- a/Documentation/sound/alsa/HD-Audio-Models.txt
4 +++ b/Documentation/sound/alsa/HD-Audio-Models.txt
5 @@ -408,6 +408,7 @@ STAC92HD83*
6 ref Reference board
7 mic-ref Reference board with power management for ports
8 dell-s14 Dell laptop
9 + dell-vostro-3500 Dell Vostro 3500 laptop
10 hp HP laptops with (inverted) mute-LED
11 hp-dv7-4000 HP dv-7 4000
12 auto BIOS setup (default)
13 diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
14 index dba0d8d..0512baf 100644
15 --- a/arch/arm/mach-at91/at91cap9_devices.c
16 +++ b/arch/arm/mach-at91/at91cap9_devices.c
17 @@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
18 * USB HS Device (Gadget)
19 * -------------------------------------------------------------------- */
20
21 -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
22 +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
23
24 static struct resource usba_udc_resources[] = {
25 [0] = {
26 diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
27 index 600bffb..371bb0e 100644
28 --- a/arch/arm/mach-at91/at91sam9g45_devices.c
29 +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
30 @@ -191,7 +191,7 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data) {}
31 * USB HS Device (Gadget)
32 * -------------------------------------------------------------------- */
33
34 -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
35 +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
36 static struct resource usba_udc_resources[] = {
37 [0] = {
38 .start = AT91SAM9G45_UDPHS_FIFO,
39 diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
40 index aacb19d..c884d59 100644
41 --- a/arch/arm/mach-at91/at91sam9rl_devices.c
42 +++ b/arch/arm/mach-at91/at91sam9rl_devices.c
43 @@ -75,7 +75,7 @@ void __init at91_add_device_hdmac(void) {}
44 * USB HS Device (Gadget)
45 * -------------------------------------------------------------------- */
46
47 -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
48 +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
49
50 static struct resource usba_udc_resources[] = {
51 [0] = {
52 diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
53 index 6fbce72..a0f358d 100644
54 --- a/arch/powerpc/include/asm/sections.h
55 +++ b/arch/powerpc/include/asm/sections.h
56 @@ -8,7 +8,7 @@
57
58 #ifdef __powerpc64__
59
60 -extern char _end[];
61 +extern char __end_interrupts[];
62
63 static inline int in_kernel_text(unsigned long addr)
64 {
65 diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
66 index d7cab44..87878c6 100644
67 --- a/arch/powerpc/include/asm/synch.h
68 +++ b/arch/powerpc/include/asm/synch.h
69 @@ -13,6 +13,7 @@
70 extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
71 extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
72 void *fixup_end);
73 +extern void do_final_fixups(void);
74
75 static inline void eieio(void)
76 {
77 diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
78 index b06bdae..ad892f7 100644
79 --- a/arch/powerpc/kernel/kvm.c
80 +++ b/arch/powerpc/kernel/kvm.c
81 @@ -131,7 +131,6 @@ static void kvm_patch_ins_b(u32 *inst, int addr)
82 /* On relocatable kernels interrupts handlers and our code
83 can be in different regions, so we don't patch them */
84
85 - extern u32 __end_interrupts;
86 if ((ulong)inst < (ulong)&__end_interrupts)
87 return;
88 #endif
89 diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
90 index 209135a..912c36a 100644
91 --- a/arch/powerpc/kernel/setup_32.c
92 +++ b/arch/powerpc/kernel/setup_32.c
93 @@ -107,6 +107,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
94 PTRRELOC(&__start___lwsync_fixup),
95 PTRRELOC(&__stop___lwsync_fixup));
96
97 + do_final_fixups();
98 +
99 return KERNELBASE + offset;
100 }
101
102 diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
103 index aebef13..e0f2031 100644
104 --- a/arch/powerpc/kernel/setup_64.c
105 +++ b/arch/powerpc/kernel/setup_64.c
106 @@ -353,6 +353,7 @@ void __init setup_system(void)
107 &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
108 do_lwsync_fixups(cur_cpu_spec->cpu_features,
109 &__start___lwsync_fixup, &__stop___lwsync_fixup);
110 + do_final_fixups();
111
112 /*
113 * Unflatten the device-tree passed by prom_init or kexec
114 diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
115 index cc0d7f1..0e85639 100644
116 --- a/arch/powerpc/kvm/book3s_hv.c
117 +++ b/arch/powerpc/kvm/book3s_hv.c
118 @@ -43,6 +43,7 @@
119 #include <asm/processor.h>
120 #include <asm/cputhreads.h>
121 #include <asm/page.h>
122 +#include <asm/hvcall.h>
123 #include <linux/gfp.h>
124 #include <linux/sched.h>
125 #include <linux/vmalloc.h>
126 diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
127 index 0d08d01..7a8a748 100644
128 --- a/arch/powerpc/lib/feature-fixups.c
129 +++ b/arch/powerpc/lib/feature-fixups.c
130 @@ -18,6 +18,8 @@
131 #include <linux/init.h>
132 #include <asm/cputable.h>
133 #include <asm/code-patching.h>
134 +#include <asm/page.h>
135 +#include <asm/sections.h>
136
137
138 struct fixup_entry {
139 @@ -128,6 +130,27 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
140 }
141 }
142
143 +void do_final_fixups(void)
144 +{
145 +#if defined(CONFIG_PPC64) && defined(CONFIG_RELOCATABLE)
146 + int *src, *dest;
147 + unsigned long length;
148 +
149 + if (PHYSICAL_START == 0)
150 + return;
151 +
152 + src = (int *)(KERNELBASE + PHYSICAL_START);
153 + dest = (int *)KERNELBASE;
154 + length = (__end_interrupts - _stext) / sizeof(int);
155 +
156 + while (length--) {
157 + patch_instruction(dest, *src);
158 + src++;
159 + dest++;
160 + }
161 +#endif
162 +}
163 +
164 #ifdef CONFIG_FTR_FIXUP_SELFTEST
165
166 #define check(x) \
167 diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
168 index 600ed2c..1aa478b 100644
169 --- a/arch/powerpc/platforms/ps3/interrupt.c
170 +++ b/arch/powerpc/platforms/ps3/interrupt.c
171 @@ -88,6 +88,7 @@ struct ps3_private {
172 struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));
173 u64 ppe_id;
174 u64 thread_id;
175 + unsigned long ipi_mask;
176 };
177
178 static DEFINE_PER_CPU(struct ps3_private, ps3_private);
179 @@ -144,7 +145,11 @@ static void ps3_chip_unmask(struct irq_data *d)
180 static void ps3_chip_eoi(struct irq_data *d)
181 {
182 const struct ps3_private *pd = irq_data_get_irq_chip_data(d);
183 - lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
184 +
185 + /* non-IPIs are EOIed here. */
186 +
187 + if (!test_bit(63 - d->irq, &pd->ipi_mask))
188 + lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
189 }
190
191 /**
192 @@ -691,6 +696,16 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
193 cpu, virq, pd->bmp.ipi_debug_brk_mask);
194 }
195
196 +void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq)
197 +{
198 + struct ps3_private *pd = &per_cpu(ps3_private, cpu);
199 +
200 + set_bit(63 - virq, &pd->ipi_mask);
201 +
202 + DBG("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n", __func__, __LINE__,
203 + cpu, virq, pd->ipi_mask);
204 +}
205 +
206 static unsigned int ps3_get_irq(void)
207 {
208 struct ps3_private *pd = &__get_cpu_var(ps3_private);
209 @@ -720,6 +735,12 @@ static unsigned int ps3_get_irq(void)
210 BUG();
211 }
212 #endif
213 +
214 + /* IPIs are EOIed here. */
215 +
216 + if (test_bit(63 - plug, &pd->ipi_mask))
217 + lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, plug);
218 +
219 return plug;
220 }
221
222 diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
223 index 9a196a8..1a633ed 100644
224 --- a/arch/powerpc/platforms/ps3/platform.h
225 +++ b/arch/powerpc/platforms/ps3/platform.h
226 @@ -43,6 +43,7 @@ void ps3_mm_shutdown(void);
227 void ps3_init_IRQ(void);
228 void ps3_shutdown_IRQ(int cpu);
229 void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq);
230 +void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);
231
232 /* smp */
233
234 diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
235 index 4c44794..f609345 100644
236 --- a/arch/powerpc/platforms/ps3/smp.c
237 +++ b/arch/powerpc/platforms/ps3/smp.c
238 @@ -94,6 +94,8 @@ static void __init ps3_smp_setup_cpu(int cpu)
239
240 if (result)
241 virqs[i] = NO_IRQ;
242 + else
243 + ps3_register_ipi_irq(cpu, virqs[i]);
244 }
245
246 ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]);
247 diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
248 index 822d608..abcc4dc 100644
249 --- a/arch/sh/include/asm/page.h
250 +++ b/arch/sh/include/asm/page.h
251 @@ -141,8 +141,13 @@ typedef struct page *pgtable_t;
252 #endif /* !__ASSEMBLY__ */
253
254 #ifdef CONFIG_UNCACHED_MAPPING
255 +#if defined(CONFIG_29BIT)
256 +#define UNCAC_ADDR(addr) P2SEGADDR(addr)
257 +#define CAC_ADDR(addr) P1SEGADDR(addr)
258 +#else
259 #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
260 #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
261 +#endif
262 #else
263 #define UNCAC_ADDR(addr) ((addr))
264 #define CAC_ADDR(addr) ((addr))
265 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
266 index 2d69617..46c8069 100644
267 --- a/arch/x86/xen/enlighten.c
268 +++ b/arch/x86/xen/enlighten.c
269 @@ -1355,7 +1355,7 @@ static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self,
270 int cpu = (long)hcpu;
271 switch (action) {
272 case CPU_UP_PREPARE:
273 - per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
274 + xen_vcpu_setup(cpu);
275 if (xen_have_vector_callback)
276 xen_init_lock_cpu(cpu);
277 break;
278 @@ -1385,7 +1385,6 @@ static void __init xen_hvm_guest_init(void)
279 xen_hvm_smp_init();
280 register_cpu_notifier(&xen_hvm_cpu_notifier);
281 xen_unplug_emulated_devices();
282 - have_vcpu_info_placement = 0;
283 x86_init.irqs.intr_init = xen_init_IRQ;
284 xen_hvm_init_time_ops();
285 xen_hvm_init_mmu_ops();
286 diff --git a/block/blk-map.c b/block/blk-map.c
287 index e663ac2..164cd00 100644
288 --- a/block/blk-map.c
289 +++ b/block/blk-map.c
290 @@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
291 if (!iov[i].iov_len)
292 return -EINVAL;
293
294 - if (uaddr & queue_dma_alignment(q)) {
295 + /*
296 + * Keep going so we check length of all segments
297 + */
298 + if (uaddr & queue_dma_alignment(q))
299 unaligned = 1;
300 - break;
301 - }
302 }
303
304 if (unaligned || (q->dma_pad_mask & len) || map_data)
305 diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
306 index a546a71..346d557 100644
307 --- a/drivers/gpu/drm/i915/i915_gem.c
308 +++ b/drivers/gpu/drm/i915/i915_gem.c
309 @@ -1475,7 +1475,7 @@ i915_gem_mmap_gtt(struct drm_file *file,
310
311 if (obj->base.size > dev_priv->mm.gtt_mappable_end) {
312 ret = -E2BIG;
313 - goto unlock;
314 + goto out;
315 }
316
317 if (obj->madv != I915_MADV_WILLNEED) {
318 diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
319 index b0d753f..0e3241c 100644
320 --- a/drivers/gpu/drm/nouveau/nouveau_channel.c
321 +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
322 @@ -158,6 +158,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
323 INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
324 INIT_LIST_HEAD(&chan->nvsw.flip);
325 INIT_LIST_HEAD(&chan->fence.pending);
326 + spin_lock_init(&chan->fence.lock);
327
328 /* setup channel's memory and vm */
329 ret = nouveau_gpuobj_channel_init(chan, vram_handle, gart_handle);
330 diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
331 index c919cfc..ae22dfa 100644
332 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c
333 +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
334 @@ -539,8 +539,6 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
335 return ret;
336 }
337
338 - INIT_LIST_HEAD(&chan->fence.pending);
339 - spin_lock_init(&chan->fence.lock);
340 atomic_set(&chan->fence.last_sequence_irq, 0);
341 return 0;
342 }
343 diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
344 index b5628ce..3b77ad6 100644
345 --- a/drivers/gpu/drm/radeon/atombios_dp.c
346 +++ b/drivers/gpu/drm/radeon/atombios_dp.c
347 @@ -283,7 +283,7 @@ int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
348 }
349 }
350
351 - DRM_ERROR("aux i2c too many retries, giving up\n");
352 + DRM_DEBUG_KMS("aux i2c too many retries, giving up\n");
353 return -EREMOTEIO;
354 }
355
356 diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
357 index 661b692..6d5628b 100644
358 --- a/drivers/leds/led-class.c
359 +++ b/drivers/leds/led-class.c
360 @@ -270,11 +270,8 @@ void led_blink_set(struct led_classdev *led_cdev,
361 del_timer_sync(&led_cdev->blink_timer);
362
363 if (led_cdev->blink_set &&
364 - !led_cdev->blink_set(led_cdev, delay_on, delay_off)) {
365 - led_cdev->blink_delay_on = *delay_on;
366 - led_cdev->blink_delay_off = *delay_off;
367 + !led_cdev->blink_set(led_cdev, delay_on, delay_off))
368 return;
369 - }
370
371 /* blink with 1 Hz as default if nothing specified */
372 if (!*delay_on && !*delay_off)
373 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
374 index 01ecfee..b8eef46 100644
375 --- a/drivers/mfd/twl-core.c
376 +++ b/drivers/mfd/twl-core.c
377 @@ -109,7 +109,7 @@
378 #define twl_has_watchdog() false
379 #endif
380
381 -#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
382 +#if defined(CONFIG_MFD_TWL4030_AUDIO) || defined(CONFIG_MFD_TWL4030_AUDIO_MODULE) ||\
383 defined(CONFIG_TWL6040_CORE) || defined(CONFIG_TWL6040_CORE_MODULE)
384 #define twl_has_codec() true
385 #else
386 diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
387 index e293a79..fdb4df2 100644
388 --- a/drivers/net/wireless/b43/main.c
389 +++ b/drivers/net/wireless/b43/main.c
390 @@ -2508,6 +2508,13 @@ static int b43_upload_microcode(struct b43_wldev *dev)
391 b43_print_fw_helptext(dev->wl, 1);
392 err = -EOPNOTSUPP;
393 goto error;
394 + } else if (fwrev >= 598) {
395 + b43err(dev->wl, "YOUR FIRMWARE IS TOO NEW. Support for "
396 + "firmware 598 and up requires kernel 3.2 or newer. You "
397 + "have to install older firmware or upgrade kernel.\n");
398 + b43_print_fw_helptext(dev->wl, 1);
399 + err = -EOPNOTSUPP;
400 + goto error;
401 }
402 dev->fw.rev = fwrev;
403 dev->fw.patch = fwpatch;
404 diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
405 index d6de44e..3cb92fc 100644
406 --- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
407 +++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
408 @@ -975,6 +975,10 @@ static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
409 .hw_value = (rate100m / 5), \
410 }
411
412 +/*
413 + * The rate table is used for both 2.4G and 5G rates. The
414 + * latter being a subset as it does not support CCK rates.
415 + */
416 static struct ieee80211_rate legacy_ratetable[] = {
417 RATE(10, 0),
418 RATE(20, IEEE80211_RATE_SHORT_PREAMBLE),
419 @@ -1016,8 +1020,9 @@ static struct ieee80211_supported_band brcms_band_5GHz_nphy = {
420 .band = IEEE80211_BAND_5GHZ,
421 .channels = brcms_5ghz_nphy_chantable,
422 .n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
423 - .bitrates = legacy_ratetable + 4,
424 - .n_bitrates = ARRAY_SIZE(legacy_ratetable) - 4,
425 + .bitrates = legacy_ratetable + BRCMS_LEGACY_5G_RATE_OFFSET,
426 + .n_bitrates = ARRAY_SIZE(legacy_ratetable) -
427 + BRCMS_LEGACY_5G_RATE_OFFSET,
428 .ht_cap = {
429 /* use IEEE80211_HT_CAP_* from include/linux/ieee80211.h */
430 .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT, /* No 40 mhz yet */
431 diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
432 index 40e3d37..3be8655 100644
433 --- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
434 +++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
435 @@ -20,6 +20,12 @@
436 #include <linux/timer.h>
437 #include <linux/interrupt.h>
438
439 +/*
440 + * Starting index for 5G rates in the
441 + * legacy rate table.
442 + */
443 +#define BRCMS_LEGACY_5G_RATE_OFFSET 4
444 +
445 /* softmac ioctl definitions */
446 #define BRCMS_SET_SHORTSLOT_OVERRIDE 146
447
448 diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
449 index 1763c45..9654163 100644
450 --- a/drivers/staging/brcm80211/brcmsmac/main.c
451 +++ b/drivers/staging/brcm80211/brcmsmac/main.c
452 @@ -4608,6 +4608,14 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
453 wiphy_err(wlc->wiphy, "%s: Unknown rate\n", __func__);
454 }
455
456 + /*
457 + * For 5GHz, we should decrease the index as it is
458 + * a subset of the 2.4G rates. See bitrates field
459 + * of brcms_band_5GHz_nphy (in mac80211_if.c).
460 + */
461 + if (rx_status->band == IEEE80211_BAND_5GHZ)
462 + rx_status->rate_idx -= BRCMS_LEGACY_5G_RATE_OFFSET;
463 +
464 /* Determine short preamble and rate_idx */
465 preamble = 0;
466 if (IS_CCK(rspec)) {
467 diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
468 index 4bcc8b8..ecb9254 100644
469 --- a/drivers/virtio/virtio_pci.c
470 +++ b/drivers/virtio/virtio_pci.c
471 @@ -590,11 +590,11 @@ static struct virtio_config_ops virtio_pci_config_ops = {
472
473 static void virtio_pci_release_dev(struct device *_d)
474 {
475 - struct virtio_device *dev = container_of(_d, struct virtio_device,
476 - dev);
477 - struct virtio_pci_device *vp_dev = to_vp_device(dev);
478 -
479 - kfree(vp_dev);
480 + /*
481 + * No need for a release method as we allocate/free
482 + * all devices together with the pci devices.
483 + * Provide an empty one to avoid getting a warning from core.
484 + */
485 }
486
487 /* the PCI probing function */
488 @@ -682,6 +682,7 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
489 pci_iounmap(pci_dev, vp_dev->ioaddr);
490 pci_release_regions(pci_dev);
491 pci_disable_device(pci_dev);
492 + kfree(vp_dev);
493 }
494
495 #ifdef CONFIG_PM
496 diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
497 index f6832f4..e1c4c6e 100644
498 --- a/drivers/xen/gntalloc.c
499 +++ b/drivers/xen/gntalloc.c
500 @@ -135,7 +135,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op,
501 /* Grant foreign access to the page. */
502 gref->gref_id = gnttab_grant_foreign_access(op->domid,
503 pfn_to_mfn(page_to_pfn(gref->page)), readonly);
504 - if (gref->gref_id < 0) {
505 + if ((int)gref->gref_id < 0) {
506 rc = gref->gref_id;
507 goto undo;
508 }
509 @@ -280,7 +280,7 @@ static long gntalloc_ioctl_alloc(struct gntalloc_file_private_data *priv,
510 goto out;
511 }
512
513 - gref_ids = kzalloc(sizeof(gref_ids[0]) * op.count, GFP_TEMPORARY);
514 + gref_ids = kcalloc(op.count, sizeof(gref_ids[0]), GFP_TEMPORARY);
515 if (!gref_ids) {
516 rc = -ENOMEM;
517 goto out;
518 diff --git a/fs/hfs/trans.c b/fs/hfs/trans.c
519 index e673a88..b1ce4c7 100644
520 --- a/fs/hfs/trans.c
521 +++ b/fs/hfs/trans.c
522 @@ -40,6 +40,8 @@ int hfs_mac2asc(struct super_block *sb, char *out, const struct hfs_name *in)
523
524 src = in->name;
525 srclen = in->len;
526 + if (srclen > HFS_NAMELEN)
527 + srclen = HFS_NAMELEN;
528 dst = out;
529 dstlen = HFS_MAX_NAMELEN;
530 if (nls_io) {
531 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
532 index 3d53efd..f81676f 100644
533 --- a/include/drm/drm_pciids.h
534 +++ b/include/drm/drm_pciids.h
535 @@ -4,6 +4,7 @@
536 */
537 #define radeon_PCI_IDS \
538 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
539 + {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
540 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
541 {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
542 {0x1002, 0x3155, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
543 @@ -55,6 +56,7 @@
544 {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
545 {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
546 {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \
547 + {0x1002, 0x4C6E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \
548 {0x1002, 0x4E44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
549 {0x1002, 0x4E45, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
550 {0x1002, 0x4E46, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
551 diff --git a/mm/backing-dev.c b/mm/backing-dev.c
552 index a87da52..253b071 100644
553 --- a/mm/backing-dev.c
554 +++ b/mm/backing-dev.c
555 @@ -720,6 +720,14 @@ void bdi_destroy(struct backing_dev_info *bdi)
556
557 bdi_unregister(bdi);
558
559 + /*
560 + * If bdi_unregister() had already been called earlier, the
561 + * wakeup_timer could still be armed because bdi_prune_sb()
562 + * can race with the bdi_wakeup_thread_delayed() calls from
563 + * __mark_inode_dirty().
564 + */
565 + del_timer_sync(&bdi->wb.wakeup_timer);
566 +
567 for (i = 0; i < NR_BDI_STAT_ITEMS; i++)
568 percpu_counter_destroy(&bdi->bdi_stat[i]);
569
570 diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c
571 index 5b366d7..69ff52c 100644
572 --- a/security/keys/user_defined.c
573 +++ b/security/keys/user_defined.c
574 @@ -102,7 +102,8 @@ int user_update(struct key *key, const void *data, size_t datalen)
575 key->expiry = 0;
576 }
577
578 - kfree_rcu(zap, rcu);
579 + if (zap)
580 + kfree_rcu(zap, rcu);
581
582 error:
583 return ret;
584 diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
585 index f3aefef..3a1b47a 100644
586 --- a/sound/pci/hda/hda_codec.c
587 +++ b/sound/pci/hda/hda_codec.c
588 @@ -2296,6 +2296,39 @@ int snd_hda_codec_reset(struct hda_codec *codec)
589 return 0;
590 }
591
592 +typedef int (*map_slave_func_t)(void *, struct snd_kcontrol *);
593 +
594 +/* apply the function to all matching slave ctls in the mixer list */
595 +static int map_slaves(struct hda_codec *codec, const char * const *slaves,
596 + map_slave_func_t func, void *data)
597 +{
598 + struct hda_nid_item *items;
599 + const char * const *s;
600 + int i, err;
601 +
602 + items = codec->mixers.list;
603 + for (i = 0; i < codec->mixers.used; i++) {
604 + struct snd_kcontrol *sctl = items[i].kctl;
605 + if (!sctl || !sctl->id.name ||
606 + sctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER)
607 + continue;
608 + for (s = slaves; *s; s++) {
609 + if (!strcmp(sctl->id.name, *s)) {
610 + err = func(data, sctl);
611 + if (err)
612 + return err;
613 + break;
614 + }
615 + }
616 + }
617 + return 0;
618 +}
619 +
620 +static int check_slave_present(void *data, struct snd_kcontrol *sctl)
621 +{
622 + return 1;
623 +}
624 +
625 /**
626 * snd_hda_add_vmaster - create a virtual master control and add slaves
627 * @codec: HD-audio codec
628 @@ -2316,12 +2349,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
629 unsigned int *tlv, const char * const *slaves)
630 {
631 struct snd_kcontrol *kctl;
632 - const char * const *s;
633 int err;
634
635 - for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
636 - ;
637 - if (!*s) {
638 + err = map_slaves(codec, slaves, check_slave_present, NULL);
639 + if (err != 1) {
640 snd_printdd("No slave found for %s\n", name);
641 return 0;
642 }
643 @@ -2332,23 +2363,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
644 if (err < 0)
645 return err;
646
647 - for (s = slaves; *s; s++) {
648 - struct snd_kcontrol *sctl;
649 - int i = 0;
650 - for (;;) {
651 - sctl = _snd_hda_find_mixer_ctl(codec, *s, i);
652 - if (!sctl) {
653 - if (!i)
654 - snd_printdd("Cannot find slave %s, "
655 - "skipped\n", *s);
656 - break;
657 - }
658 - err = snd_ctl_add_slave(kctl, sctl);
659 - if (err < 0)
660 - return err;
661 - i++;
662 - }
663 - }
664 + err = map_slaves(codec, slaves, (map_slave_func_t)snd_ctl_add_slave,
665 + kctl);
666 + if (err < 0)
667 + return err;
668 return 0;
669 }
670 EXPORT_SYMBOL_HDA(snd_hda_add_vmaster);
671 diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
672 index d0671a8..7ed9011 100644
673 --- a/sound/pci/hda/patch_sigmatel.c
674 +++ b/sound/pci/hda/patch_sigmatel.c
675 @@ -94,6 +94,7 @@ enum {
676 STAC_92HD83XXX_REF,
677 STAC_92HD83XXX_PWR_REF,
678 STAC_DELL_S14,
679 + STAC_DELL_VOSTRO_3500,
680 STAC_92HD83XXX_HP,
681 STAC_92HD83XXX_HP_cNB11_INTQUAD,
682 STAC_HP_DV7_4000,
683 @@ -1658,6 +1659,12 @@ static const unsigned int dell_s14_pin_configs[10] = {
684 0x40f000f0, 0x40f000f0,
685 };
686
687 +static const unsigned int dell_vostro_3500_pin_configs[10] = {
688 + 0x02a11020, 0x0221101f, 0x400000f0, 0x90170110,
689 + 0x400000f1, 0x400000f2, 0x400000f3, 0x90a60160,
690 + 0x400000f4, 0x400000f5,
691 +};
692 +
693 static const unsigned int hp_dv7_4000_pin_configs[10] = {
694 0x03a12050, 0x0321201f, 0x40f000f0, 0x90170110,
695 0x40f000f0, 0x40f000f0, 0x90170110, 0xd5a30140,
696 @@ -1674,6 +1681,7 @@ static const unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
697 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
698 [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
699 [STAC_DELL_S14] = dell_s14_pin_configs,
700 + [STAC_DELL_VOSTRO_3500] = dell_vostro_3500_pin_configs,
701 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = hp_cNB11_intquad_pin_configs,
702 [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
703 };
704 @@ -1683,6 +1691,7 @@ static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
705 [STAC_92HD83XXX_REF] = "ref",
706 [STAC_92HD83XXX_PWR_REF] = "mic-ref",
707 [STAC_DELL_S14] = "dell-s14",
708 + [STAC_DELL_VOSTRO_3500] = "dell-vostro-3500",
709 [STAC_92HD83XXX_HP] = "hp",
710 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = "hp_cNB11_intquad",
711 [STAC_HP_DV7_4000] = "hp-dv7-4000",
712 @@ -1696,6 +1705,8 @@ static const struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
713 "DFI LanParty", STAC_92HD83XXX_REF),
714 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
715 "unknown Dell", STAC_DELL_S14),
716 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x1028,
717 + "Dell Vostro 3500", STAC_DELL_VOSTRO_3500),
718 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x3600,
719 "HP", STAC_92HD83XXX_HP),
720 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1656,
721 diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
722 index 8468363..fa0a480 100644
723 --- a/sound/soc/codecs/wm8994.c
724 +++ b/sound/soc/codecs/wm8994.c
725 @@ -56,7 +56,7 @@ static int wm8994_retune_mobile_base[] = {
726 static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg)
727 {
728 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
729 - struct wm8994 *control = wm8994->control_data;
730 + struct wm8994 *control = codec->control_data;
731
732 switch (reg) {
733 case WM8994_GPIO_1:
734 diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
735 index cdd19d7..0de7cbd 100644
736 --- a/sound/usb/mixer.c
737 +++ b/sound/usb/mixer.c
738 @@ -765,10 +765,60 @@ static void usb_mixer_elem_free(struct snd_kcontrol *kctl)
739 * interface to ALSA control for feature/mixer units
740 */
741
742 +/* volume control quirks */
743 +static void volume_control_quirks(struct usb_mixer_elem_info *cval,
744 + struct snd_kcontrol *kctl)
745 +{
746 + switch (cval->mixer->chip->usb_id) {
747 + case USB_ID(0x0471, 0x0101):
748 + case USB_ID(0x0471, 0x0104):
749 + case USB_ID(0x0471, 0x0105):
750 + case USB_ID(0x0672, 0x1041):
751 + /* quirk for UDA1321/N101.
752 + * note that detection between firmware 2.1.1.7 (N101)
753 + * and later 2.1.1.21 is not very clear from datasheets.
754 + * I hope that the min value is -15360 for newer firmware --jk
755 + */
756 + if (!strcmp(kctl->id.name, "PCM Playback Volume") &&
757 + cval->min == -15616) {
758 + snd_printk(KERN_INFO
759 + "set volume quirk for UDA1321/N101 chip\n");
760 + cval->max = -256;
761 + }
762 + break;
763 +
764 + case USB_ID(0x046d, 0x09a4):
765 + if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
766 + snd_printk(KERN_INFO
767 + "set volume quirk for QuickCam E3500\n");
768 + cval->min = 6080;
769 + cval->max = 8768;
770 + cval->res = 192;
771 + }
772 + break;
773 +
774 + case USB_ID(0x046d, 0x0808):
775 + case USB_ID(0x046d, 0x0809):
776 + case USB_ID(0x046d, 0x0991):
777 + /* Most audio usb devices lie about volume resolution.
778 + * Most Logitech webcams have res = 384.
779 + * Proboly there is some logitech magic behind this number --fishor
780 + */
781 + if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
782 + snd_printk(KERN_INFO
783 + "set resolution quirk: cval->res = 384\n");
784 + cval->res = 384;
785 + }
786 + break;
787 +
788 + }
789 +}
790 +
791 /*
792 * retrieve the minimum and maximum values for the specified control
793 */
794 -static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)
795 +static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval,
796 + int default_min, struct snd_kcontrol *kctl)
797 {
798 /* for failsafe */
799 cval->min = default_min;
800 @@ -844,6 +894,9 @@ static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)
801 cval->initialized = 1;
802 }
803
804 + if (kctl)
805 + volume_control_quirks(cval, kctl);
806 +
807 /* USB descriptions contain the dB scale in 1/256 dB unit
808 * while ALSA TLV contains in 1/100 dB unit
809 */
810 @@ -864,6 +917,7 @@ static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)
811 return 0;
812 }
813
814 +#define get_min_max(cval, def) get_min_max_with_quirks(cval, def, NULL)
815
816 /* get a feature/mixer unit info */
817 static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
818 @@ -881,8 +935,17 @@ static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
819 uinfo->value.integer.min = 0;
820 uinfo->value.integer.max = 1;
821 } else {
822 - if (! cval->initialized)
823 - get_min_max(cval, 0);
824 + if (!cval->initialized) {
825 + get_min_max_with_quirks(cval, 0, kcontrol);
826 + if (cval->initialized && cval->dBmin >= cval->dBmax) {
827 + kcontrol->vd[0].access &=
828 + ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |
829 + SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK);
830 + snd_ctl_notify(cval->mixer->chip->card,
831 + SNDRV_CTL_EVENT_MASK_INFO,
832 + &kcontrol->id);
833 + }
834 + }
835 uinfo->value.integer.min = 0;
836 uinfo->value.integer.max =
837 (cval->max - cval->min + cval->res - 1) / cval->res;
838 @@ -1036,9 +1099,6 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
839 cval->ch_readonly = readonly_mask;
840 }
841
842 - /* get min/max values */
843 - get_min_max(cval, 0);
844 -
845 /* if all channels in the mask are marked read-only, make the control
846 * read-only. set_cur_mix_value() will check the mask again and won't
847 * issue write commands to read-only channels. */
848 @@ -1060,6 +1120,9 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
849 len = snd_usb_copy_string_desc(state, nameid,
850 kctl->id.name, sizeof(kctl->id.name));
851
852 + /* get min/max values */
853 + get_min_max_with_quirks(cval, 0, kctl);
854 +
855 switch (control) {
856 case UAC_FU_MUTE:
857 case UAC_FU_VOLUME:
858 @@ -1109,51 +1172,6 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
859 break;
860 }
861
862 - /* volume control quirks */
863 - switch (state->chip->usb_id) {
864 - case USB_ID(0x0471, 0x0101):
865 - case USB_ID(0x0471, 0x0104):
866 - case USB_ID(0x0471, 0x0105):
867 - case USB_ID(0x0672, 0x1041):
868 - /* quirk for UDA1321/N101.
869 - * note that detection between firmware 2.1.1.7 (N101)
870 - * and later 2.1.1.21 is not very clear from datasheets.
871 - * I hope that the min value is -15360 for newer firmware --jk
872 - */
873 - if (!strcmp(kctl->id.name, "PCM Playback Volume") &&
874 - cval->min == -15616) {
875 - snd_printk(KERN_INFO
876 - "set volume quirk for UDA1321/N101 chip\n");
877 - cval->max = -256;
878 - }
879 - break;
880 -
881 - case USB_ID(0x046d, 0x09a4):
882 - if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
883 - snd_printk(KERN_INFO
884 - "set volume quirk for QuickCam E3500\n");
885 - cval->min = 6080;
886 - cval->max = 8768;
887 - cval->res = 192;
888 - }
889 - break;
890 -
891 - case USB_ID(0x046d, 0x0808):
892 - case USB_ID(0x046d, 0x0809):
893 - case USB_ID(0x046d, 0x0991):
894 - /* Most audio usb devices lie about volume resolution.
895 - * Most Logitech webcams have res = 384.
896 - * Proboly there is some logitech magic behind this number --fishor
897 - */
898 - if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
899 - snd_printk(KERN_INFO
900 - "set resolution quirk: cval->res = 384\n");
901 - cval->res = 384;
902 - }
903 - break;
904 -
905 - }
906 -
907 range = (cval->max - cval->min) / cval->res;
908 /* Are there devices with volume range more than 255? I use a bit more
909 * to be sure. 384 is a resolution magic number found on Logitech