4 stable kernel review cycles starting
Subsystems (111)
Hi all,
Well, I up and moved cities and caused a bunch of stable patches to be backlogged. I've caught up with all of the ones that were marked as being wished to be applied to the stable trees, and still have a bunch of pending requests still queued up in my mailbox.
But, due to the number of the current patches already applied, it is time to just let these go and work on the other pending stuff after this.
So don't worry, if anyone has asked for some patches to be applied to some stable trees, and you don't see it here, just give it some time, I'm still catching up on things (hey, I'm just happy I have an internet connection again...)
Oh, and yes, here's a .31 update. I had a bunch of pending patches for that tree sitting around, and thought it wise to just push it out for the distros that still rely on it to sync up and make sure they get all of the bugfixes that are known. I don't think I'll do another .31 releaase again, just this once.
thanks,
greg "surrounded by boxes" k-h
cover 2.6.32.11-stable review
This is the start of the stable review cycle for the 2.6.32.11 release. There are 116 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by April 1, 2010, 22:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.32.11-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/filesystems/tmpfs.txt | 6 +- Makefile | 2 +- arch/arm/boot/compressed/head.S | 50 ++++---- arch/arm/boot/compressed/vmlinux.lds.in | 3 + arch/mips/mm/tlbex.c | 8 - arch/sh/boot/compressed/misc.c | 2 +- arch/sparc/prom/p1275.c | 10 +- arch/x86/include/asm/fixmap.h | 6 +- arch/x86/include/asm/msr-index.h | 2 + arch/x86/kernel/acpi/boot.c | 5 - arch/x86/kernel/apic/apic.c | 14 -- arch/x86/kernel/apic/probe_32.c | 27 ++++- arch/x86/kernel/apic/probe_64.c | 13 +-- arch/x86/kernel/cpu/intel.c | 3 +- arch/x86/kernel/mpparse.c | 7 - arch/x86/kernel/process.c | 32 ++++- arch/x86/kernel/process_64.c | 1 + arch/x86/kernel/smpboot.c | 2 - block/blk-settings.c | 93 ++++++++++---- drivers/ata/ahci.c | 28 +++- drivers/char/tty_buffer.c | 6 +- drivers/edac/edac_mce_amd.c | 8 +- drivers/gpu/drm/drm_edid.c | 163 +++++++++--------------- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem.c | 21 ++-- drivers/gpu/drm/i915/intel_bios.c | 4 - drivers/gpu/drm/i915/intel_crt.c | 2 +- drivers/hwmon/coretemp.c | 2 +- drivers/i2c/busses/i2c-i801.c | 6 +- drivers/input/mouse/alps.c | 2 + drivers/input/serio/i8042-x86ia64io.h | 7 + drivers/input/tablet/wacom.h | 7 +- drivers/input/tablet/wacom_sys.c | 7 +- drivers/isdn/gigaset/ev-layer.c | 12 +- drivers/isdn/gigaset/interface.c | 1 - drivers/leds/leds-gpio.c | 3 +- drivers/media/video/em28xx/em28xx-dvb.c | 1 + drivers/mmc/host/s3cmci.c | 2 + drivers/net/e1000e/hw.h | 1 + drivers/net/e1000e/ich8lan.c | 1 + drivers/net/e1000e/netdev.c | 1 + drivers/net/ixgbe/ixgbe_82599.c | 1 + drivers/net/ixgbe/ixgbe_main.c | 2 + drivers/net/ixgbe/ixgbe_type.h | 1 + drivers/net/jme.c | 35 +++++ drivers/net/tg3.c | 23 +++- drivers/net/tg3.h | 3 + drivers/net/wireless/ath/ath5k/ath5k.h | 2 +- drivers/net/wireless/ath/ath5k/base.c | 22 +++- drivers/net/wireless/ath/ath5k/qcu.c | 5 +- drivers/net/wireless/ath/ath5k/reset.c | 5 +- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/main.c | 26 ++-- drivers/net/wireless/ath/ath9k/xmit.c | 32 +---- drivers/net/wireless/b43/main.c | 11 +- drivers/net/wireless/iwlwifi/iwl-3945.c | 8 +- drivers/net/wireless/iwlwifi/iwl-core.c | 12 +- drivers/net/wireless/iwlwifi/iwl-helpers.h | 7 +- drivers/net/wireless/iwlwifi/iwl-rx.c | 21 ++-- drivers/net/wireless/iwlwifi/iwl-tx.c | 25 ++-- drivers/net/wireless/iwlwifi/iwl3945-base.c | 16 +- drivers/net/wireless/wl12xx/wl1251_debugfs.c | 3 +- drivers/pci/pci.c | 43 +++---- drivers/pci/pcie/aer/aerdrv_core.c | 10 +- drivers/pci/quirks.c | 34 +++++ drivers/scsi/mvsas/mv_init.c | 1 + drivers/scsi/scsi_transport_fc.c | 24 ++-- drivers/scsi/ses.c | 4 +- drivers/staging/rt2860/common/2860_rtmp_init.c | 2 +- drivers/usb/core/devio.c | 17 ++- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-sched.c | 28 +++- drivers/usb/host/ehci.h | 5 +- drivers/usb/host/r8a66597-hcd.c | 16 ++- drivers/usb/host/xhci-hcd.c | 1 + drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 7 + drivers/usb/serial/option.c | 7 +- drivers/usb/serial/qcserial.c | 29 ++++ drivers/video/efifb.c | 11 ++- drivers/virtio/virtio_pci.c | 3 +- fs/exec.c | 3 +- fs/gfs2/file.c | 2 +- fs/nfs/delegation.h | 6 + fs/nfs/dir.c | 2 +- fs/nfs/file.c | 3 +- fs/nfs/inode.c | 2 +- fs/nfs/pagelist.c | 23 ++-- fs/partitions/msdos.c | 85 +++++++------ fs/quota/dquot.c | 45 ++++++- include/linux/decompress/mm.h | 14 ++- include/linux/hrtimer.h | 13 ++- include/linux/if_tunnel.h | 1 + include/linux/lcm.h | 8 + include/linux/quotaops.h | 11 ++- include/linux/tty.h | 11 ++ include/net/mac80211.h | 4 + init/main.c | 9 +- ipc/mqueue.c | 3 +- kernel/cpuset.c | 20 ++- kernel/hrtimer.c | 96 ++++++++------ kernel/kthread.c | 2 +- kernel/perf_event.c | 13 ++- kernel/sched.c | 76 ++++++----- kernel/softlockup.c | 4 +- kernel/time/clocksource.c | 4 + kernel/time/timer_list.c | 5 +- kernel/trace/ftrace.c | 2 +- kernel/trace/ring_buffer.c | 12 +- kernel/trace/trace.c | 24 +++- lib/Makefile | 2 +- lib/lcm.c | 15 ++ mm/mempolicy.c | 40 ++++-- mm/readahead.c | 12 ++ net/bluetooth/l2cap.c | 15 ++- net/bluetooth/rfcomm/core.c | 15 ++- net/bluetooth/rfcomm/sock.c | 11 ++- net/bluetooth/sco.c | 11 ++- net/mac80211/ieee80211_i.h | 1 + net/mac80211/main.c | 15 ++ net/mac80211/mlme.c | 20 ++- net/mac80211/rx.c | 8 + net/netfilter/xt_recent.c | 2 +- net/sunrpc/auth_gss/auth_gss.c | 5 +- net/sunrpc/rpc_pipe.c | 2 + security/min_addr.c | 3 + sound/pci/ac97/ac97_patch.c | 2 + sound/pci/cmipci.c | 14 ++- sound/pci/hda/hda_intel.c | 10 ++ sound/pci/hda/patch_conexant.c | 15 ++ sound/pci/hda/patch_realtek.c | 11 ++- tools/perf/Documentation/Makefile | 4 +- tools/perf/Makefile | 4 +- 133 files changed, 1170 insertions(+), 649 deletions(-)
PATCH 1/116 drm/i915: fix gpio register detection logic for BIOS without VBT
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shaohua Li <[email protected]>
commit 29874f44fbcbc24b231b42c9956f8f9de9407231 upstream.
if no VBT is present, crt_ddc_bus will be left at 0, and cause us to use that for the GPIO register offset. That's never a valid register offset, so let the "undefined" value be 0 instead of -1.
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_bios.c | 4 ---- drivers/gpu/drm/i915/intel_crt.c | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -258,7 +258,7 @@ typedef struct drm_i915_private {struct notifier_block lid_notifier; -int crt_ddc_bus;/* -1 = unknown, else GPIO to use for CRT DDC */ +int crt_ddc_bus;/* 0 = unknown, else GPIO to use for CRT DDC */ struct drm_i915_fence_reg fence_regs[16 ];/* assume 965 */ int fence_reg_start;/* 4 if userland hasn't ioctl'd us yet */ int num_fence_regs;/* 8 on pre-965, 16 otherwise */
drivers/gpu/drm/i915/intel_bios.c +0 -4
@@ -241,10 +241,6 @@ parse_general_definitions(struct drm_i91 GPIOF, }; -/* Set sensible defaults in case we can't find the general block -or it is the wrong chipset */ - dev_priv->crt_ddc_bus =-1 ; - general =find_section (bdb,BDB_GENERAL_DEFINITIONS );if (general) {u16 block_size =get_blocksize (general);
drivers/gpu/drm/i915/intel_crt.c +1 -1
@@ -557,7 +557,7 @@ void intel_crt_init(struct drm_device *delse { i2c_reg =GPIOA ;/* Use VBT information for CRT DDC if available */ -if (dev_priv->crt_ddc_bus !=-1 ) +if (dev_priv->crt_ddc_bus !=0 ) i2c_reg = dev_priv->crt_ddc_bus; } intel_output->ddc_bus =intel_i2c_create (dev, i2c_reg,"CRTDDC_A" );
PATCH 2/116 drivers/scsi/ses.c: eliminate double free
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <[email protected]>
commit 9b3a6549b2602ca30f58715a0071e29f9898cae9 upstream.
The few lines below the kfree of hdr_buf may go to the label err_free which will also free hdr_buf. The most straightforward solution seems to be to just move the kfree of hdr_buf after these gotos.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier E;
expression E1;
iterator I;
statement S;
@@
*kfree(E);
... when != E = E1
when != I(E,...) S
when != &E*kfree(E);
// </smpl>
--- drivers/scsi/ses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/ses.c +2 -2
@@ -591,8 +591,6 @@ static int ses_intf_add(struct device *c ses_dev->page10_len = len; buf =NULL ; } -kfree (hdr_buf); - scomp =kzalloc (sizeof (struct ses_component ) * components,GFP_KERNEL );if (!scomp) goto err_free;
@@ -604,6 +602,8 @@ static int ses_intf_add(struct device *c goto err_free; } +kfree (hdr_buf); + edev->scratch = ses_dev;for (i =0 ; i < components; i++) edev->component[i].scratch = scomp + i;
PATCH 3/116 decompress: fix new decompressor for PIC
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Russell King <[email protected]>
commit 5ceaa2f39bfa73c4398cd01e78f1c3ebde3d3383 upstream.
The ARM kernel decompressor wants to be able to relocate r/w data independently from the rest of the image, and we do this by ensuring that r/w data has global visibility. Define STATIC_RW_DATA to be empty to achieve this.
--- include/linux/decompress/mm.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
include/linux/decompress/mm.h +12 -2
@@ -14,11 +14,21 @@/* Code active when included from pre-boot environment: */ +/* +* Some architectures want to ensure there is no local data in their +* pre-boot environment, so that data can arbitarily relocated (via +* GOT references). This is achieved by defining STATIC_RW_DATA to +* be null. +*/ +#ifndef STATIC_RW_DATA +#define STATIC_RW_DATA static +#endif +/* A trivial malloc implementation, adapted from * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 */ -static unsigned long malloc_ptr; -static int malloc_count; +STATIC_RW_DATA unsigned long malloc_ptr; +STATIC_RW_DATA int malloc_count;static void *malloc (int size) {
PATCH 4/116 ARM: Fix decompressors kernel size estimation for ROM=y
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Russell King <[email protected]>
commit 98e12b5a6e05413420a7e3b3eca7fbfc2ff41b6d upstream.
Commit 2552fc2 changed the way the decompressor decides if it is safe to decompress the kernel directly to its final location. Unfortunately, it took the top of the compressed data as being the stack pointer, which it is for ROM=n cases. However, for ROM=y, the stack pointer is not relevant, and results in the wrong answer.
Fix this by explicitly storing the end of the biggybacked data in the decompressor, and use that to calculate the compressed image size.
--- arch/arm/boot/compressed/head.S | 50 ++++++++++++++------------------ arch/arm/boot/compressed/vmlinux.lds.in | 3 + 2 files changed, 26 insertions(+), 27 deletions(-)
arch/arm/boot/compressed/head.S +23 -27
@@ -162,8 +162,8 @@ not_angel: .text adr r0, LC0 - ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, ip, sp} ) - THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, ip} ) + ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip, sp}) + THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip} ) THUMB( ldr sp, [r0, #28] ) subs r0, r0, r1 @ calculate the delta offset
@@ -174,12 +174,13 @@ not_angel: /* * We're running at a different address. We need to fix * up various pointers: - * r5 - zImage base address - * r6 - GOT start + * r5 - zImage base address (_start) + * r6 - size of decompressed image + * r11 - GOT start * ip - GOT end */ add r5, r5, r0 - add r6, r6, r0 + add r11, r11, r0 add ip, ip, r0 #ifndef CONFIG_ZBOOT_ROM
@@ -197,10 +198,10 @@ not_angel: /* * Relocate all entries in the GOT table. */ -1: ldr r1, [r6, #0] @ relocate entries in the GOT +1: ldr r1, [r11, #0] @ relocate entries in the GOT add r1, r1, r0 @ table. This fixes up the - str r1, [r6], #4 @ C references. - cmp r6, ip + str r1, [r11], #4 @ C references. + cmp r11, ip blo 1b #else
@@ -208,12 +209,12 @@ not_angel: * Relocate entries in the GOT table. We only relocate * the entries that are outside the (relocated) BSS region. */ -1: ldr r1, [r6, #0] @ relocate entries in the GOT +1: ldr r1, [r11, #0] @ relocate entries in the GOT cmp r1, r2 @ entry < bss_start || cmphs r3, r1 @ _end < entry addlo r1, r1, r0 @ table. This fixes up the - str r1, [r6], #4 @ C references. - cmp r6, ip + str r1, [r11], #4 @ C references. + cmp r11, ip blo 1b #endif
@@ -239,6 +240,7 @@ not_relocated: mov r0, #0 * Check to see if we will overwrite ourselves. * r4 = final kernel address * r5 = start of this image + * r6 = size of decompressed image * r2 = end of malloc space (and therefore this image) * We basically want: * r4 >= r2 -> OK
@@ -246,8 +248,7 @@ not_relocated: mov r0, #0 */ cmp r4, r2 bhs wont_overwrite - sub r3, sp, r5 @ > compressed kernel size - add r0, r4, r3, lsl #2 @ allow for 4x expansion + add r0, r4, r6 cmp r0, r5 bls wont_overwrite
@@ -263,7 +264,6 @@ not_relocated: mov r0, #0 * r1-r3 = unused * r4 = kernel execution address * r5 = decompressed kernel start - * r6 = processor ID * r7 = architecture ID * r8 = atags pointer * r9-r12,r14 = corrupted
@@ -304,7 +304,8 @@ LC0: .word LC0 @ r1 .word _end @ r3 .word zreladdr @ r4 .word _start @ r5 - .word _got_start @ r6 + .word _image_size @ r6 + .word _got_start @ r11 .word _got_end @ ip .word user_stack+4096 @ sp LC1: .word reloc_end - reloc_start
@@ -328,7 +329,6 @@ params: ldr r0, =params_phys * * On entry, * r4 = kernel execution address - * r6 = processor ID * r7 = architecture number * r8 = atags pointer * r9 = run-time address of "start" (???)
@@ -534,7 +534,6 @@ __common_mmu_cache_on: * r1-r3 = unused * r4 = kernel execution address * r5 = decompressed kernel start - * r6 = processor ID * r7 = architecture ID * r8 = atags pointer * r9-r12,r14 = corrupted
@@ -573,19 +572,19 @@ call_kernel: bl cache_clean_flush * r1 = corrupted * r2 = corrupted * r3 = block offset - * r6 = corrupted + * r9 = corrupted * r12 = corrupted */ call_cache_fn: adr r12, proc_types #ifdef CONFIG_CPU_CP15 - mrc p15, 0, r6, c0, c0 @ get processor ID + mrc p15, 0, r9, c0, c0 @ get processor ID #else - ldr r6, =CONFIG_PROCESSOR_ID + ldr r9, =CONFIG_PROCESSOR_ID #endif 1: ldr r1, [r12, #0] @ get value ldr r2, [r12, #4] @ get mask - eor r1, r1, r6 @ (real ^ match) + eor r1, r1, r9 @ (real ^ match) tst r1, r2 @ & mask ARM( addeq pc, r12, r3 ) @ call cache function THUMB( addeq r12, r3 )
@@ -764,8 +763,7 @@ proc_types: * Turn off the Cache and MMU. ARMv3 does not support * reading the control register, but ARMv4 does. * - * On entry, r6 = processor ID - * On exit, r0, r1, r2, r3, r12 corrupted + * On exit, r0, r1, r2, r3, r9, r12 corrupted * This routine must preserve: r4, r6, r7 */ .align 5
@@ -838,10 +836,8 @@ __armv3_mmu_cache_off: /* * Clean and flush the cache to maintain consistency. * - * On entry, - * r6 = processor ID * On exit, - * r1, r2, r3, r11, r12 corrupted + * r1, r2, r3, r9, r11, r12 corrupted * This routine must preserve: * r0, r4, r5, r6, r7 */
@@ -953,7 +949,7 @@ __armv4_mmu_cache_flush: mov r2, #64*1024 @ default: 32K dcache size (*2) mov r11, #32 @ default: 32 byte line size mrc p15, 0, r3, c0, c0, 1 @ read cache type - teq r3, r6 @ cache ID register present? + teq r3, r9 @ cache ID register present? beq no_cache_id mov r1, r3, lsr #18 and r1, r1, #7
arch/arm/boot/compressed/vmlinux.lds.in +3 -0
@@ -36,6 +36,9 @@ SECTIONS _etext = .; + /* Assume size of decompressed image is 4x the compressed image */ + _image_size = (_etext - _text) * 4; + _got_start = .; .got : { *(.got) } _got_end = .;
PATCH 5/116 MIPS: Cleanup forgotten label_module_alloc in tlbex.c
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Daney <[email protected]>
commit abbdc3d88aa2d5c937b21044c336bcd056c1732f upstream.
commit c8af165342e83a4eb078c9607d29a7c399d30a53 (lmo) rsp. e0cc87f59490d7d62a8ab2a76498dc8a2b64927a (kernel.org) left label_module_alloc unused. Remove it now.
Patchwork: http://patchwork.linux-mips.org/patch/752/
--- arch/mips/mm/tlbex.c | 8 -------- 1 file changed, 8 deletions(-)
arch/mips/mm/tlbex.c +0 -8
@@ -73,9 +73,6 @@ static int __cpuinit m4kc_tlbp_war(void)enum label_id { label_second_part =1 , label_leave, -#ifdef MODULE_START - label_module_alloc, -#endif label_vmalloc, label_vmalloc_done, label_tlbw_hazard,
@@ -92,9 +89,6 @@ enum label_id { UASM_L_LA(_second_part) UASM_L_LA(_leave) -#ifdef MODULE_START -UASM_L_LA(_module_alloc) -#endif UASM_L_LA(_vmalloc) UASM_L_LA(_vmalloc_done) UASM_L_LA(_tlbw_hazard)
@@ -802,8 +796,6 @@ static void __cpuinit build_r4000_tlb_re }else {#if defined(CONFIG_HUGETLB_PAGE )const enum label_id ls = label_tlb_huge_update; -#elif defined(MODULE_START ) -const enum label_id ls = label_module_alloc;#else const enum label_id ls = label_vmalloc;#endif
PATCH 6/116 tg3: Fix tg3_poll_controller() passing wrong pointer to tg3_interrupt()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Louis Rilling <[email protected]>
commit fe234f0e5cbb880792d2d1ac0743cf8c07e9dde3 upstream.
Commit 09943a1819a240ff4a72f924d0038818fcdd0a90
Author: Matt Carlson <[email protected]>
Date: Fri Aug 28 14:01:57 2009 +0000
tg3: Convert ISR parameter to tnapi
forgot to update tg3_poll_controller(), leading to intermittent crashes with netpoll.
Fix this.
--- drivers/net/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/tg3.c +1 -1
@@ -4995,7 +4995,7 @@ static void tg3_poll_controller(struct nstruct tg3 *tp =netdev_priv (dev);for (i =0 ; i < tp->irq_cnt; i++) - tg3_interrupt(tp->napi[i].irq_vec, dev); + tg3_interrupt(tp->napi[i].irq_vec, &tp->napi[i]); }#endif
PATCH 7/116 tg3: Fix 5906 transmit hangs
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matt Carlson <[email protected]>
This is a resubmit backport of commit 92c6b8d16a36df3f28b2537bed2a56491fb08f11 to kernel version 2.6.32. The gentoo bug report can be found at
https://bugs.gentoo.org/show_bug.cgi?id=301091. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the initial patch. The original description is as follows:
The 5906 has trouble with fragments that are less than 8 bytes in size. This patch works around the problem by pivoting the 5906's transmit routine to tg3_start_xmit_dma_bug() and introducing a new SHORT_DMA_BUG flag that enables code to detect and react to the problematic condition.
--- drivers/net/tg3.c | 21 ++++++++++++++++----- drivers/net/tg3.h | 3 +++ 2 files changed, 19 insertions(+), 5 deletions(-)
drivers/net/tg3.c +16 -5
@@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu mss =0 ;if ((mss =skb_shinfo (skb)->gso_size) !=0 ) {struct iphdr *iph; -int tcp_opt_len, ip_tcp_len, hdr_len; +u32 tcp_opt_len, ip_tcp_len, hdr_len;if (skb_header_cloned (skb) &&pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) {
@@ -5423,8 +5423,10 @@ static netdev_tx_t tg3_start_xmit_dma_buIPPROTO_TCP , 0); -if ((tp->tg3_flags2 &TG3_FLG2_HW_TSO ) || - (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_5705 )) { +if (tp->tg3_flags2 &TG3_FLG2_HW_TSO_2 ) + mss |= hdr_len <<9 ; +else if ((tp->tg3_flags2 &TG3_FLG2_HW_TSO_1 ) || +GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_5705 ) {if (tcp_opt_len || iph->ihl >5 ) {int tsflags;
@@ -5459,6 +5461,9 @@ static netdev_tx_t tg3_start_xmit_dma_bu would_hit_hwbug =0 ; +if ((tp->tg3_flags3 &TG3_FLG3_SHORT_DMA_BUG ) && len <=8 ) + would_hit_hwbug =1 ; +if (tp->tg3_flags3 &TG3_FLG3_5701_DMA_BUG ) would_hit_hwbug =1 ;else if (tg3_4g_overflow_test (mapping, len))
@@ -5482,6 +5487,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu tnapi->tx_buffers[entry].skb =NULL ; +if ((tp->tg3_flags3 &TG3_FLG3_SHORT_DMA_BUG ) && + len <=8 ) + would_hit_hwbug =1 ; +if (tg3_4g_overflow_test (mapping, len)) would_hit_hwbug =1 ;
@@ -12608,6 +12617,9 @@ static int __devinit tg3_get_invariants( } } +if (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_5906 ) + tp->tg3_flags3 |=TG3_FLG3_SHORT_DMA_BUG ; + tp->irq_max =1 ;#ifdef TG3_NAPI
@@ -13975,8 +13987,7 @@ static int __devinit tg3_init_one(struct goto err_out_iounmap; } -if ((tp->tg3_flags3 &TG3_FLG3_5755_PLUS ) || -GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_5906 ) +if (tp->tg3_flags3 &TG3_FLG3_5755_PLUS ) dev->netdev_ops = &tg3_netdev_ops;else dev->netdev_ops = &tg3_netdev_ops_dma_bug;
drivers/net/tg3.h +3 -0
@@ -2759,6 +2759,9 @@ struct tg3 {#define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000#define TG3_FLG3_PHY_IS_FET 0x00010000#define TG3_FLG3_ENABLE_RSS 0x00020000 +#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000 +#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000 +#define TG3_FLG3_SHORT_DMA_BUG 0x00200000struct timer_list timer;u16 timer_counter;
Re: [Stable-review] [007/116] tg3: Fix 5906 transmit hangs
Quoted 5 lines · On Tue, 30 Mar 2010 15:54:45 -0700 Greg KH <[email protected]> wrote:
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 9 lines
From: Matt Carlson <[email protected]>
This is a resubmit backport of commit
92c6b8d16a36df3f28b2537bed2a56491fb08f11to kernel version 2.6.32. The gentoo bug report can be found at
https://bugs.gentoo.org/show_bug.cgi?id=301091. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the initial patch. The original description is as follows:
I think these two patches should be used instead, as they fix the bug without needing backports and keep the driver closer to upstream:
0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb "tg3: Assign flags to fixes in start_xmit_dma_bug"
92c6b8d16a36df3f28b2537bed2a56491fb08f11
"tg3: Fix 5906 transmit hangs"
Re: [Stable-review] [007/116] tg3: Fix 5906 transmit hangs
Quoted 18 lines · Chuck Ebbert
Quoted 5 lines · On Tue, 30 Mar 2010 15:54:45 -0700 Greg KH <[email protected]> wrote:
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 9 lines
From: Matt Carlson <[email protected]>
This is a resubmit backport of commit
92c6b8d16a36df3f28b2537bed2a56491fb08f11to kernel version 2.6.32. The gentoo bug report can be found at
https://bugs.gentoo.org/show_bug.cgi?id=301091. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the initial patch. The original description is as follows:
Quoted 8 lines
I think these two patches should be used instead, as they fix the bug without needing backports and keep the driver closer to upstream:
0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb"tg3: Assign flags to fixes instart_xmit_dma_bug"
92c6b8d16a36df3f28b2537bed2a56491fb08f11
"tg3: Fix 5906 transmit hangs"
I don't know, I'll defer to Matt here, this patch has gone in and out of the stable queue for a while now as he and some users have tested and had problems lots of times...
Matt?
Re: [Stable-review] [007/116] tg3: Fix 5906 transmit hangs
Quoted 25 lines · Greg KH
Quoted 24 lines · Chuck Ebbert
Quoted 5 lines · On Tue, 30 Mar 2010 15:54:45 -0700 Greg KH <[email protected]> wrote:
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 9 lines
From: Matt Carlson <[email protected]>
This is a resubmit backport of commit
92c6b8d16a36df3f28b2537bed2a56491fb08f11to kernel version 2.6.32. The gentoo bug report can be found at
https://bugs.gentoo.org/show_bug.cgi?id=301091. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the initial patch. The original description is as follows:I think these two patches should be used instead, as they fix the bug without needing backports and keep the driver closer to upstream:
0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb"tg3: Assign flags to fixes instart_xmit_dma_bug"
Quoted 8 lines
Quoted 2 lines
92c6b8d16a36df3f28b2537bed2a56491fb08f11
"tg3: Fix 5906 transmit hangs"I don't know, I'll defer to Matt here, this patch has gone in and out of the stable queue for a while now as he and some users have tested and had problems lots of times...
Matt?
I'm O.K. with either path. I supported Mike's patch because it was minimal. (All the bugs should be shaken out by now.) If that isn't a goal, then I guess I'd rather rubber stamp my own implementation.
Re: [Stable-review] [007/116] tg3: Fix 5906 transmit hangs
Quoted 33 lines · Matt Carlson
Quoted 32 lines · Greg KH
Quoted 18 lines · Chuck Ebbert
Quoted 5 lines · On Tue, 30 Mar 2010 15:54:45 -0700 Greg KH <[email protected]> wrote:
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 9 lines
From: Matt Carlson <[email protected]>
This is a resubmit backport of commit
92c6b8d16a36df3f28b2537bed2a56491fb08f11to kernel version 2.6.32. The gentoo bug report can be found at
https://bugs.gentoo.org/show_bug.cgi?id=301091. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the initial patch. The original description is as follows:Quoted 8 lines
I think these two patches should be used instead, as they fix the bug without needing backports and keep the driver closer to upstream:
0e1406dd404ce55dbe8d68b4b5e2aed7e5c75fdb"tg3: Assign flags to fixes instart_xmit_dma_bug"
92c6b8d16a36df3f28b2537bed2a56491fb08f11
"tg3: Fix 5906 transmit hangs"I don't know, I'll defer to Matt here, this patch has gone in and out of the stable queue for a while now as he and some users have tested and had problems lots of times...
Quoted 5 lines
Quoted 1 line
Matt?
I'm O.K. with either path. I supported Mike's patch because it was minimal. (All the bugs should be shaken out by now.) If that isn't a goal, then I guess I'd rather rubber stamp my own implementation.
I'll live with what we have now as we know it's been tested, and it is less work for me at the moment :)
thanks,
greg k-h
PATCH 8/116 ALSA: hda - Fix input source elements of secondary ADCs on Realtek
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 5311114d4867113c00f78829d4ce14be458ec925 upstream.
Since alc_auto_create_input_ctls() doesn't set the elements for the secondary ADCs, "Input Source" elemtns for these also get empty, resulting in buggy outputs of alsactl like:
control.14 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
iface MIXER
name 'Input Source'
index 1
value 0
}This patch fixes alc_mux_enum_*() (and others) to fall back to the first entry if the secondary input mux is empty.
--- sound/pci/hda/patch_realtek.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/pci/hda/patch_realtek.c +6 -0
@@ -400,6 +400,8 @@ static int alc_mux_enum_info(struct snd_unsigned int mux_idx =snd_ctl_get_ioffidx (kcontrol, &uinfo->id);if (mux_idx >= spec->num_mux_defs) mux_idx =0 ; +if (!spec->input_mux[mux_idx].num_items && mux_idx >0 ) + mux_idx =0 ;return snd_hda_input_mux_info (&spec->input_mux[mux_idx], uinfo); }
@@ -428,6 +430,8 @@ static int alc_mux_enum_put(struct snd_k mux_idx = adc_idx >= spec->num_mux_defs ?0 : adc_idx; imux = &spec->input_mux[mux_idx]; +if (!imux->num_items && mux_idx >0 ) + imux = &spec->input_mux[0 ]; type =get_wcaps_type (get_wcaps (codec, nid));if (type ==AC_WID_AUD_MIX ) {
@@ -9743,6 +9747,8 @@ static void alc882_auto_init_input_src(scontinue ; mux_idx = c >= spec->num_mux_defs ?0 : c; imux = &spec->input_mux[mux_idx]; +if (!imux->num_items && mux_idx >0 ) + imux = &spec->input_mux[0 ];for (idx =0 ; idx < conns; idx++) {/* if the current connection is the selected one, * unmute it as default - otherwise mute it
PATCH 9/116 ALSA: hda: enable MSI for Gateway M-6866
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
The OR has verified that explicitly enabling MSI is necessary for audio to be audible by default.
This patch is only applicable to 2.6.32.y; in 2.6.33, MSI is enabled by default.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2317,6 +2317,7 @@ static void __devinit check_probe_mask(sstatic struct snd_pci_quirk msi_white_list[]__devinitdata = {SND_PCI_QUIRK (0x103c ,0x30f7 ,"HP Pavilion dv4t-1300" ,1 ),SND_PCI_QUIRK (0x103c ,0x3607 ,"HP Compa CQ40" ,1 ), +SND_PCI_QUIRK (0x107b ,0x0380 ,"Gateway M-6866" ,1 ), {} };
PATCH 10/116 timekeeping: Prevent oops when GENERIC_TIME=n
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: john stultz <[email protected]>
commit ad6759fbf35d104dbf573cd6f4c6784ad6823f7e upstream.
Aaro Koskinen reported an issue in kernel.org bugzilla #15366, where on non-GENERIC_TIME systems, accessing /sys/devices/system/clocksource/clocksource0/current_clocksource results in an oops.
It seems the timekeeper/clocksource rework missed initializing the curr_clocksource value in the !GENERIC_TIME case.
Thanks to Aaro for reporting and diagnosing the issue as well as testing the fix!
LKML-Reference: <[email protected]>
--- kernel/time/clocksource.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/time/clocksource.c +4 -0
@@ -515,6 +515,10 @@ static inline void clocksource_select(vo*/ static int __init clocksource_done_booting (void ) { +mutex_lock (&clocksource_mutex); + curr_clocksource =clocksource_default_clock (); +mutex_unlock (&clocksource_mutex); + finished_booting =1 ;/*
PATCH 11/116 Input: alps - add support for the touchpad on Toshiba Tecra A11-11L
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Bächler <[email protected]>
commit eb8bff85c5bd5caef7c374ff32b86545029efb56 upstream.
--- drivers/input/mouse/alps.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/mouse/alps.c +2 -0
@@ -62,6 +62,8 @@ static const struct alps_model_info alps { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 }, /* Dell Vostro 1400 */ + { { 0x52, 0x01, 0x14 }, 0xff, 0xff, + ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ }; /*
PATCH 12/116 Input: i8042 - add ALDI/MEDION netbook E1222 to qurik reset table
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Fritz <[email protected]>
commit 31968ecf584330b51a25b7bf881c2b632a02a3fb upstream.
ALDI/MEDION netbook E1222 needs to be in the reset quirk list for its touchpad's proper function.
--- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -442,6 +442,13 @@ static const struct dmi_system_id __init }, }, { +/* Medion Akoya E1222 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"MEDION" ), + DMI_MATCH(DMI_PRODUCT_NAME, "E122X"), + }, + }, + {/* Mivvy M310 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
PATCH 13/116 i2c-i801: Dont use the block buffer for I2C block writes
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit c074c39d62306efa5ba7c69c1a1531bc7333d252 upstream.
Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation.
--- drivers/i2c/busses/i2c-i801.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-i801.c +4 -2
@@ -415,9 +415,11 @@ static int i801_block_transaction(union data->block[0 ] =32 ;/* max for SMBus block reads */ } +/* Experience has shown that the block buffer can only be used for +SMBus (not I2C) block transactions, even though the datasheet +doesn't mention this limitation. */ if ((i801_features &FEATURE_BLOCK_BUFFER ) - && !(command ==I2C_SMBUS_I2C_BLOCK_DATA - && read_write ==I2C_SMBUS_READ ) + && command !=I2C_SMBUS_I2C_BLOCK_DATA &&i801_set_block_buffer_mode () ==0 ) result =i801_block_transaction_by_block (data, read_write, hwpec);
PATCH 14/116 ath5k: dont use external sleep clock in AP mode
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Copeland <[email protected]>
commit 5d6ce628f986d1a3c523cbb0a5a52095c48cc332 upstream
When using the external sleep clock in AP mode, the TSF increments too quickly, causing beacon interval to be much lower than it is supposed to be, resulting in lots of beacon-not-ready interrupts.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=14802.
--- drivers/net/wireless/ath/ath5k/reset.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/reset.c +3 -2
@@ -1382,8 +1382,9 @@ int ath5k_hw_reset(struct ath5k_hw *ah,* Set clocks to 32KHz operation and use an * external 32KHz crystal when sleeping if one * exists */ -if (ah->ah_version ==AR5K_AR5212 ) -ath5k_hw_set_sleep_clock (ah, true); +if (ah->ah_version ==AR5K_AR5212 && + ah->ah_op_mode !=NL80211_IFTYPE_AP ) +ath5k_hw_set_sleep_clock (ah, true);/* * Disable beacons and reset the register
PATCH 15/116 ath5k: fix setup for CAB queue
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bob Copeland <[email protected]>
commit a951ae2176b982574ffa197455db6c89359fd5eb upstream.
The beacon sent gating doesn't seem to work with any combination of flags. Thus, buffered frames tend to stay buffered forever, using up tx descriptors.
Instead, use the DBA gating and hold transmission of the buffered frames until 80% of the beacon interval has elapsed using the ready time. This fixes the following error in AP mode:
ath5k phy0: no further txbuf available, dropping packet
Add a comment to acknowledge that this isn't the best solution.
--- drivers/net/wireless/ath/ath5k/ath5k.h | 2 +- drivers/net/wireless/ath/ath5k/base.c | 22 +++++++++++++++++++--- drivers/net/wireless/ath/ath5k/qcu.c | 5 +++-- 3 files changed, 23 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath5k/ath5k.h +1 -1
@@ -540,7 +540,7 @@ struct ath5k_txq_info {u32 tqi_cbr_period;/* Constant bit rate period */ u32 tqi_cbr_overflow_limit;u32 tqi_burst_time; -u32 tqi_ready_time;/* Not used */ +u32 tqi_ready_time;/* Time queue waits after an event */ };/*
drivers/net/wireless/ath/ath5k/base.c +19 -3
@@ -1511,7 +1511,8 @@ ath5k_beaconq_config(struct ath5k_softc ret =ath5k_hw_get_tx_queueprops (ah, sc->bhalq, &qi);if (ret) -return ret; + goto err; +if (sc->opmode ==NL80211_IFTYPE_AP || sc->opmode ==NL80211_IFTYPE_MESH_POINT ) {/*
@@ -1538,10 +1539,25 @@ ath5k_beaconq_config(struct ath5k_softcif (ret) {ATH5K_ERR (sc,"%s: unable to update parameters for beacon " "hardware queue!\n" , __func__); -return ret; + goto err; } + ret =ath5k_hw_reset_tx_queue (ah, sc->bhalq);/* push to h/w */ +if (ret) + goto err; + +/* reconfigure cabq with ready time to 80% of beacon_interval */ + ret =ath5k_hw_get_tx_queueprops (ah,AR5K_TX_QUEUE_ID_CAB , &qi); +if (ret) + goto err; + + qi.tqi_ready_time = (sc->bintval *80 ) /100 ; + ret =ath5k_hw_set_tx_queueprops (ah,AR5K_TX_QUEUE_ID_CAB , &qi); +if (ret) + goto err; -return ath5k_hw_reset_tx_queue (ah, sc->bhalq);/* push to h/w */ ; + ret =ath5k_hw_reset_tx_queue (ah,AR5K_TX_QUEUE_ID_CAB ); +err: +return ret; } static void
drivers/net/wireless/ath/ath5k/qcu.c +3 -2
@@ -408,12 +408,13 @@ int ath5k_hw_reset_tx_queue(struct ath5kbreak ;case AR5K_TX_QUEUE_CAB : +/* XXX: use BCN_SENT_GT, if we can figure out how */ AR5K_REG_ENABLE_BITS (ah,AR5K_QUEUE_MISC (queue), -AR5K_QCU_MISC_FRSHED_BCN_SENT_GT | +AR5K_QCU_MISC_FRSHED_DBA_GT |AR5K_QCU_MISC_CBREXP_DIS |AR5K_QCU_MISC_CBREXP_BCN_DIS ); - ath5k_hw_reg_write(ah, ((AR5K_TUNE_BEACON_INTERVAL - + ath5k_hw_reg_write(ah, ((tq->tqi_ready_time - (AR5K_TUNE_SW_BEACON_RESP - AR5K_TUNE_DMA_BEACON_RESP) - AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF) * 1024) |
PATCH 16/116 ring-buffer: Move disabled check into preempt disable section
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lai Jiangshan <[email protected]>
commit 52fbe9cde7fdb5c6fac196d7ebd2d92d05ef3cd4 upstream.
The ring buffer resizing and resetting relies on a schedule RCU action. The buffers are disabled, a synchronize_sched() is called and then the resize or reset takes place.
But this only works if the disabling of the buffers are within the preempt disabled section, otherwise a window exists that the buffers can be written to while a reset or resize takes place.
LKML-Reference: <[email protected]>
--- kernel/trace/ring_buffer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/trace/ring_buffer.c +6 -6
@@ -2237,12 +2237,12 @@ ring_buffer_lock_reserve(struct ring_bufif (ring_buffer_flags !=RB_BUFFERS_ON )return NULL ; -if (atomic_read (&buffer->record_disabled)) -return NULL ; -/* If we are tracing schedule, we don't want to recurse */ resched =ftrace_preempt_disable (); +if (atomic_read (&buffer->record_disabled)) + goto out_nocheck; +if (trace_recursive_lock ()) goto out_nocheck;
@@ -2474,11 +2474,11 @@ int ring_buffer_write(struct ring_bufferif (ring_buffer_flags !=RB_BUFFERS_ON )return -EBUSY ; -if (atomic_read (&buffer->record_disabled)) -return -EBUSY ; - resched =ftrace_preempt_disable (); +if (atomic_read (&buffer->record_disabled)) + goto out; + cpu =raw_smp_processor_id ();if (!cpumask_test_cpu (cpu, buffer->cpumask))
PATCH 17/116 function-graph: Init curr_ret_stack with ret_stack
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit ea14eb714041d40fcc5180b5a586034503650149 upstream.
If the graph tracer is active, and a task is forked but the allocating of the processes graph stack fails, it can cause crash later on.
This is due to the temporary stack being NULL, but the curr_ret_stack variable is copied from the parent. If it is not -1, then in ftrace_graph_probe_sched_switch() the following:
for (index = next->curr_ret_stack; index >= 0; index--) next->ret_stack[index].calltime += timestamp;
Will cause a kernel OOPS.
Found with Li Zefan's ftrace_stress_test.
--- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
@@ -3258,6 +3258,7 @@ void ftrace_graph_init_task(struct task_ {/* Make sure we do not use the parent ret_stack */ t->ret_stack =NULL ; + t->curr_ret_stack =-1 ;if (ftrace_graph_active) {struct ftrace_ret_stack *ret_stack;
@@ -3267,7 +3268,6 @@ void ftrace_graph_init_task(struct task_ GFP_KERNEL);if (!ret_stack)return ; - t->curr_ret_stack =-1 ;atomic_set (&t->tracing_graph_pause,0 );atomic_set (&t->trace_overrun,0 ); t->ftrace_timestamp =0 ;
PATCH 18/116 Bluetooth: Fix sleeping function in RFCOMM within invalid context
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcel Holtmann <[email protected]>
commit 485f1eff73a7b932fd3abb0dfcf804e1a1f59025 upstream.
With the commit 9e726b17422bade75fba94e625cd35fd1353e682 the rfcomm_session_put() gets accidentially called from a timeout callback and results in this:
BUG: sleeping function called from invalid context at net/core/sock.c:1897 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper Pid: 0, comm: swapper Tainted: P 2.6.32 #31 Call Trace: <IRQ> [<ffffffff81036455>] __might_sleep+0xf8/0xfa [<ffffffff8138ef1d>] lock_sock_nested+0x29/0xc4 [<ffffffffa03921b3>] lock_sock+0xb/0xd [l2cap] [<ffffffffa03948e6>] l2cap_sock_shutdown+0x1c/0x76 [l2cap] [<ffffffff8106adea>] ? clockevents_program_event+0x75/0x7e [<ffffffff8106bea2>] ? tick_dev_program_event+0x37/0xa5 [<ffffffffa0394967>] l2cap_sock_release+0x27/0x67 [l2cap] [<ffffffff8138c971>] sock_release+0x1a/0x67 [<ffffffffa03d2492>] rfcomm_session_del+0x34/0x53 [rfcomm] [<ffffffffa03d24c5>] rfcomm_session_put+0x14/0x16 [rfcomm] [<ffffffffa03d28b4>] rfcomm_session_timeout+0xe/0x1a [rfcomm] [<ffffffff810554a8>] run_timer_softirq+0x1e2/0x29a [<ffffffffa03d28a6>] ? rfcomm_session_timeout+0x0/0x1a [rfcomm] [<ffffffff8104e0f6>] __do_softirq+0xfe/0x1c5 [<ffffffff8100e8ce>] ? timer_interrupt+0x1a/0x21 [<ffffffff8100cc4c>] call_softirq+0x1c/0x28 [<ffffffff8100e05b>] do_softirq+0x33/0x6b [<ffffffff8104daf6>] irq_exit+0x36/0x85 [<ffffffff8100d7a9>] do_IRQ+0xa6/0xbd [<ffffffff8100c493>] ret_from_intr+0x0/0xa <EOI> [<ffffffff812585b3>] ? acpi_idle_enter_bm+0x269/0x294 [<ffffffff812585a9>] ? acpi_idle_enter_bm+0x25f/0x294 [<ffffffff81373ddc>] ? cpuidle_idle_call+0x97/0x107 [<ffffffff8100aca0>] ? cpu_idle+0x53/0xaa [<ffffffff81429006>] ? rest_init+0x7a/0x7c [<ffffffff8177bc8c>] ? start_kernel+0x389/0x394 [<ffffffff8177b29c>] ? x86_64_start_reservations+0xac/0xb0 [<ffffffff8177b384>] ? x86_64_start_kernel+0xe4/0xeb
To fix this, the rfcomm_session_put() needs to be moved out of rfcomm_session_timeout() into rfcomm_process_sessions(). In that context it is perfectly fine to sleep and disconnect the socket.
--- net/bluetooth/rfcomm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/rfcomm/core.c +1 -1
@@ -251,7 +251,6 @@ static void rfcomm_session_timeout(unsigBT_DBG ("session %p state %ld" , s, s->state);set_bit (RFCOMM_TIMED_OUT , &s->flags); -rfcomm_session_put (s);rfcomm_schedule (RFCOMM_SCHED_TIMEO ); }
@@ -1917,6 +1916,7 @@ static inline void rfcomm_process_sessioif (test_and_clear_bit (RFCOMM_TIMED_OUT , &s->flags)) { s->state =BT_DISCONN ;rfcomm_send_disc (s,0 ); +rfcomm_session_put (s);continue ; }
PATCH 19/116 tracing: Use same local variable when resetting the ring buffer
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit 283740c619d211e34572cc93c8cdba92ccbdb9cc upstream.
In the ftrace code that resets the ring buffer it references the buffer with a local variable, but then uses the tr->buffer as the parameter to reset. If the wakeup tracer is running, which can switch the tr->buffer with the max saved buffer, this can break the requirement of disabling the buffer before the reset.
buffer = tr->buffer; ring_buffer_record_disable(buffer); synchronize_sched(); __tracing_reset(tr->buffer, cpu);
If the tr->buffer is swapped, then the reset is not happening to the buffer that was disabled. This will cause the ring buffer to fail.
Found with Li Zefan's ftrace_stress_test.
--- kernel/trace/trace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/trace/trace.c +4 -4
@@ -748,10 +748,10 @@ out:mutex_unlock (&trace_types_lock); } -static void __tracing_reset (struct trace_array *tr,int cpu) +static void __tracing_reset (struct ring_buffer *buffer,int cpu) {ftrace_disable_cpu (); -ring_buffer_reset_cpu (tr->buffer, cpu); +ring_buffer_reset_cpu (buffer, cpu);ftrace_enable_cpu (); }
@@ -763,7 +763,7 @@ void tracing_reset(struct trace_array *t/* Make sure all commits have finished */ synchronize_sched (); -__tracing_reset (tr, cpu); +__tracing_reset (buffer, cpu);ring_buffer_record_enable (buffer); }
@@ -781,7 +781,7 @@ void tracing_reset_online_cpus(struct tr tr->time_start =ftrace_now (tr->cpu);for_each_online_cpu (cpu) -__tracing_reset (tr, cpu); +__tracing_reset (buffer, cpu);ring_buffer_record_enable (buffer); }
PATCH 20/116 tracing: Disable buffer switching when starting or stopping trace
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit a2f8071428ed9a0f06865f417c962421c9a6b488 upstream.
When the trace iterator is read, tracing_start() and tracing_stop() is called to stop tracing while the iterator is processing the trace output.
These functions disable both the standard buffer and the max latency buffer. But if the wakeup tracer is running, it can switch these buffers between the two disables:
buffer = global_trace.buffer;
if (buffer)
ring_buffer_record_disable(buffer);<<<--------- swap happens here
buffer = max_tr.buffer;
if (buffer)
ring_buffer_record_disable(buffer);What happens is that we disabled the same buffer twice. On tracing_start() we can enable the same buffer twice. All ring_buffer_record_disable() must be matched with a ring_buffer_record_enable() or the buffer can be disable permanently, or enable prematurely, and cause a bug where a reset happens while a trace is commiting.
This patch protects these two by taking the ftrace_max_lock to prevent a switch from occurring.
Found with Li Zefan's ftrace_stress_test.
--- kernel/trace/trace.c | 9 +++++++++ 1 file changed, 9 insertions(+)
kernel/trace/trace.c +9 -0
@@ -858,6 +858,8 @@ void tracing_start(void) goto out; } +/* Prevent the buffers from switching */ +__raw_spin_lock (&ftrace_max_lock); buffer = global_trace.buffer;if (buffer)
@@ -867,6 +869,8 @@ void tracing_start(void)if (buffer)ring_buffer_record_enable (buffer); +__raw_spin_unlock (&ftrace_max_lock); +ftrace_start (); out:spin_unlock_irqrestore (&tracing_start_lock, flags);
@@ -888,6 +892,9 @@ void tracing_stop(void)if (trace_stop_count++) goto out; +/* Prevent the buffers from switching */ +__raw_spin_lock (&ftrace_max_lock); + buffer = global_trace.buffer;if (buffer)ring_buffer_record_disable (buffer);
@@ -896,6 +903,8 @@ void tracing_stop(void)if (buffer)ring_buffer_record_disable (buffer); +__raw_spin_unlock (&ftrace_max_lock); + out:spin_unlock_irqrestore (&tracing_start_lock, flags); }
PATCH 21/116 tracing: Do not record user stack trace from NMI context
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Rostedt <[email protected]>
commit b6345879ccbd9b92864fbd7eb8ac48acdb4d6b15 upstream.
A bug was found with Li Zefan's ftrace_stress_test that caused applications to segfault during the test.
Placing a tracing_off() in the segfault code, and examining several traces, I found that the following was always the case. The lock tracer was enabled (lockdep being required) and userstack was enabled. Testing this out, I just enabled the two, but that was not good enough. I needed to run something else that could trigger it. Running a load like hackbench did not work, but executing a new program would. The following would trigger the segfault within seconds:
# echo 1 > /debug/tracing/options/userstacktrace # echo 1 > /debug/tracing/events/lock/enable # while :; do ls > /dev/null ; done
Enabling the function graph tracer and looking at what was happening I finally noticed that all cashes happened just after an NMI.
1) | copy_user_handle_tail() {
1) | bad_area_nosemaphore() {
1) | __bad_area_nosemaphore() {
1) | no_context() {
1) | fixup_exception() {
1) 0.319 us | search_exception_tables();
1) 0.873 us | }
[...]
1) 0.314 us | __rcu_read_unlock();
1) 0.325 us | native_apic_mem_write();
1) 0.943 us | }
1) 0.304 us | rcu_nmi_exit();
[...]
1) 0.479 us | find_vma();
1) | bad_area() {
1) | __bad_area() {After capturing several traces of failures, all of them happened after an NMI. Curious about this, I added a trace_printk() to the NMI handler to read the regs->ip to see where the NMI happened. In which I found out it was here:
ffffffff8135b660 <page_fault>:
ffffffff8135b660: 48 83 ec 78 sub $0x78,%rsp ffffffff8135b664: e8 97 01 00 00 callq ffffffff8135b800 <error_entry>
What was happening is that the NMI would happen at the place that a page fault occurred. It would call rcu_read_lock() which was traced by the lock events, and the user_stack_trace would run. This would trigger a page fault inside the NMI. I do not see where the CR2 register is saved or restored in NMI handling. This means that it would corrupt the page fault handling that the NMI interrupted.
The reason the while loop of ls helped trigger the bug, was that each execution of ls would cause lots of pages to be faulted in, and increase the chances of the race happening.
The simple solution is to not allow user stack traces in NMI context. After this patch, I ran the above "ls" test for a couple of hours without any issues. Without this patch, the bug would trigger in less than a minute.
--- kernel/trace/trace.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/trace/trace.c +7 -0
@@ -1171,6 +1171,13 @@ ftrace_trace_userstack(struct ring_buffeif (!(trace_flags &TRACE_ITER_USERSTACKTRACE ))return ; +/* +* NMIs can not handle page faults, even with fix ups. +* The save user stack can (and often does) fault. +*/ +if (unlikely (in_nmi ())) +return ; + event =trace_buffer_lock_reserve (buffer,TRACE_USER_STACK ,sizeof (*entry), flags, pc);if (!event)
PATCH 22/116 PCI: unconditionally clear AER uncorr status register during cleanup
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Patterson <[email protected]>
commit 6cdfd995a65a52e05b99e3a72a9b979abe73b312 upstream.
The current implementation of pci_cleanup_aer_uncorrect_error_status only clears either fatal or non-fatal error status bits depending on the state of the I/O channel. This implementation will then often leave some bits set after PCI error recovery completes. The uncleared bit settings will then be falsely reported the next time an AER interrupt is generated for that hierarchy. An easy way to illustrate this issue is to use the aer-inject module to simultaneously inject both an uncorrectable non-fatal and uncorrectable fatal error. One of the errors will not be cleared.
This patch resolves this issue by unconditionally clearing all bits in the AER uncorrectable status register. All settings and corrective action strategies are saved and determined before pci_cleanup_aer_uncorrect_error_status is called, so this change should not affect errory handling functionality.
--- drivers/pci/pcie/aer/aerdrv_core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/pci/pcie/aer/aerdrv_core.c +3 -7
@@ -78,19 +78,15 @@ EXPORT_SYMBOL_GPL(pci_disable_pcie_errorint pci_cleanup_aer_uncorrect_error_status (struct pci_dev *dev) {int pos; -u32 status, mask; +u32 status; pos =pci_find_ext_capability (dev,PCI_EXT_CAP_ID_ERR );if (!pos)return -EIO ;pci_read_config_dword (dev, pos +PCI_ERR_UNCOR_STATUS , &status); -pci_read_config_dword (dev, pos +PCI_ERR_UNCOR_SEVER , &mask); -if (dev->error_state == pci_channel_io_normal) - status &= ~mask;/* Clear corresponding nonfatal bits */ -else - status &= mask;/* Clear corresponding fatal bits */ -pci_write_config_dword (dev, pos +PCI_ERR_UNCOR_STATUS , status); +if (status) +pci_write_config_dword (dev, pos +PCI_ERR_UNCOR_STATUS , status);return 0 ; }
PATCH 23/116 drm/edid: Unify detailed block parsing between base and extension blocks
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Adam Jackson <[email protected]>
commit 9cf00977da092096c7a983276dad8b3002d23a99 upstream.
Also fix an embarassing bug in standard timing subblock parsing that would result in an infinite loop.
--- drivers/gpu/drm/drm_edid.c | 163 ++++++++++++++++----------------------------- 1 file changed, 61 insertions(+), 102 deletions(-)
drivers/gpu/drm/drm_edid.c +61 -102
@@ -834,8 +834,57 @@ static int add_standard_modes(struct drmreturn modes; } +static int add_detailed_modes (struct drm_connector *connector, +struct detailed_timing *timing, +struct edid *edid,u32 quirks,int preferred) +{ +int i, modes =0 ; +struct detailed_non_pixel *data = &timing->data.other_data; +int timing_level =standard_timing_level (edid); +struct drm_display_mode *newmode; +struct drm_device *dev = connector->dev; + +if (timing->pixel_clock) { + newmode =drm_mode_detailed (dev, edid, timing, quirks); +if (!newmode) +return 0 ; + +if (preferred) + newmode->type |=DRM_MODE_TYPE_PREFERRED ; + +drm_mode_probed_add (connector, newmode); +return 1 ; + } + +/* other timing types */ +switch (data->type) { +case EDID_DETAIL_MONITOR_RANGE : +/* Get monitor range data */ +break ; +case EDID_DETAIL_STD_MODES : +/* Six modes per detailed section */ +for (i =0 ; i <6 ; i++) { +struct std_timing *std; +struct drm_display_mode *newmode; + + std = &data->data.timings[i]; + newmode =drm_mode_std (dev, std, edid->revision, + timing_level); +if (newmode) { +drm_mode_probed_add (connector, newmode); + modes++; + } + } +break ; +default : +break ; + } + +return modes; +} +/** -* add_detailed_modes - get detailed mode info from EDID data +* add_detailed_info - get detailed mode info from EDID data * @connector: attached connector * @edid: EDID block to scan * @quirks: quirks to apply
@@ -846,67 +895,24 @@ static int add_standard_modes(struct drmstatic int add_detailed_info (struct drm_connector *connector,struct edid *edid,u32 quirks) { -struct drm_device *dev = connector->dev; -int i, j, modes =0 ; -int timing_level; - - timing_level =standard_timing_level (edid); +int i, modes =0 ;for (i =0 ; i <EDID_DETAILED_TIMINGS ; i++) {struct detailed_timing *timing = &edid->detailed_timings[i]; -struct detailed_non_pixel *data = &timing->data.other_data; -struct drm_display_mode *newmode; +int preferred = (i ==0 ) && (edid->features &DRM_EDID_FEATURE_PREFERRED_TIMING ); -/* X server check is version 1.1 or higher */ -if (edid->version ==1 && edid->revision >=1 && - !timing->pixel_clock) { -/* Other timing or info */ -switch (data->type) { -case EDID_DETAIL_MONITOR_SERIAL : -break ; -case EDID_DETAIL_MONITOR_STRING : -break ; -case EDID_DETAIL_MONITOR_RANGE : -/* Get monitor range data */ -break ; -case EDID_DETAIL_MONITOR_NAME : -break ; -case EDID_DETAIL_MONITOR_CPDATA : -break ; -case EDID_DETAIL_STD_MODES : -for (j =0 ; j <6 ; i++) { -struct std_timing *std; -struct drm_display_mode *newmode; - - std = &data->data.timings[j]; - newmode =drm_mode_std (dev, std, - edid->revision, - timing_level); -if (newmode) { -drm_mode_probed_add (connector, newmode); - modes++; - } - } -break ; -default : -break ; - } - }else { - newmode =drm_mode_detailed (dev, edid, timing, quirks); -if (!newmode) -continue ; - -/* First detailed mode is preferred */ -if (i ==0 && (edid->features &DRM_EDID_FEATURE_PREFERRED_TIMING )) - newmode->type |=DRM_MODE_TYPE_PREFERRED ; -drm_mode_probed_add (connector, newmode); +/* In 1.0, only timings are allowed */ +if (!timing->pixel_clock && edid->version ==1 && + edid->revision ==0 ) +continue ; - modes++; - } + modes +=add_detailed_modes (connector, timing, edid, quirks, + preferred); }return modes; } +/** * add_detailed_mode_eedid - get detailed mode info from addtional timing * EDID block
@@ -920,12 +926,9 @@ static int add_detailed_info(struct drm_static int add_detailed_info_eedid (struct drm_connector *connector,struct edid *edid,u32 quirks) { -struct drm_device *dev = connector->dev; -int i, j, modes =0 ; +int i, modes =0 ;char *edid_ext =NULL ;struct detailed_timing *timing; -struct detailed_non_pixel *data; -struct drm_display_mode *newmode;int edid_ext_num;int start_offset, end_offset;int timing_level;
@@ -976,51 +979,7 @@ static int add_detailed_info_eedid(strucfor (i = start_offset; i < end_offset; i +=sizeof (struct detailed_timing )) { timing = (struct detailed_timing *)(edid_ext + i); - data = &timing->data.other_data; -/* Detailed mode timing */ -if (timing->pixel_clock) { - newmode =drm_mode_detailed (dev, edid, timing, quirks); -if (!newmode) -continue ; - -drm_mode_probed_add (connector, newmode); - - modes++; -continue ; - } - -/* Other timing or info */ -switch (data->type) { -case EDID_DETAIL_MONITOR_SERIAL : -break ; -case EDID_DETAIL_MONITOR_STRING : -break ; -case EDID_DETAIL_MONITOR_RANGE : -/* Get monitor range data */ -break ; -case EDID_DETAIL_MONITOR_NAME : -break ; -case EDID_DETAIL_MONITOR_CPDATA : -break ; -case EDID_DETAIL_STD_MODES : -/* Five modes per detailed section */ -for (j =0 ; j <5 ; i++) { -struct std_timing *std; -struct drm_display_mode *newmode; - - std = &data->data.timings[j]; - newmode =drm_mode_std (dev, std, - edid->revision, - timing_level); -if (newmode) { -drm_mode_probed_add (connector, newmode); - modes++; - } - } -break ; -default : -break ; - } + modes +=add_detailed_modes (connector, timing, edid, quirks,0 ); }return modes;
PATCH 24/116 efifb: fix framebuffer handoff
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcin Slusarz <[email protected]>
commit 89f3f2199084a160a3a45fa6d9af235696321758 upstream.
Commit 4410f3910947dcea8672280b3adecd53cec4e85e ("fbdev: add support for handoff from firmware to hw framebuffers") didn't add fb_destroy operation to efifb. Fix it and change aperture_size to match size passed to request_mem_region.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15151
--- drivers/video/efifb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/video/efifb.c +10 -1
@@ -161,8 +161,17 @@ static int efifb_setcolreg(unsigned regnreturn 0 ; } +static void efifb_destroy (struct fb_info *info) +{ +if (info->screen_base) +iounmap (info->screen_base); +release_mem_region (info->aperture_base, info->aperture_size); +framebuffer_release (info); +} +static struct fb_ops efifb_ops = { .owner =THIS_MODULE , + .fb_destroy = efifb_destroy, .fb_setcolreg = efifb_setcolreg, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea,
@@ -281,7 +290,7 @@ static int __init efifb_probe(struct pla info->par =NULL ; info->aperture_base = efifb_fix.smem_start; - info->aperture_size = size_total; + info->aperture_size = size_remap; info->screen_base =ioremap (efifb_fix.smem_start, efifb_fix.smem_len);if (!info->screen_base) {
PATCH 25/116 coredump: suppress uid comparison test if core output files are pipes
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Horman <[email protected]>
commit 76595f79d76fbe6267a51b3a866a028d150f06d4 upstream.
Modify uid check in do_coredump so as to not apply it in the case of pipes.
This just got noticed in testing. The end of do_coredump validates the uid of the inode for the created file against the uid of the crashing process to ensure that no one can pre-create a core file with different ownership and grab the information contained in the core when they shouldn' tbe able to. This causes failures when using pipes for a core dumps if the crashing process is not root, which is the uid of the pipe when it is created.
The fix is simple. Since the check for matching uid's isn't relevant for pipes (a process can't create a pipe that the uermodehelper code will open anyway), we can just just skip it in the event ispipe is non-zero
Reverts a pipe-affecting change which was accidentally made in
: commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af
: Author: Ingo Molnar <[email protected]>
: AuthorDate: Wed Nov 28 13:59:18 2007 +0100
: Commit: Linus Torvalds <[email protected]>
: CommitDate: Wed Nov 28 10:58:01 2007 -0800
:
: vfs: coredumping fix
--- fs/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/exec.c +2 -1
@@ -1913,8 +1913,9 @@ void do_coredump(long signr, int exit_co/* * Dont allow local users get cute and trick others to coredump * into their pre-created files: +* Note, this is not relevant for pipes */ -if (inode->i_uid !=current_fsuid ()) +if (!ispipe && (inode->i_uid !=current_fsuid ())) goto close_fail;if (!file->f_op) goto close_fail;
PATCH 26/116 V4L/DVB (13961): em28xx-dvb: fix memleak in dvb_fini()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Francesco Lavra <[email protected]>
commit 19f48cb105b7fa18d0dcab435919a3a29b7a7c4c upstream.
this patch fixes a memory leak which occurs when an em28xx card with DVB extension is unplugged or its DVB extension driver is unloaded. In dvb_fini(), dev->dvb must be freed before being set to NULL, as is done in dvb_init() in case of error.
Note that this bug is also present in the latest stable kernel release.
--- drivers/media/video/em28xx/em28xx-dvb.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/video/em28xx/em28xx-dvb.c +1 -0
@@ -610,6 +610,7 @@ static int dvb_fini(struct em28xx *dev)if (dev->dvb) {unregister_dvb (dev->dvb); +kfree (dev->dvb); dev->dvb =NULL ; }
PATCH 27/116 hrtimer: Tune hrtimer_interrupt hang logic
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 41d2e494937715d3150e5c75d01f0e75ae899337 upstream.
The hrtimer_interrupt hang logic adjusts min_delta_ns based on the execution time of the hrtimer callbacks.
This is error-prone for virtual machines, where a guest vcpu can be scheduled out during the execution of the callbacks (and the callbacks themselves can do operations that translate to blocking operations in the hypervisor), which in can lead to large min_delta_ns rendering the system unusable.
Replace the current heuristics with something more reliable. Allow the interrupt code to try 3 times to catch up with the lost time. If that fails use the total time spent in the interrupt handler to defer the next timer interrupt so the system can catch up with other things which got delayed. Limit that deferment to 100ms.
The retry events and the maximum time spent in the interrupt handler are recorded and exposed via /proc/timer_list
Inspired by a patch from Marcelo.
--- include/linux/hrtimer.h | 13 ++++-- kernel/hrtimer.c | 96 +++++++++++++++++++++++++++-------------------- kernel/time/timer_list.c | 5 +- 3 files changed, 70 insertions(+), 44 deletions(-)
include/linux/hrtimer.h +9 -4
@@ -162,10 +162,11 @@ struct hrtimer_clock_base {* @expires_next: absolute time of the next event which was scheduled * via clock_set_next_event() * @hres_active: State of high resolution mode -* @check_clocks: Indictator, when set evaluate time source and clock -* event devices whether high resolution mode can be -* activated. -* @nr_events: Total number of timer interrupt events +* @hang_detected: The last hrtimer interrupt detected a hang +* @nr_events: Total number of hrtimer interrupt events +* @nr_retries: Total number of hrtimer interrupt retries +* @nr_hangs: Total number of hrtimer interrupt hangs +* @max_hang_time: Maximum time spent in hrtimer_interrupt */ struct hrtimer_cpu_base {spinlock_t lock;
@@ -173,7 +174,11 @@ struct hrtimer_cpu_base {#ifdef CONFIG_HIGH_RES_TIMERS ktime_t expires_next;int hres_active; +int hang_detected;unsigned long nr_events; +unsigned long nr_retries; +unsigned long nr_hangs; +ktime_t max_hang_time;#endif };
kernel/hrtimer.c +57 -39
138 lines not on this page · raw message
kernel/time/timer_list.c +4 -1
@@ -150,6 +150,9 @@ static void print_cpu(struct seq_file *mP_ns (expires_next);P (hres_active);P (nr_events); +P (nr_retries); +P (nr_hangs); +P_ns (max_hang_time);#endif #undef P#undef P_ns
@@ -252,7 +255,7 @@ static int timer_list_show(struct seq_fiu64 now =ktime_to_ns (ktime_get ());int cpu; -SEQ_printf (m,"Timer List Version: v0.4\n" ); +SEQ_printf (m,"Timer List Version: v0.5\n" );SEQ_printf (m,"HRTIMER_MAX_CLOCK_BASES: %d\n" ,HRTIMER_MAX_CLOCK_BASES );SEQ_printf (m,"now at %Ld nsecs\n" , (unsigned long long )now);
PATCH 28/116 x86, apic: Dont use logical-flat mode when CPU hotplug may exceed 8 CPUs
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit 681ee44d40d7c93b42118320e4620d07d8704fd6 upstream
We need to fall back from logical-flat APIC mode to physical-flat mode when we have more than 8 CPUs. However, in the presence of CPU hotplug(with bios listing not enabled but possible cpus as disabled cpus in MADT), we have to consider the number of possible CPUs rather than the number of current CPUs; otherwise we may cross the 8-CPU boundary when CPUs are added later.
32bit apic code can use more cleanups (like the removal of vendor checks in 32bit default_setup_apic_routing()) and more unifications with 64bit code. Yinghai has some patches in works already. This patch addresses the boot issue that is reported in the virtualization guest context.
--- arch/x86/kernel/acpi/boot.c | 5 ----- arch/x86/kernel/apic/apic.c | 14 -------------- arch/x86/kernel/apic/probe_32.c | 27 ++++++++++++++++++++++++++- arch/x86/kernel/apic/probe_64.c | 13 ++----------- arch/x86/kernel/mpparse.c | 7 ------- arch/x86/kernel/smpboot.c | 2 -- 6 files changed, 28 insertions(+), 40 deletions(-)
arch/x86/kernel/acpi/boot.c +0 -5
@@ -1191,9 +1191,6 @@ static void __init acpi_process_madt(voiif (!error) { acpi_lapic =1 ; -#ifdef CONFIG_X86_BIGSMP -generic_bigsmp_probe (); -#endif /* * Parse MADT IO-APIC entries */
@@ -1203,8 +1200,6 @@ static void __init acpi_process_madt(voi acpi_ioapic =1 ; smp_found_config =1 ; -if (apic->setup_apic_routing) - apic->setup_apic_routing (); } }if (error == -EINVAL ) {
arch/x86/kernel/apic/apic.c +0 -14
@@ -1665,9 +1665,7 @@ int __init APIC_init_uniprocessor(void)#endif enable_IR_x2apic (); -#ifdef CONFIG_X86_64 default_setup_apic_routing (); -#endif verify_local_APIC ();connect_bsp_APIC ();
@@ -1915,18 +1913,6 @@ void __cpuinit generic_processor_info(inif (apicid > max_physical_apicid) max_physical_apicid = apicid; -#ifdef CONFIG_X86_32 -switch (boot_cpu_data.x86_vendor) { -case X86_VENDOR_INTEL : -if (num_processors >8 ) - def_to_bigsmp =1 ; -break ; -case X86_VENDOR_AMD : -if (max_physical_apicid >=8 ) - def_to_bigsmp =1 ; - } -#endif -#if defined(CONFIG_SMP ) || defined(CONFIG_X86_64 )early_per_cpu (x86_cpu_to_apicid, cpu) = apicid;early_per_cpu (x86_bios_cpu_apicid, cpu) = apicid;
arch/x86/kernel/apic/probe_32.c +26 -1
@@ -54,6 +54,31 @@ late_initcall(print_ipi_mode);void default_setup_apic_routing (void ) { +int version = apic_version[boot_cpu_physical_apicid]; + +if (num_possible_cpus () >8 ) { +switch (boot_cpu_data.x86_vendor) { +case X86_VENDOR_INTEL : +if (!APIC_XAPIC (version)) { + def_to_bigsmp =0 ; +break ; + } +/* If P4 and above fall through */ +case X86_VENDOR_AMD : + def_to_bigsmp =1 ; + } + } + +#ifdef CONFIG_X86_BIGSMP +generic_bigsmp_probe (); +#endif + +if (apic->setup_apic_routing) + apic->setup_apic_routing (); +} + +void setup_apic_flat_routing (void ) +{#ifdef CONFIG_X86_IO_APIC printk(KERN_INFO "Enabling APIC mode: Flat. Using %d I/O APICs\n",
@@ -103,7 +128,7 @@ struct apic apic_default = { .init_apic_ldr = default_init_apic_ldr, .ioapic_phys_id_map = default_ioapic_phys_id_map, - .setup_apic_routing = default_setup_apic_routing, + .setup_apic_routing = setup_apic_flat_routing, .multi_timer_check = NULL, .apicid_to_node = default_apicid_to_node, .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
arch/x86/kernel/apic/probe_64.c +2 -11
@@ -67,17 +67,8 @@ void __init default_setup_apic_routing(v }#endif -if (apic == &apic_flat) { -switch (boot_cpu_data.x86_vendor) { -case X86_VENDOR_INTEL : -if (num_processors >8 ) - apic = &apic_physflat; -break ; -case X86_VENDOR_AMD : -if (max_physical_apicid >=8 ) - apic = &apic_physflat; - } - } +if (apic == &apic_flat &&num_possible_cpus () >8 ) + apic = &apic_physflat;printk (KERN_INFO "Setting APIC routing to %s\n" , apic->name);
arch/x86/kernel/mpparse.c +0 -7
@@ -359,13 +359,6 @@ static int __init smp_read_mpc(struct mp x86_init.mpparse.mpc_record (1 ); } -#ifdef CONFIG_X86_BIGSMP -generic_bigsmp_probe (); -#endif - -if (apic->setup_apic_routing) - apic->setup_apic_routing (); -if (!num_processors)printk (KERN_ERR "MPTABLE: no processors registered!\n" );return num_processors;
arch/x86/kernel/smpboot.c +0 -2
@@ -1066,9 +1066,7 @@ void __init native_smp_prepare_cpus(unsiset_cpu_sibling_map (0 );enable_IR_x2apic (); -#ifdef CONFIG_X86_64 default_setup_apic_routing (); -#endif if (smp_sanity_check (max_cpus) <0 ) {printk (KERN_INFO "SMP disabled\n" );
PATCH 29/116 mvsas: add support for Adaptec ASC-1045/1405 SAS/SATA HBA
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Srinivas <[email protected]>
commit 7ec4ad0125db0222e397508c190b01c8f2b5f7cd upstream.
This is support for Adaptec ASC-1045/1405 SAS/SATA HBA on mvsas, which is based on Marvell 88SE6440 chipset.
--- drivers/scsi/mvsas/mv_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/mvsas/mv_init.c +1 -0
@@ -657,6 +657,7 @@ static struct pci_device_id __devinitdat { PCI_VDEVICE(MARVELL, 0x9180), chip_9180 }, { PCI_VDEVICE(ARECA, PCI_DEVICE_ID_ARECA_1300), chip_1300 }, { PCI_VDEVICE(ARECA, PCI_DEVICE_ID_ARECA_1320), chip_1320 }, + { PCI_VDEVICE(ADAPTEC2, 0x0450), chip_6440 }, { } /* terminate list */ };
PATCH 30/116 pci: add support for 82576NS serdes to existing SR-IOV quirk
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexander Duyck <[email protected]>
commit 7a0deb6bcda98c2a764cb87f1441eef920fd3663 upstream.
This patch adds support for the 82576NS Serdes adapter to the existing pci quirk for 82576 parts.
--- drivers/pci/quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/quirks.c +1 -0
@@ -2513,6 +2513,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IDECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x10e8 , quirk_i82576_sriov);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x150a , quirk_i82576_sriov);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x150d , quirk_i82576_sriov); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x1518 , quirk_i82576_sriov);#endif /* CONFIG_PCI_IOV */
PATCH 31/116 sched: Mark boot-cpu active before smp_init()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit 933b0618d8b2a59c7a0742e43836544e02f1e9bd upstream.
A UP machine has 1 active cpu, not having the boot-cpu in the active map when starting the scheduler confuses things.
LKML-Reference: <[email protected]>
--- init/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
init/main.c +1 -6
@@ -369,12 +369,6 @@ static void __init smp_init(void) {unsigned int cpu; -/* -* Set up the current CPU as possible to migrate to. -* The other ones will be done by cpu_up/cpu_down() -*/ -set_cpu_active (smp_processor_id (), true); -/* FIXME: This should be done in userspace --RR */ for_each_present_cpu (cpu) {if (num_online_cpus () >= setup_max_cpus)
@@ -486,6 +480,7 @@ static void __init boot_cpu_init(void)int cpu =smp_processor_id ();/* Mark the boot cpu "present", "online" etc for SMP and UP case */ set_cpu_online (cpu, true); +set_cpu_active (cpu, true);set_cpu_present (cpu, true);set_cpu_possible (cpu, true); }
PATCH 32/116 sparc64: Make prom entry spinlock NMI safe.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 8a4fd1e4922413cfdfa6c51a59efb720d904a5eb ]
If we do something like try to print to the OF console from an NMI while we're already in OpenFirmware, we'll deadlock on the spinlock.
Use a raw spinlock and disable NMIs when we take it.
--- arch/sparc/prom/p1275.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/sparc/prom/p1275.c +6 -4
@@ -32,8 +32,7 @@ extern void prom_cif_interface(void);extern void prom_cif_callback (void );/* -* This provides SMP safety on the p1275buf. prom_callback() drops this lock -* to allow recursuve acquisition. +* This provides SMP safety on the p1275buf. */ DEFINE_SPINLOCK (prom_entry_lock);
@@ -47,7 +46,9 @@ long p1275_cmd(const char *service, long p = p1275buf.prom_buffer; -spin_lock_irqsave (&prom_entry_lock, flags); +raw_local_save_flags (flags); +raw_local_irq_restore (PIL_NMI ); +spin_lock (&prom_entry_lock); p1275buf.prom_args[0 ] = (unsigned long )p;/* service */ strcpy (p, service);
@@ -139,7 +140,8 @@ long p1275_cmd(const char *service, longva_end (list); x = p1275buf.prom_args [nargs +3 ]; -spin_unlock_irqrestore (&prom_entry_lock, flags); +spin_unlock (&prom_entry_lock); +raw_local_irq_restore (flags);return x; }
PATCH 33/116 sysctl: require CAP_SYS_RAWIO to set mmap_min_addr
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kees Cook <[email protected]>
commit 0e1a6ef2dea88101b056b6d9984f3325c5efced3 upstream.
Currently the mmap_min_addr value can only be bypassed during mmap when the task has CAP_SYS_RAWIO. However, the mmap_min_addr sysctl value itself can be adjusted to 0 if euid == 0, allowing a bypass without CAP_SYS_RAWIO. This patch adds a check for the capability before allowing mmap_min_addr to be changed.
--- security/min_addr.c | 3 +++ 1 file changed, 3 insertions(+)
security/min_addr.c +3 -0
@@ -33,6 +33,9 @@ int mmap_min_addr_handler(struct ctl_tab {int ret; +if (!capable (CAP_SYS_RAWIO )) +return -EPERM ; + ret =proc_doulongvec_minmax (table, write, buffer, lenp, ppos);update_mmap_min_addr ();
PATCH 34/116 e1000e: enable new 82567V-3 device
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bruce Allan <[email protected]>
commit 9e135a2e6266eba276f33c404a2478499bc07ff5 upstream.
This new PCI device ID is for a new combination of MAC and PHY both of which already have supporting code in the driver, just not yet in this combination. During validation of the device, an intermittent issue was discovered with waking it from a suspended state which can be resolved with the pre-existing workaround to disable gigabit speed prior to suspending.
--- drivers/net/e1000e/hw.h | 1 + drivers/net/e1000e/ich8lan.c | 1 + drivers/net/e1000e/netdev.c | 1 + 3 files changed, 3 insertions(+)
drivers/net/e1000e/hw.h +1 -0
@@ -356,6 +356,7 @@ enum e1e_registers {#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB +#define E1000_DEV_ID_ICH8_82567V_3 0x1501#define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049#define E1000_DEV_ID_ICH8_IGP_AMT 0x104A#define E1000_DEV_ID_ICH8_IGP_C 0x104B
drivers/net/e1000e/ich8lan.c +1 -0
@@ -3209,6 +3209,7 @@ void e1000e_disable_gig_wol_ich8lan(struu32 phy_ctrl;switch (hw->mac.type) { +case e1000_ich8lan:case e1000_ich9lan:case e1000_ich10lan:case e1000_pchlan:
drivers/net/e1000e/netdev.c +1 -0
@@ -5360,6 +5360,7 @@ static struct pci_device_id e1000_pci_tb { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_C), board_ich8lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M), board_ich8lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M_AMT), board_ich8lan }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_82567V_3), board_ich8lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G), board_ich9lan },
PATCH 35/116 ixgbe: add support for 82599 KR device 0x1517
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Don Skidmore <[email protected]>
commit 74757d49016a8b06ca028196886641d7aeb78de5 upstream.
--- drivers/net/ixgbe/ixgbe_82599.c | 1 + drivers/net/ixgbe/ixgbe_main.c | 2 ++ drivers/net/ixgbe/ixgbe_type.h | 1 + 3 files changed, 4 insertions(+)
drivers/net/ixgbe/ixgbe_82599.c +1 -0
@@ -332,6 +332,7 @@ static enum ixgbe_media_type ixgbe_get_mcase IXGBE_DEV_ID_82599_KX4 :case IXGBE_DEV_ID_82599_KX4_MEZZ :case IXGBE_DEV_ID_82599_COMBO_BACKPLANE : +case IXGBE_DEV_ID_82599_KR :case IXGBE_DEV_ID_82599_XAUI_LOM :/* Default device ID is mezzanine card KX/KX4 */ media_type = ixgbe_media_type_backplane;
drivers/net/ixgbe/ixgbe_main.c +2 -0
@@ -96,6 +96,8 @@ static struct pci_device_id ixgbe_pci_tb board_82599 }, {PCI_VDEVICE (INTEL ,IXGBE_DEV_ID_82599_XAUI_LOM ), board_82599 }, + {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KR), + board_82599 }, {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP), board_82599 }, {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ),
drivers/net/ixgbe/ixgbe_type.h +1 -0
@@ -50,6 +50,7 @@#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4#define IXGBE_DEV_ID_82599_KX4 0x10F7#define IXGBE_DEV_ID_82599_KX4_MEZZ 0x1514 +#define IXGBE_DEV_ID_82599_KR 0x1517#define IXGBE_DEV_ID_82599_CX4 0x10F9#define IXGBE_DEV_ID_82599_SFP 0x10FB#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC
PATCH 36/116 Input: wacom - ensure the device is initialized properly upon resume
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ping Cheng <[email protected]>
commit 232f5693e5c9483e222528ef81979e42ea2f2908 upstream.
Call wacom_query_tablet_data() from wacom_resume() so the device will be switched to Wacom mode upon resume. Devices that require this are: regular tablets and two finger touch devices.
--- drivers/input/tablet/wacom.h | 7 ++++--- drivers/input/tablet/wacom_sys.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/input/tablet/wacom.h +4 -3
@@ -1,7 +1,7 @@/* * drivers/input/tablet/wacom.h * -* USB Wacom Graphire and Wacom Intuos tablet support +* USB Wacom tablet support * * Copyright (c) 2000-2004 Vojtech Pavlik <[email protected]> * Copyright (c) 2000 Andreas Bach Aaen <[email protected]>
@@ -69,6 +69,7 @@* v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A) * v1.50 (pc) - Fixed a TabletPC touch bug in 2.6.28 * v1.51 (pc) - Added support for Intuos4 +* v1.52 (pc) - Query Wacom data upon system resume */ /*
@@ -89,9 +90,9 @@/* * Version Information */ -#define DRIVER_VERSION "v1.51" +#define DRIVER_VERSION "v1.52"#define DRIVER_AUTHOR "Vojtech Pavlik <[email protected]>" -#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" +#define DRIVER_DESC "USB Wacom tablet driver"#define DRIVER_LICENSE "GPL"MODULE_AUTHOR (DRIVER_AUTHOR );
drivers/input/tablet/wacom_sys.c +4 -3
@@ -1,7 +1,7 @@/* * drivers/input/tablet/wacom_sys.c * -* USB Wacom Graphire and Wacom Intuos tablet support - system specific code +* USB Wacom tablet support - system specific code */ /*
@@ -562,9 +562,10 @@ static int wacom_resume(struct usb_interint rv;mutex_lock (&wacom->lock); -if (wacom->open) +if (wacom->open) { rv =usb_submit_urb (wacom->irq,GFP_NOIO ); -else +wacom_query_tablet_data (intf); + }else rv =0 ;mutex_unlock (&wacom->lock);
PATCH 37/116 ath9k: fix lockdep warning when unloading module
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ming Lei <[email protected]>
commit a9f042cbe5284f34ccff15f3084477e11b39b17b upstream.
Since txq->axq_lock may be hold in softirq context, it must be acquired with spin_lock_bh() instead of spin_lock() if softieq is enabled.
The patch fixes the lockdep warning below when unloading ath9k modules.
=================================
[ INFO: inconsistent lock state ]
2.6.33-wl #12
---------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
rmmod/3642 [HC0[0]:SC0[0]:HE1:SE1] takes:
(&(&txq->axq_lock)->rlock){+.?...}, at: [<ffffffffa03568c3>] ath_tx_node_cleanup+0x62/0x180 [ath9k]
{IN-SOFTIRQ-W} state was registered at:
[<ffffffff8107577d>] __lock_acquire+0x2f6/0xd35 [<ffffffff81076289>] lock_acquire+0xcd/0xf1 [<ffffffff813a7486>] _raw_spin_lock_bh+0x3b/0x6e [<ffffffffa0356b49>] spin_lock_bh+0xe/0x10 [ath9k] [<ffffffffa0358ec7>] ath_tx_tasklet+0xcd/0x391 [ath9k] [<ffffffffa0354f5f>] ath9k_tasklet+0x70/0xc8 [ath9k] [<ffffffff8104e601>] tasklet_action+0x8c/0xf4 [<ffffffff8104f459>] __do_softirq+0xf8/0x1cd [<ffffffff8100ab1c>] call_softirq+0x1c/0x30 [<ffffffff8100c2cf>] do_softirq+0x4b/0xa3 [<ffffffff8104f045>] irq_exit+0x4a/0x8c [<ffffffff813acccc>] do_IRQ+0xac/0xc3 [<ffffffff813a7d53>] ret_from_intr+0x0/0x16 [<ffffffff81302d52>] cpuidle_idle_call+0x9e/0xf8 [<ffffffff81008be7>] cpu_idle+0x62/0x9d [<ffffffff81391c1a>] rest_init+0x7e/0x80 [<ffffffff818bbd38>] start_kernel+0x3e8/0x3f3 [<ffffffff818bb2bc>] x86_64_start_reservations+0xa7/0xab [<ffffffff818bb3b8>] x86_64_start_kernel+0xf8/0x107 irq event stamp: 42037 hardirqs last enabled at (42037): [<ffffffff813a7b21>] _raw_spin_unlock_irqrestore+0x47/0x56 hardirqs last disabled at (42036): [<ffffffff813a72f4>] _raw_spin_lock_irqsave+0x2b/0x88 softirqs last enabled at (42000): [<ffffffffa0353ea6>] spin_unlock_bh+0xe/0x10 [ath9k] softirqs last disabled at (41998): [<ffffffff813a7463>] _raw_spin_lock_bh+0x18/0x6e
other info that might help us debug this:
4 locks held by rmmod/3642:
#0: (rtnl_mutex){+.+.+.}, at: [<ffffffff8132c10d>] rtnl_lock+0x17/0x19
#1: (&wdev->mtx){+.+.+.}, at: [<ffffffffa01e53f2>] cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211]
#2: (&ifmgd->mtx){+.+.+.}, at: [<ffffffffa0260834>] ieee80211_mgd_deauth+0x3f/0x17e [mac80211]
#3: (&local->sta_mtx){+.+.+.}, at: [<ffffffffa025a381>] sta_info_destroy_addr+0x2b/0x5e [mac80211]stack backtrace: Pid: 3642, comm: rmmod Not tainted 2.6.33-wl #12 Call Trace: [<ffffffff81074469>] valid_state+0x178/0x18b [<ffffffff81014f94>] ? save_stack_trace+0x2f/0x4c [<ffffffff81074e08>] ? check_usage_backwards+0x0/0x88 [<ffffffff8107458f>] mark_lock+0x113/0x230 [<ffffffff810757f1>] __lock_acquire+0x36a/0xd35 [<ffffffff8101018d>] ? native_sched_clock+0x2d/0x5f [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k] [<ffffffff81076289>] lock_acquire+0xcd/0xf1 [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k] [<ffffffff810732eb>] ? trace_hardirqs_off+0xd/0xf [<ffffffff813a7193>] _raw_spin_lock+0x36/0x69 [<ffffffffa03568c3>] ? ath_tx_node_cleanup+0x62/0x180 [ath9k] [<ffffffffa03568c3>] ath_tx_node_cleanup+0x62/0x180 [ath9k] [<ffffffff810749ed>] ? trace_hardirqs_on+0xd/0xf [<ffffffffa0353950>] ath9k_sta_remove+0x22/0x26 [ath9k] [<ffffffffa025a08f>] __sta_info_destroy+0x1ad/0x38c [mac80211] [<ffffffffa025a394>] sta_info_destroy_addr+0x3e/0x5e [mac80211] [<ffffffffa02605d6>] ieee80211_set_disassoc+0x175/0x180 [mac80211] [<ffffffffa026084d>] ieee80211_mgd_deauth+0x58/0x17e [mac80211] [<ffffffff813a60c1>] ? __mutex_lock_common+0x37f/0x3a4 [<ffffffffa01e53f2>] ? cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211] [<ffffffffa026786e>] ieee80211_deauth+0x1e/0x20 [mac80211] [<ffffffffa01f47f9>] __cfg80211_mlme_deauth+0x130/0x13f [cfg80211] [<ffffffffa01e53f2>] ? cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211] [<ffffffff810732eb>] ? trace_hardirqs_off+0xd/0xf [<ffffffffa01f7eee>] __cfg80211_disconnect+0x111/0x189 [cfg80211] [<ffffffffa01e5433>] cfg80211_netdev_notifier_call+0x2ce/0x46d [cfg80211] [<ffffffff813aa9ea>] notifier_call_chain+0x37/0x63 [<ffffffff81068c98>] raw_notifier_call_chain+0x14/0x16 [<ffffffff81322e97>] call_netdevice_notifiers+0x1b/0x1d [<ffffffff8132386d>] dev_close+0x6a/0xa6 [<ffffffff8132395f>] rollback_registered_many+0xb6/0x2f4 [<ffffffff81323bb8>] unregister_netdevice_many+0x1b/0x66 [<ffffffffa026494f>] ieee80211_remove_interfaces+0xc5/0xd0 [mac80211] [<ffffffffa02580a2>] ieee80211_unregister_hw+0x47/0xe8 [mac80211] [<ffffffffa035290e>] ath9k_deinit_device+0x7a/0x9b [ath9k] [<ffffffffa035bc26>] ath_pci_remove+0x38/0x76 [ath9k] [<ffffffff8120940a>] pci_device_remove+0x2d/0x51 [<ffffffff8129d797>] __device_release_driver+0x7b/0xd1 [<ffffffff8129d885>] driver_detach+0x98/0xbe [<ffffffff8129ca7a>] bus_remove_driver+0x94/0xb7 [<ffffffff8129ddd6>] driver_unregister+0x6c/0x74 [<ffffffff812096d2>] pci_unregister_driver+0x46/0xad [<ffffffffa035bae1>] ath_pci_exit+0x15/0x17 [ath9k] [<ffffffffa035e1a2>] ath9k_exit+0xe/0x2f [ath9k] [<ffffffff8108050a>] sys_delete_module+0x1c7/0x236 [<ffffffff813a7df5>] ? retint_swapgs+0x13/0x1b [<ffffffff810749b5>] ? trace_hardirqs_on_caller+0x119/0x144 [<ffffffff8109b9f6>] ? audit_syscall_entry+0x11e/0x14a [<ffffffff81009bb2>] system_call_fastpath+0x16/0x1b
wlan1: deauthenticating from 00:23:cd:e1:f9:b2 by local choice (reason=3)
PM: Removing info for No Bus:wlan1
cfg80211: Calling CRDA to update world regulatory domain
PM: Removing info for No Bus:rfkill2
PM: Removing info for No Bus:phy1
ath9k 0000:16:00.0: PCI INT A disabled
--- drivers/net/wireless/ath/ath9k/xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +2 -2
@@ -2210,7 +2210,7 @@ void ath_tx_node_cleanup(struct ath_softif (ATH_TXQ_SETUP (sc, i)) { txq = &sc->tx.txq[i]; -spin_lock (&txq->axq_lock); +spin_lock_bh (&txq->axq_lock);list_for_each_entry_safe (ac, ac_tmp, &txq->axq_acq, list) {
@@ -2231,7 +2231,7 @@ void ath_tx_node_cleanup(struct ath_soft } } -spin_unlock (&txq->axq_lock); +spin_unlock_bh (&txq->axq_lock); } } }
PATCH 38/116 mqueue: fix mq_open() file descriptor leak on user-space processes
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: André Goddard Rosa <[email protected]>
commit 4294a8eedb17bbc45e1e7447c2a4d05332943248 upstream.
We leak fd on lookup_one_len() failure
--- ipc/mqueue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
ipc/mqueue.c +1 -2
@@ -706,7 +706,7 @@ SYSCALL_DEFINE4(mq_open, const char __us dentry =lookup_one_len (name, ipc_ns->mq_mnt->mnt_root,strlen (name));if (IS_ERR (dentry)) { error =PTR_ERR (dentry); - goto out_err; + goto out_putfd; }mntget (ipc_ns->mq_mnt);
@@ -744,7 +744,6 @@ out:mntput (ipc_ns->mq_mnt); out_putfd:put_unused_fd (fd); -out_err: fd = error; out_upsem:mutex_unlock (&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex);
PATCH 39/116 virtio: fix out of range array access
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael S. Tsirkin <[email protected]>
commit 3119815912a220bdac943dfbdfee640414c0c611 upstream.
I have observed the following error on virtio-net module unload:
------------[ cut here ]------------ WARNING: at kernel/irq/manage.c:858 __free_irq+0xa0/0x14c() Hardware name: Bochs Trying to free already-free IRQ 0 Modules linked in: virtio_net(-) virtio_blk virtio_pci virtio_ring virtio af_packet e1000 shpchp aacraid uhci_hcd ohci_hcd ehci_hcd [last unloaded: scsi_wait_scan] Pid: 1957, comm: rmmod Not tainted 2.6.33-rc8-vhost #24 Call Trace: [<ffffffff8103e195>] warn_slowpath_common+0x7c/0x94 [<ffffffff8103e204>] warn_slowpath_fmt+0x41/0x43 [<ffffffff810a7a36>] ? __free_pages+0x5a/0x70 [<ffffffff8107cc00>] __free_irq+0xa0/0x14c [<ffffffff8107cceb>] free_irq+0x3f/0x65 [<ffffffffa0081424>] vp_del_vqs+0x81/0xb1 [virtio_pci] [<ffffffffa0091d29>] virtnet_remove+0xda/0x10b [virtio_net] [<ffffffffa0075200>] virtio_dev_remove+0x22/0x4a [virtio] [<ffffffff812709ee>] __device_release_driver+0x66/0xac [<ffffffff81270ab7>] driver_detach+0x83/0xa9 [<ffffffff8126fc66>] bus_remove_driver+0x91/0xb4 [<ffffffff81270fcf>] driver_unregister+0x6c/0x74 [<ffffffffa0075418>] unregister_virtio_driver+0xe/0x10 [virtio] [<ffffffffa0091c4d>] fini+0x15/0x17 [virtio_net] [<ffffffff8106997b>] sys_delete_module+0x1c3/0x230 [<ffffffff81007465>] ? old_ich_force_enable_hpet+0x117/0x164 [<ffffffff813bb720>] ? do_page_fault+0x29c/0x2cc [<ffffffff81028e58>] sysenter_dispatch+0x7/0x27 ---[ end trace 15e88e4c576cc62b ]---
The bug is in virtio-pci: we use msix_vector as array index to get irq entry, but some vqs do not have a dedicated vector so this causes an out of bounds access. By chance, we seem to often get 0 value, which results in this error.
Fix by verifying that vector is legal before using it as index.
--- drivers/virtio/virtio_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/virtio/virtio_pci.c +2 -1
@@ -473,7 +473,8 @@ static void vp_del_vqs(struct virtio_devlist_for_each_entry_safe (vq, n, &vdev->vqs, list) { info = vq->priv; -if (vp_dev->per_vq_vectors) +if (vp_dev->per_vq_vectors && + info->msix_vector !=VIRTIO_MSI_NO_VECTOR )free_irq (vp_dev->msix_entries[info->msix_vector].vector, vq);vp_del_vq (vq);
PATCH 40/116 x86: set_personality_ia32() misses force_personality32
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Oleg Nesterov <[email protected]>
commit 1252f238db48ec419f40c1bdf30fda649860eed9 upstream.
05d43ed8a "x86: get rid of the insane TIF_ABI_PENDING bit" forgot about force_personality32. Fix.
--- arch/x86/kernel/process_64.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c +1 -0
@@ -546,6 +546,7 @@ void set_personality_ia32(void)/* Make sure to be in 32bit mode */ set_thread_flag (TIF_IA32 ); + current->personality |= force_personality32;/* Prepare the first "return" to user space */ current_thread_info ()->status |=TS_COMPAT ;
PATCH 41/116 sched: Fix SCHED_MC regression caused by change in sched cpu_power
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit dd5feea14a7de4edbd9f36db1a2db785de91b88d upstream
On platforms like dual socket quad-core platform, the scheduler load balancer is not detecting the load imbalances in certain scenarios. This is leading to scenarios like where one socket is completely busy (with all the 4 cores running with 4 tasks) and leaving another socket completely idle. This causes performance issues as those 4 tasks share the memory controller, last-level cache bandwidth etc. Also we won't be taking advantage of turbo-mode as much as we would like, etc.
Some of the comparisons in the scheduler load balancing code are comparing the "weighted cpu load that is scaled wrt sched_group's cpu_power" with the "weighted average load per task that is not scaled wrt sched_group's cpu_power". While this has probably been broken for a longer time (for multi socket numa nodes etc), the problem got aggrevated via this recent change:
| | commit f93e65c186ab3c05ce2068733ca10e34fd00125e | Author: Peter Zijlstra <[email protected]> | Date: Tue Sep 1 10:34:32 2009 +0200 | | sched: Restore __cpu_power to a straight sum of power |
Also with this change, the sched group cpu power alone no longer reflects the group capacity that is needed to implement MC, MT performance (default) and power-savings (user-selectable) policies.
We need to use the computed group capacity (sgs.group_capacity, that is computed using the SD_PREFER_SIBLING logic in update_sd_lb_stats()) to find out if the group with the max load is above its capacity and how much load to move etc.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 76 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 33 deletions(-)
kernel/sched.c +43 -33
@@ -3402,6 +3402,7 @@ struct sd_lb_stats {unsigned long max_load;unsigned long busiest_load_per_task;unsigned long busiest_nr_running; +unsigned long busiest_group_capacity;int group_imb;/* Is there imbalance in this sd */ #if defined(CONFIG_SCHED_MC ) || defined(CONFIG_SCHED_SMT )
@@ -3721,8 +3722,7 @@ static inline void update_sg_lb_stats(stunsigned long load, max_cpu_load, min_cpu_load;int i;unsigned int balance_cpu =-1 , first_idle_cpu =0 ; -unsigned long sum_avg_load_per_task; -unsigned long avg_load_per_task; +unsigned long avg_load_per_task =0 ;if (local_group) { balance_cpu =group_first_cpu (group);
@@ -3731,7 +3731,6 @@ static inline void update_sg_lb_stats(st }/* Tally up the load of all CPUs in the group */ - sum_avg_load_per_task = avg_load_per_task =0 ; max_cpu_load =0 ; min_cpu_load = ~0UL ;
@@ -3761,7 +3760,6 @@ static inline void update_sg_lb_stats(st sgs->sum_nr_running += rq->nr_running; sgs->sum_weighted_load +=weighted_cpuload (i); - sum_avg_load_per_task +=cpu_avg_load_per_task (i); }/*
@@ -3779,7 +3777,6 @@ static inline void update_sg_lb_stats(st/* Adjust by relative CPU power of the group */ sgs->avg_load = (sgs->group_load *SCHED_LOAD_SCALE ) / group->cpu_power; -/* * Consider the group unbalanced when the imbalance is larger * than the average weight of two tasks.
@@ -3789,8 +3786,8 @@ static inline void update_sg_lb_stats(st* normalized nr_running number somewhere that negates * the hierarchy? */ - avg_load_per_task = (sum_avg_load_per_task *SCHED_LOAD_SCALE ) / - group->cpu_power; +if (sgs->sum_nr_running) + avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running;if ((max_cpu_load - min_cpu_load) >2 *avg_load_per_task) sgs->group_imb =1 ;
@@ -3859,6 +3856,7 @@ static inline void update_sd_lb_stats(st sds->max_load = sgs.avg_load; sds->busiest = group; sds->busiest_nr_running = sgs.sum_nr_running; + sds->busiest_group_capacity = sgs.group_capacity; sds->busiest_load_per_task = sgs.sum_weighted_load; sds->group_imb = sgs.group_imb; }
@@ -3881,6 +3879,7 @@ static inline void fix_small_imbalance(s {unsigned long tmp, pwr_now =0 , pwr_move =0 ;unsigned int imbn =2 ; +unsigned long scaled_busy_load_per_task;if (sds->this_nr_running) { sds->this_load_per_task /= sds->this_nr_running;
@@ -3891,8 +3890,12 @@ static inline void fix_small_imbalance(s sds->this_load_per_task =cpu_avg_load_per_task (this_cpu); -if (sds->max_load - sds->this_load + sds->busiest_load_per_task >= - sds->busiest_load_per_task * imbn) { + scaled_busy_load_per_task = sds->busiest_load_per_task + *SCHED_LOAD_SCALE ; + scaled_busy_load_per_task /= sds->busiest->cpu_power; + +if (sds->max_load - sds->this_load + scaled_busy_load_per_task >= + (scaled_busy_load_per_task * imbn)) { *imbalance = sds->busiest_load_per_task;return ; }
@@ -3943,7 +3946,14 @@ static inline void fix_small_imbalance(sstatic inline void calculate_imbalance (struct sd_lb_stats *sds,int this_cpu,unsigned long *imbalance) { -unsigned long max_pull; +unsigned long max_pull, load_above_capacity = ~0UL ; + + sds->busiest_load_per_task /= sds->busiest_nr_running; +if (sds->group_imb) { + sds->busiest_load_per_task = +min (sds->busiest_load_per_task, sds->avg_load); + } +/* * In the presence of smp nice balancing, certain scenarios can have * max load less than avg load(as we skip the groups at or below
@@ -3954,9 +3964,29 @@ static inline void calculate_imbalance(sreturn fix_small_imbalance (sds, this_cpu, imbalance); } -/* Don't want to pull so many tasks that a group would go idle */ - max_pull =min (sds->max_load - sds->avg_load, - sds->max_load - sds->busiest_load_per_task); +if (!sds->group_imb) { +/* +* Don't want to pull so many tasks that a group would go idle. +*/ + load_above_capacity = (sds->busiest_nr_running - + sds->busiest_group_capacity); + + load_above_capacity *= (SCHED_LOAD_SCALE *SCHED_LOAD_SCALE ); + + load_above_capacity /= sds->busiest->cpu_power; + } + +/* +* We're trying to get all the cpus to the average_load, so we don't +* want to push ourselves above the average load, nor do we wish to +* reduce the max loaded cpu below the average load. At the same time, +* we also don't want to reduce the group load below the group capacity +* (so that we can implement power-savings policies etc). Thus we look +* for the minimum possible imbalance. +* Be careful of negative numbers as they'll appear as very large values +* with unsigned longs. +*/ + max_pull =min (sds->max_load - sds->avg_load, load_above_capacity);/* How much load to actually move to equalise the imbalance */ *imbalance = min(max_pull * sds->busiest->cpu_power,
@@ -4024,7 +4054,6 @@ find_busiest_group(struct sched_domain ** 4) This group is more busy than the avg busieness at this * sched_domain. * 5) The imbalance is within the specified limit. -* 6) Any rebalance would lead to ping-pong */ if (balance && !(*balance)) goto ret;
@@ -4043,25 +4072,6 @@ find_busiest_group(struct sched_domain *if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) goto out_balanced; - sds.busiest_load_per_task /= sds.busiest_nr_running; -if (sds.group_imb) - sds.busiest_load_per_task = -min (sds.busiest_load_per_task, sds.avg_load); - -/* -* We're trying to get all the cpus to the average_load, so we don't -* want to push ourselves above the average load, nor do we wish to -* reduce the max loaded cpu below the average load, as either of these -* actions would just result in more rebalancing later, and ping-pong -* tasks around. Thus we look for the minimum possible imbalance. -* Negative imbalances (*we* are more loaded than anyone else) will -* be counted as no imbalance for these purposes -- we can't fix that -* by pulling tasks to us. Be careful of negative numbers as they'll -* appear as very large values with unsigned longs. -*/ -if (sds.max_load <= sds.busiest_load_per_task) - goto out_balanced; -/* Looks like there is an imbalance. Compute it */ calculate_imbalance (&sds, this_cpu, imbalance);return sds.busiest;
PATCH 42/116 readahead: add blk_run_backing_dev
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hisashi Hifumi <[email protected]>
commit 65a80b4c61f5b5f6eb0f5669c8fb120893bfb388 upstream.
I added blk_run_backing_dev on page_cache_async_readahead so readahead I/O is unpluged to improve throughput on especially RAID environment.
The normal case is, if page N become uptodate at time T(N), then T(N) <= T(N+1) holds. With RAID (and NFS to some degree), there is no strict ordering, the data arrival time depends on runtime status of individual disks, which breaks that formula. So in do_generic_file_read(), just after submitting the async readahead IO request, the current page may well be uptodate, so the page won't be locked, and the block device won't be implicitly unplugged:
if (PageReadahead(page))
page_cache_async_readahead()
if (!PageUptodate(page))
goto page_not_up_to_date;
//...
page_not_up_to_date:
lock_page_killable(page);Therefore explicit unplugging can help.
Following is the test result with dd.
#dd if=testdir/testfile of=/dev/null bs=16384
-2.6.30-rc6
1048576+0 records in
1048576+0 records out
17179869184 bytes (17 GB) copied, 224.182 seconds, 76.6 MB/s
-2.6.30-rc6-patched
1048576+0 records in
1048576+0 records out
17179869184 bytes (17 GB) copied, 206.465 seconds, 83.2 MB/s
(7Disks RAID-0 Array)
-2.6.30-rc6
1054976+0 records in
1054976+0 records out
17284726784 bytes (17 GB) copied, 212.233 seconds, 81.4 MB/s
-2.6.30-rc6-patched
1054976+0 records out
17284726784 bytes (17 GB) copied, 198.878 seconds, 86.9 MB/s
(7Disks RAID-5 Array)
The patch was found to improve performance with the SCST scsi target driver. See
http://sourceforge.net/mailarchive/forum.php?thread_name=a0272b440906030714g67eabc5k8f847fb1e538cc62%40mail.gmail.com&forum_name=scst-devel
--- mm/readahead.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
mm/readahead.c +12 -0
@@ -553,5 +553,17 @@ page_cache_async_readahead(struct addres/* do read-ahead */ ondemand_readahead (mapping, ra, filp, true, offset, req_size); + +#ifdef CONFIG_BLOCK +/* +* Normally the current page is !uptodate and lock_page() will be +* immediately called to implicitly unplug the device. However this +* is not always true for RAID conifgurations, where data arrives +* not strictly in their submission order. In this case we need to +* explicitly kick off the IO. +*/ +if (PageUptodate (page)) +blk_run_backing_dev (mapping->backing_dev_info,NULL ); +#endif }EXPORT_SYMBOL_GPL (page_cache_async_readahead);
PATCH 43/116 ALSA: hda: Use LPIB and 6stack-dig for eMachines T5212
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 572c0e3c73341755f3e7dfaaef6b26df12bd709c upstream.
The OR has verified that both position_fix=1 and model=6stack-dig are necessary to have capture function properly. (The existing 3stack-6ch model quirk seems to be incorrect.)
--- sound/pci/hda/hda_intel.c | 1 + sound/pci/hda/patch_realtek.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +1 -0
@@ -2230,6 +2230,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x1028 ,0x01f6 ,"Dell Latitude 131L" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x820f ,"Biostar Microtech" ,POS_FIX_LPIB ), + SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB), {} };
sound/pci/hda/patch_realtek.c +1 -1
@@ -8921,7 +8921,7 @@ static struct snd_pci_quirk alc882_cfg_tSND_PCI_QUIRK (0x8086 ,0x0022 ,"DX58SO" ,ALC889_INTEL ),SND_PCI_QUIRK (0x8086 ,0x0021 ,"Intel IbexPeak" ,ALC889A_INTEL ),SND_PCI_QUIRK (0x8086 ,0x3b56 ,"Intel IbexPeak" ,ALC889A_INTEL ), - SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), + SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG), {} };
PATCH 44/116 ALSA: hda - Disable MSI for Nvidia controller
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 80c43ed724797627d8f86855248c497a6161a214 upstream.
Judging from the member of enable_msi white-list, Nvidia controller seems to cause troubles with MSI enabled, e.g. boot hang up or other serious issue may come up. It's safer to disable MSI as default for Nvidia controllers again for now.
--- sound/pci/hda/hda_intel.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/pci/hda/hda_intel.c +7 -0
@@ -2335,6 +2335,13 @@ static void __devinit check_msi(struct a"hda_intel: msi for device %04x:%04x set to %d\n" , q->subvendor, q->subdevice, q->value); chip->msi = q->value; +return ; + } + +/* NVidia chipsets seem to cause troubles with MSI */ +if (chip->driver_type ==AZX_DRIVER_NVIDIA ) { +printk (KERN_INFO "hda_intel: Disable MSI for Nvidia chipset\n" ); + chip->msi =0 ; } }
PATCH 45/116 ALSA: hda - Fix secondary ADC of ALC260 basic model
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 9c4cc0bdede1c39bde60a0d5d9251aac71fbe719 upstream.
Fix adc_nids[] for ALC260 basic model to match with num_adc_nids. Otherwise you get an invalid NID in the secondary "Input Source" mixer element.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -6281,7 +6281,7 @@ static struct alc_config_preset alc260_p .num_dacs = ARRAY_SIZE(alc260_dac_nids), .dac_nids = alc260_dac_nids, .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids), - .adc_nids = alc260_adc_nids, + .adc_nids = alc260_dual_adc_nids, .num_channel_mode = ARRAY_SIZE(alc260_modes), .channel_mode = alc260_modes, .input_mux = &alc260_capture_source,
PATCH 46/116 ALSA: hda: Fix 0 dB offset for HP laptops using CX20551 (Waikiki)
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 025f206c9e0f96cc41567b01c07fb852d8900da1 upstream.
The OR has verified that his hardware distorts because of the 0 dB offset not corresponding to the highest PCM level. Fix this by capping said PCM level to 0 dB similarly to what we do for CX20549 (Venice).
--- sound/pci/hda/patch_conexant.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/pci/hda/patch_conexant.c +15 -0
@@ -1581,6 +1581,21 @@ static int patch_cxt5047(struct hda_code#endif } spec->vmaster_nid =0x13 ; + +switch (codec->subsystem_id >>16 ) { +case 0x103c : +/* HP laptops have really bad sound over 0 dB on NID 0x10. +* Fix max PCM level to 0 dB (originally it has 0x1e steps +* with 0 dB offset 0x17) +*/ +snd_hda_override_amp_caps (codec,0x10 ,HDA_INPUT , + (0x17 <<AC_AMPCAP_OFFSET_SHIFT ) | + (0x17 <<AC_AMPCAP_NUM_STEPS_SHIFT ) | + (0x05 <<AC_AMPCAP_STEP_SIZE_SHIFT ) | + (1 <<AC_AMPCAP_MUTE_SHIFT )); +break ; + } +return 0 ; }
PATCH 47/116 ALSA: cmipci: work around invalid PCM pointer
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit 1c583063a5c769fe2ec604752e383972c69e6d9b upstream.
When the CMI8738 FRAME2 register is read, the chip sometimes (probably when wrapping around) returns an invalid value that would be outside the programmed DMA buffer. This leads to an inconsistent PCM pointer that is likely to result in an underrun.
To work around this, read the register multiple times until we get a valid value; the error state seems to be very short-lived.
--- sound/pci/cmipci.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
sound/pci/cmipci.c +11 -3
@@ -941,13 +941,21 @@ static snd_pcm_uframes_t snd_cmipci_pcm_ struct snd_pcm_substream *substream) {size_t ptr; -unsigned int reg; +unsigned int reg, rem, tries; +if (!rec->running)return 0 ;#if 1 // this seems better.. reg = rec->ch ?CM_REG_CH1_FRAME2 :CM_REG_CH0_FRAME2 ; - ptr = rec->dma_size - (snd_cmipci_read_w (cm, reg) +1 ); - ptr >>= rec->shift; +for (tries =0 ; tries <3 ; tries++) { + rem =snd_cmipci_read_w (cm, reg); +if (rem < rec->dma_size) + goto ok; + } +printk (KERN_ERR "cmipci: invalid PCM pointer: %#x\n" , rem); +return SNDRV_PCM_POS_XRUN ; +ok: + ptr = (rec->dma_size - (rem +1 )) >> rec->shift;#else reg = rec->ch ?CM_REG_CH1_FRAME1 :CM_REG_CH0_FRAME1 ; ptr =snd_cmipci_read (cm, reg) - rec->offset;
PATCH 48/116 gigaset: correct clearing of at_state strings on RING
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
commit 3a0a3a6b92edf181f849ebd8417122392ba73a96 upstream.
In RING handling, clear the table of received parameter strings in a loop like everywhere else, instead of by enumeration which had already gotten out of sync.
Impact: minor bugfix
--- drivers/isdn/gigaset/ev-layer.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/isdn/gigaset/ev-layer.c +4 -8
@@ -1243,14 +1243,10 @@ static void do_action(int action, struct* note that bcs may be NULL if no B channel is free */ at_state2->ConState =700 ; -kfree (at_state2->str_var[STR_NMBR ]); - at_state2->str_var[STR_NMBR ] =NULL ; -kfree (at_state2->str_var[STR_ZCPN ]); - at_state2->str_var[STR_ZCPN ] =NULL ; -kfree (at_state2->str_var[STR_ZBC ]); - at_state2->str_var[STR_ZBC ] =NULL ; -kfree (at_state2->str_var[STR_ZHLC ]); - at_state2->str_var[STR_ZHLC ] =NULL ; +for (i =0 ; i <STR_NUM ; ++i) { +kfree (at_state2->str_var[i]); + at_state2->str_var[i] =NULL ; + } at_state2->int_var[VAR_ZCTP ] =-1 ;spin_lock_irqsave (&cs->lock, flags);
PATCH 49/116 gigaset: prune use of tty_buffer_request_room
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
commit 873a69a358a6b393fd8d9d92e193ec8895cac4d7 upstream.
Calling tty_buffer_request_room() before tty_insert_flip_string() is unnecessary, costs CPU and for big buffers can mess up the multi-page allocation avoidance.
--- drivers/isdn/gigaset/interface.c | 1 - 1 file changed, 1 deletion(-)
drivers/isdn/gigaset/interface.c +0 -1
@@ -635,7 +635,6 @@ void gigaset_if_receive(struct cardstateif ((tty = cs->tty) ==NULL )gig_dbg (DEBUG_ANY ,"receive on closed device" );else { -tty_buffer_request_room (tty, len);tty_insert_flip_string (tty, buffer, len);tty_flip_buffer_push (tty); }
PATCH 50/116 perf: Make the install relative to DESTDIR if specified
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: John Kacur <[email protected]>
commit 7ae5f21361fea11f58c398701da635f778635d13 upstream.
Without this change, the install path is relative to prefix/DESTDIR where prefix is automatically set to $HOME.
This can produce unexpected results. For example:
make -C tools/perf DESTDIR=/home/jkacur/tmp install-man
creates the directory: /home/jkacur/home/jkacur/tmp/share/...
instead of the expected: /home/jkacur/tmp/share/...
LKML-Reference: <[email protected]>
--- tools/perf/Documentation/Makefile | 4 +++- tools/perf/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/Documentation/Makefile +3 -1
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT)) DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) +# Make the path relative to DESTDIR, not prefix +ifndef DESTDIR prefix?=$(HOME) +endif bindir?=$(prefix)/bin htmldir?=$(prefix)/share/doc/perf-doc pdfdir?=$(prefix)/share/doc/perf-doc
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man man1dir=$(mandir)/man1 man5dir=$(mandir)/man5 man7dir=$(mandir)/man7 -# DESTDIR= ASCIIDOC=asciidoc ASCIIDOC_EXTRA = --unsafe
tools/perf/Makefile +3 -1
@@ -218,7 +218,10 @@ STRIP ?= strip # runtime figures out where they are based on the path to the executable. # This can help installing the suite in a relocatable way. +# Make the path relative to DESTDIR, not to prefix +ifndef DESTDIR prefix = $(HOME) +endif bindir_relative = bin bindir = $(prefix)/$(bindir_relative) mandir = share/man
@@ -235,7 +238,6 @@ sysconfdir = $(prefix)/etc ETC_PERFCONFIG = etc/perfconfig endif lib = lib -# DESTDIR= export prefix bindir sharedir sysconfdir
PATCH 51/116 perf_event: Fix oops triggered by cpu offline/online
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paul Mackerras <[email protected]>
commit 220b140b52ab6cc133f674a7ffec8fa792054f25 upstream.
Anton Blanchard found that he could reliably make the kernel hit a BUG_ON in the slab allocator by taking a cpu offline and then online while a system-wide perf record session was running.
The reason is that when the cpu comes up, we completely reinitialize the ctx field of the struct perf_cpu_context for the cpu. If there is a system-wide perf record session running, then there will be a struct perf_event that has a reference to the context, so its refcount will be 2. (The perf_event has been removed from the context's group_entry and event_entry lists by perf_event_exit_cpu(), but that doesn't remove the perf_event's reference to the context and doesn't decrement the context's refcount.)
When the cpu comes up, perf_event_init_cpu() gets called, and it calls __perf_event_init_context() on the cpu's context. That resets the refcount to 1. Then when the perf record session finishes and the perf_event is closed, the refcount gets decremented to 0 and the context gets kfreed after an RCU grace period. Since the context wasn't kmalloced -- it's part of a per-cpu variable -- bad things happen.
In fact we don't need to completely reinitialize the context when the cpu comes up. It's sufficient to initialize the context once at boot, but we need to do it for all possible cpus.
This moves the context initialization to happen at boot time. With this, we don't trash the refcount and the context never gets kfreed, and we don't hit the BUG_ON.
--- kernel/perf_event.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
kernel/perf_event.c +12 -1
@@ -4981,12 +4981,22 @@ int perf_event_init_task(struct task_strreturn ret; } +static void __init perf_event_init_all_cpus (void ) +{ +int cpu; +struct perf_cpu_context *cpuctx; + +for_each_possible_cpu (cpu) { + cpuctx = &per_cpu (perf_cpu_context, cpu); +__perf_event_init_context (&cpuctx->ctx,NULL ); + } +} +static void __cpuinit perf_event_init_cpu (int cpu) {struct perf_cpu_context *cpuctx; cpuctx = &per_cpu (perf_cpu_context, cpu); -__perf_event_init_context (&cpuctx->ctx,NULL );spin_lock (&perf_resource_lock); cpuctx->max_pertask = perf_max_events - perf_reserved_percpu;
@@ -5057,6 +5067,7 @@ static struct notifier_block __cpuinitdavoid __init perf_event_init (void ) { +perf_event_init_all_cpus ();perf_cpu_notify (&perf_cpu_nb, (unsigned long )CPU_UP_PREPARE , (void *)(long )smp_processor_id ()); perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_ONLINE,
PATCH 52/116 tmpfs: fix oops on mounts with mpol=default
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ravikiran G Thirumalai <[email protected]>
commit 413b43deab8377819aba1dbad2abf0c15d59b491 upstream.
Fix an 'oops' when a tmpfs mount point is mounted with the mpol=default mempolicy.
Upon remounting a tmpfs mount point with 'mpol=default' option, the mount code crashed with a null pointer dereference. The initial problem report was on 2.6.27, but the problem exists in mainline 2.6.34-rc as well. On examining the code, we see that mpol_new returns NULL if default mempolicy was requested. This 'NULL' mempolicy is accessed to store the node mask resulting in oops.
The following patch fixes it.
--- mm/mempolicy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
mm/mempolicy.c +7 -2
@@ -2142,10 +2142,15 @@ int mpol_parse_str(char *str, struct mem goto out; mode =MPOL_PREFERRED ;break ; - +case MPOL_DEFAULT : +/* +* Insist on a empty nodelist +*/ +if (!nodelist) + err =0 ; + goto out;/* * case MPOL_BIND: mpol_new() enforces non-empty nodemask. -* case MPOL_DEFAULT: mpol_new() enforces empty nodemask, ignores flags. */ }
PATCH 53/116 tmpfs: mpol=bind:0 dont cause mount error.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit d69b2e63e9172afb4d07c305601b79a55509ac4c upstream.
Currently, following mount operation cause mount error.
% mount -t tmpfs -ompol=bind:0 none /tmp
Because commit 71fe804b6d5 (mempolicy: use struct mempolicy pointer in shmem_sb_info) corrupted MPOL_BIND parse code.
This patch restore the needed one.
--- mm/mempolicy.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
mm/mempolicy.c +7 -3
@@ -2149,9 +2149,13 @@ int mpol_parse_str(char *str, struct memif (!nodelist) err =0 ; goto out; -/* -* case MPOL_BIND: mpol_new() enforces non-empty nodemask. -*/ +case MPOL_BIND : +/* +* Insist on a nodelist +*/ +if (!nodelist) + goto out; + err =0 ; } mode_flags =0 ;
PATCH 54/116 tmpfs: handle MPOL_LOCAL mount option properly
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 12821f5fb942e795f8009ece14bde868893bd811 upstream.
commit 71fe804b6d5 (mempolicy: use struct mempolicy pointer in shmem_sb_info) added mpol=local mount option. but its feature is broken since it was born. because such code always return 1 (i.e. mount failure).
This patch fixes it.
--- mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+)
mm/mempolicy.c +1 -0
@@ -2141,6 +2141,7 @@ int mpol_parse_str(char *str, struct memif (nodelist) goto out; mode =MPOL_PREFERRED ; + err =0 ;break ;case MPOL_DEFAULT :/*
PATCH 55/116 tmpfs: cleanup mpol_parse_str()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 926f2ae04f183098cf9a30521776fb2759c8afeb upstream.
mpol_parse_str() made lots 'err' variable related bug. Because it is ugly and reviewing unfriendly.
This patch simplifies it.
--- mm/mempolicy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
mm/mempolicy.c +12 -12
@@ -2122,8 +2122,8 @@ int mpol_parse_str(char *str, struct memchar *rest = nodelist;while (isdigit (*rest)) rest++; -if (!*rest) - err =0 ; +if (*rest) + goto out; }break ;case MPOL_INTERLEAVE :
@@ -2132,7 +2132,6 @@ int mpol_parse_str(char *str, struct mem*/ if (!nodelist) nodes = node_states[N_HIGH_MEMORY ]; - err =0 ;break ;case MPOL_LOCAL :/*
@@ -2141,7 +2140,6 @@ int mpol_parse_str(char *str, struct memif (nodelist) goto out; mode =MPOL_PREFERRED ; - err =0 ;break ;case MPOL_DEFAULT :/*
@@ -2156,7 +2154,6 @@ int mpol_parse_str(char *str, struct mem*/ if (!nodelist) goto out; - err =0 ; } mode_flags =0 ;
@@ -2170,13 +2167,14 @@ int mpol_parse_str(char *str, struct memelse if (!strcmp (flags,"relative" )) mode_flags |=MPOL_F_RELATIVE_NODES ;else - err =1 ; + goto out; } new =mpol_new (mode, mode_flags, &nodes);if (IS_ERR (new)) - err =1 ; -else { + goto out; + + {int ret;NODEMASK_SCRATCH (scratch);if (scratch) {
@@ -2187,13 +2185,15 @@ int mpol_parse_str(char *str, struct mem ret = -ENOMEM ;NODEMASK_SCRATCH_FREE (scratch);if (ret) { - err =1 ;mpol_put (new); - }else if (no_context) { -/* save for contextualization */ - new->w.user_nodemask = nodes; + goto out; } } + err =0 ; +if (no_context) { +/* save for contextualization */ + new->w.user_nodemask = nodes; + } out:/* Restore string for error message */
PATCH 56/116 doc: add the documentation for mpol=local
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 5574169613b40b85d6f4c67208fa4846b897a0a1 upstream.
commit 3f226aa1c (mempolicy: support mpol=local tmpfs mount option) added new mpol=local mount option. but it didn't add a documentation.
This patch does it.
--- Documentation/filesystems/tmpfs.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/filesystems/tmpfs.txt +5 -1
@@ -82,11 +82,13 @@ tmpfs has a mount option to set the NUMA all files in that instance (if CONFIG_NUMA is enabled) - which can be adjusted on the fly via 'mount -o remount ...' -mpol=default prefers to allocate memory from the local node +mpol=default use the process allocation policy + (see set_mempolicy(2)) mpol=prefer:Node prefers to allocate memory from the given Node mpol=bind:NodeList allocates memory only from nodes in NodeList mpol=interleave prefers to allocate from each node in turn mpol=interleave:NodeList allocates from each node of NodeList in turn +mpol=local prefers to allocate memory from the local node NodeList format is a comma-separated list of decimal numbers and ranges, a range being two hyphen-separated decimal numbers, the smallest and
@@ -134,3 +136,5 @@ Author: Christoph Rohland <[email protected]>, 1.12.01 Updated: Hugh Dickins, 4 June 2007 +Updated: + KOSAKI Motohiro, 16 Mar 2010
PATCH 57/116 SCSI: scsi_transport_fc: Fix synchronization issue while deleting vport
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Gal Rosen <[email protected]>
commit 0d9dc7c8b9b7fa0f53647423b41056ee1beed735 upstream.
The issue occur while deleting 60 virtual ports through the sys interface /sys/class/fc_vports/vport-X/vport_delete. It happen while in a mistake each request sent twice for the same vport. This interface is asynchronous, entering the delete request into a work queue, allowing more than one request to enter to the delete work queue. The result is a NULL pointer. The first request already delete the vport, while the second request got a pointer to the vport before the device destroyed. Re-create vport later cause system freeze.
Solution: Check vport flags before entering the request to the work queue.
--- drivers/scsi/scsi_transport_fc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/scsi/scsi_transport_fc.c +12 -12
@@ -1215,6 +1215,15 @@ store_fc_vport_delete(struct device *dev {struct fc_vport *vport =transport_class_to_vport (dev);struct Scsi_Host *shost =vport_to_shost (vport); +unsigned long flags; + +spin_lock_irqsave (shost->host_lock, flags); +if (vport->flags & (FC_VPORT_DEL |FC_VPORT_CREATING )) { +spin_unlock_irqrestore (shost->host_lock, flags); +return -EBUSY ; + } + vport->flags |=FC_VPORT_DELETING ; +spin_unlock_irqrestore (shost->host_lock, flags);fc_queue_work (shost, &vport->vport_delete_work);return count;
@@ -1804,6 +1813,9 @@ store_fc_host_vport_delete(struct devicelist_for_each_entry (vport, &fc_host->vports, peers) {if ((vport->channel ==0 ) && (vport->port_name == wwpn) && (vport->node_name == wwnn)) { +if (vport->flags & (FC_VPORT_DEL |FC_VPORT_CREATING )) +break ; + vport->flags |=FC_VPORT_DELETING ; match =1 ;break ; }
@@ -3328,18 +3340,6 @@ fc_vport_terminate(struct fc_vport *vporunsigned long flags;int stat; -spin_lock_irqsave (shost->host_lock, flags); -if (vport->flags &FC_VPORT_CREATING ) { -spin_unlock_irqrestore (shost->host_lock, flags); -return -EBUSY ; - } -if (vport->flags & (FC_VPORT_DEL )) { -spin_unlock_irqrestore (shost->host_lock, flags); -return -EALREADY ; - } - vport->flags |=FC_VPORT_DELETING ; -spin_unlock_irqrestore (shost->host_lock, flags); -if (i->f->vport_delete) stat = i->f->vport_delete (vport);else
PATCH 58/116 NFSv4: Dont ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit b4d2314bb88b07e5a04e6c75b442a1dfcd60e340 upstream.
If the NFS_INO_REVAL_FORCED flag is set, that means that we don't yet have an up to date attribute cache. Even if we hold a delegation, we must put a GETATTR on the wire.
--- fs/nfs/delegation.h | 6 ++++++ fs/nfs/dir.c | 2 +- fs/nfs/inode.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
fs/nfs/delegation.h +6 -0
@@ -68,4 +68,10 @@ static inline int nfs_inode_return_deleg }#endif +static inline int nfs_have_delegated_attributes (struct inode *inode) +{ +return nfs_have_delegation (inode,FMODE_READ ) && + !(NFS_I (inode)->cache_validity &NFS_INO_REVAL_FORCED ); +} +#endif
fs/nfs/dir.c +1 -1
@@ -1797,7 +1797,7 @@ static int nfs_access_get_cached(struct cache =nfs_access_search_rbtree (inode, cred);if (cache ==NULL ) goto out; -if (!nfs_have_delegation (inode,FMODE_READ ) && +if (!nfs_have_delegated_attributes (inode) && !time_in_range_open (jiffies, cache->jiffies, cache->jiffies + nfsi->attrtimeo)) goto out_stale; res->jiffies = cache->jiffies;
fs/nfs/inode.c +1 -1
@@ -759,7 +759,7 @@ int nfs_attribute_timeout(struct inode * {struct nfs_inode *nfsi =NFS_I (inode); -if (nfs_have_delegation (inode,FMODE_READ )) +if (nfs_have_delegated_attributes (inode))return 0 ;return !time_in_range_open (jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo); }
PATCH 59/116 NFS: Avoid a deadlock in nfs_release_page
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit bb6fbc4548b9ae7ebbd06ef72f00229df259d217 upstream.
J.R. Okajima reports the following deadlock:
INFO: task kswapd0:305 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kswapd0 D 0000000000000001 0 305 2 0x00000000
ffff88001f21d4f0 0000000000000046 ffff88001fdea680 ffff88001f21c000 ffff88001f21dfd8 ffff88001f21c000 ffff88001f21dfd8 ffff88001f21dfd8 ffff88001fdea040 0000000000014c00 0000000000000001 ffff88001fdea040
Call Trace: [<ffffffff8146155d>] io_schedule+0x4d/0x70 [<ffffffff810d2be5>] sync_page+0x65/0xa0 [<ffffffff81461b12>] __wait_on_bit_lock+0x52/0xb0 [<ffffffff810d2b80>] ? sync_page+0x0/0xa0 [<ffffffff810d2b64>] __lock_page+0x64/0x70 [<ffffffff81070ce0>] ? wake_bit_function+0x0/0x40 [<ffffffff810df1d4>] truncate_inode_pages_range+0x344/0x4a0 [<ffffffff810df340>] truncate_inode_pages+0x10/0x20 [<ffffffff8112cbfe>] generic_delete_inode+0x15e/0x190 [<ffffffff8112cc8d>] generic_drop_inode+0x5d/0x80 [<ffffffff8112bb88>] iput+0x78/0x80 [<ffffffff811bc908>] nfs_dentry_iput+0x38/0x50 [<ffffffff811285f4>] dentry_iput+0x84/0x110 [<ffffffff811286ae>] d_kill+0x2e/0x60 [<ffffffff8112912a>] dput+0x7a/0x170 [<ffffffff8111e925>] path_put+0x15/0x40 [<ffffffff811c3a44>] __put_nfs_open_context+0xa4/0xb0 [<ffffffff811cb5d0>] ? nfs_free_request+0x0/0x50 [<ffffffff811c3b0b>] put_nfs_open_context+0xb/0x10 [<ffffffff811cb5f9>] nfs_free_request+0x29/0x50 [<ffffffff81234b7e>] kref_put+0x8e/0xe0 [<ffffffff811cb594>] nfs_release_request+0x14/0x20 [<ffffffff811cf769>] nfs_find_and_lock_request+0x89/0xa0 [<ffffffff811d1180>] nfs_wb_page+0x80/0x110 [<ffffffff811c0770>] nfs_release_page+0x70/0x90 [<ffffffff810d18ee>] try_to_release_page+0x5e/0x80 [<ffffffff810e1178>] shrink_page_list+0x638/0x860 [<ffffffff810e19de>] shrink_zone+0x63e/0xc40
We can fix this by making the call to put_nfs_open_context() happen when we actually remove the write request from the inode (which is done by the nfsiod thread in this case).
--- fs/nfs/pagelist.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
fs/nfs/pagelist.c +13 -10
@@ -112,12 +112,10 @@ void nfs_unlock_request(struct nfs_page*/ int nfs_set_page_tag_locked (struct nfs_page *req) { -struct nfs_inode *nfsi =NFS_I (req->wb_context->path.dentry->d_inode); -if (!nfs_lock_request_dontget (req))return 0 ;if (req->wb_page !=NULL ) -radix_tree_tag_set (&nfsi->nfs_page_tree, req->wb_index,NFS_PAGE_TAG_LOCKED ); +radix_tree_tag_set (&NFS_I (req->wb_context->path.dentry->d_inode)->nfs_page_tree, req->wb_index,NFS_PAGE_TAG_LOCKED );return 1 ; }
@@ -126,10 +124,10 @@ int nfs_set_page_tag_locked(struct nfs_p*/ void nfs_clear_page_tag_locked (struct nfs_page *req) { -struct inode *inode = req->wb_context->path.dentry->d_inode; -struct nfs_inode *nfsi =NFS_I (inode); -if (req->wb_page !=NULL ) { +struct inode *inode = req->wb_context->path.dentry->d_inode; +struct nfs_inode *nfsi =NFS_I (inode); +spin_lock (&inode->i_lock);radix_tree_tag_clear (&nfsi->nfs_page_tree, req->wb_index,NFS_PAGE_TAG_LOCKED );nfs_unlock_request (req);
@@ -142,16 +140,22 @@ void nfs_clear_page_tag_locked(struct nf* nfs_clear_request - Free up all resources allocated to the request * @req: * -* Release page resources associated with a write request after it -* has completed. +* Release page and open context resources associated with a read/write +* request after it has completed. */ void nfs_clear_request (struct nfs_page *req) {struct page *page = req->wb_page; +struct nfs_open_context *ctx = req->wb_context; +if (page !=NULL ) {page_cache_release (page); req->wb_page =NULL ; } +if (ctx !=NULL ) { +put_nfs_open_context (ctx); + req->wb_context =NULL ; + } }
@@ -165,9 +169,8 @@ static void nfs_free_request(struct kref { struct nfs_page *req = container_of(kref, struct nfs_page, wb_kref); -/* Release struct file or cached credential */ +/* Release struct file and open context */ nfs_clear_request (req); -put_nfs_open_context (req->wb_context);nfs_page_free (req); }
PATCH 60/116 NFS: Prevent another deadlock in nfs_release_page()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit d812e575822a2b7ab1a7cadae2571505ec6ec2bd upstream.
We should not attempt to free the page if __GFP_FS is not set. Otherwise we can deadlock as per
http://bugzilla.kernel.org/show_bug.cgi?id=15578
--- fs/nfs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/file.c +2 -1
@@ -486,7 +486,8 @@ static int nfs_release_page(struct page {dfprintk (PAGECACHE ,"NFS: release_page(%p)\n" , page); -if (gfp & __GFP_WAIT) +/* Only do I/O if gfp is a superset of GFP_KERNEL */ +if ((gfp &GFP_KERNEL ) ==GFP_KERNEL )nfs_wb_page (page->mapping->host, page);/* If PagePrivate() is set, then the page is not freeable */ if (PagePrivate (page))
PATCH 61/116 tty: Keep the default buffering to sub-page units
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Cox <[email protected]>
commit d9661adfb8e53a7647360140af3b92284cbe52d4 upstream.
We allocate during interrupts so while our buffering is normally diced up small anyway on some hardware at speed we can pressure the VM excessively for page pairs. We don't really need big buffers to be linear so don't try so hard.
In order to make this work well we will tidy up excess callers to request_room, which cannot itself enforce this break up.
--- drivers/char/tty_buffer.c | 6 ++++-- include/linux/tty.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/char/tty_buffer.c +4 -2
@@ -247,7 +247,8 @@ int tty_insert_flip_string(struct tty_st {int copied =0 ; do { - int space = tty_buffer_request_room(tty, size - copied); + int goal = min(size - copied, TTY_BUFFER_PAGE); + int space = tty_buffer_request_room(tty, goal); struct tty_buffer *tb = tty->buf.tail; /* If there is no space then tb may be NULL */ if (unlikely(space == 0))
@@ -283,7 +284,8 @@ int tty_insert_flip_string_flags(struct {int copied =0 ; do { - int space = tty_buffer_request_room(tty, size - copied); + int goal = min(size - copied, TTY_BUFFER_PAGE); + int space = tty_buffer_request_room(tty, goal); struct tty_buffer *tb = tty->buf.tail; /* If there is no space then tb may be NULL */ if (unlikely(space == 0))
include/linux/tty.h +10 -0
@@ -68,6 +68,16 @@ struct tty_buffer {unsigned long data[0 ]; }; +/* +* We default to dicing tty buffer allocations to this many characters +* in order to avoid multiple page allocations. We assume tty_buffer itself +* is under 256 bytes. See tty_buffer_find for the allocation logic this +* must match +*/ + +#define TTY_BUFFER_PAGE ((PAGE_SIZE - 256) / 2) + +struct tty_bufhead {struct delayed_work work;spinlock_t lock;
PATCH 62/116 tty: Take a 256 byte padding into account when buffering below sub-page units
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit 352fa6ad16b89f8ffd1a93b4419b1a8f2259feab upstream.
The TTY layer takes some care to ensure that only sub-page allocations are made with interrupts disabled. It does this by setting a goal of "TTY_BUFFER_PAGE" to allocate. Unfortunately, while TTY_BUFFER_PAGE takes the size of tty_buffer into account, it fails to account that tty_buffer_find() rounds the buffer size out to the next 256 byte boundary before adding on the size of the tty_buffer.
This patch adjusts the TTY_BUFFER_PAGE calculation to take into account the size of the tty_buffer and the padding. Once applied, tty_buffer_alloc() should not require high-order allocations.
--- include/linux/tty.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
include/linux/tty.h +5 -4
@@ -70,12 +70,13 @@ struct tty_buffer {/* * We default to dicing tty buffer allocations to this many characters -* in order to avoid multiple page allocations. We assume tty_buffer itself -* is under 256 bytes. See tty_buffer_find for the allocation logic this -* must match +* in order to avoid multiple page allocations. We know the size of +* tty_buffer itself but it must also be taken into account that the +* the buffer is 256 byte aligned. See tty_buffer_find for the allocation +* logic this must match */ -#define TTY_BUFFER_PAGE ((PAGE_SIZE - 256) / 2) +#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)struct tty_bufhead {
PATCH 63/116 USB: fix usbfs regression
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 7152b592593b9d48b33f8997b1dfd6df9143f7ec upstream.
This patch (as1352) fixes a bug in the way isochronous input data is returned to userspace for usbfs transfers. The entire buffer must be copied, not just the first actual_length bytes, because the individual packets will be discontiguous if any of them are short.
--- drivers/usb/core/devio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/usb/core/devio.c +14 -3
@@ -1176,6 +1176,13 @@ static int proc_do_submiturb(struct dev_free_async (as);return -ENOMEM ; } +/* Isochronous input data may end up being discontiguous +* if some of the packets are short. Clear the buffer so +* that the gaps don't leak kernel data to userspace. +*/ +if (is_in && uurb->type ==USBDEVFS_URB_TYPE_ISO ) +memset (as->urb->transfer_buffer,0 , + uurb->buffer_length); } as->urb->dev = ps->dev; as->urb->pipe = (uurb->type << 30) |
@@ -1312,10 +1319,14 @@ static int processcompl(struct async *asvoid __user *addr = as->userurb;unsigned int i; -if (as->userbuffer && urb->actual_length) -if (copy_to_user (as->userbuffer, urb->transfer_buffer, - urb->actual_length)) +if (as->userbuffer && urb->actual_length) { +if (urb->number_of_packets >0 )/* Isochronous */ + i = urb->transfer_buffer_length; +else /* Non-Isoc */ + i = urb->actual_length; +if (copy_to_user (as->userbuffer, urb->transfer_buffer, i)) goto err_out; + }if (put_user (as->status, &userurb->status)) goto err_out;if (put_user (urb->actual_length, &userurb->actual_length))
PATCH 64/116 USB: EHCI: fix ITD list order
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit 92bc3648e6027384479852b770a542722fadee7c upstream.
When isochronous URBs are shorter than one frame and when more than one ITD in a frame has been completed before the interrupt can be handled, scan_periodic() completes the URBs in the order in which they are found in the descriptor list. Therefore, the descriptor list must contain the ITDs in the correct order, i.e., a new ITD must be linked in after any previous ITDs of the same endpoint.
This should fix garbled capture data in the USB audio drivers.
--- drivers/usb/host/ehci-sched.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
drivers/usb/host/ehci-sched.c +19 -5
@@ -1553,13 +1553,27 @@ itd_patch(static inline void itd_link (struct ehci_hcd *ehci,unsigned frame,struct ehci_itd *itd) { -/* always prepend ITD/SITD ... only QH tree is order-sensitive */ - itd->itd_next = ehci->pshadow [frame]; - itd->hw_next = ehci->periodic [frame]; - ehci->pshadow [frame].itd = itd; +union ehci_shadow *prev = &ehci->pshadow[frame]; +__hc32 *hw_p = &ehci->periodic[frame]; +union ehci_shadow here = *prev; +__hc32 type =0 ; + +/* skip any iso nodes which might belong to previous microframes */ +while (here.ptr) { + type =Q_NEXT_TYPE (ehci, *hw_p); +if (type ==cpu_to_hc32 (ehci,Q_TYPE_QH )) +break ; + prev =periodic_next_shadow (ehci, prev, type); + hw_p =shadow_next_periodic (ehci, &here, type); + here = *prev; + } + + itd->itd_next = here; + itd->hw_next = *hw_p; + prev->itd = itd; itd->frame = frame;wmb (); - ehci->periodic[frame] =cpu_to_hc32 (ehci, itd->itd_dma |Q_TYPE_ITD ); + *hw_p =cpu_to_hc32 (ehci, itd->itd_dma |Q_TYPE_ITD ); }/* fit urb's itds into the selected schedule slot; activate as needed */
PATCH 65/116 USB: EHCI: adjust ehci_iso_stream for changes in ehci_qh
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit 1082f57abfa26590b60c43f503afb24102a37016 upstream.
The EHCI driver stores in usb_host_endpoint.hcpriv a pointer to either an ehci_qh or an ehci_iso_stream structure, and uses the contents of the hw_info1 field to distinguish the two cases.
After ehci_qh was split into hw and sw parts, ehci_iso_stream must also be adjusted so that it again looks like an ehci_qh structure.
This fixes a NULL pointer access in ehci_endpoint_disable() when it tries to access qh->hw->hw_info1.
--- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ehci-sched.c | 4 ++-- drivers/usb/host/ehci.h | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/usb/host/ehci-hcd.c +1 -1
@@ -993,7 +993,7 @@ rescan:/* endpoints can be iso streams. for now, we don't * accelerate iso completions ... so spin a while. */ -if (qh->hw->hw_info1 ==0 ) { +if (qh->hw ==NULL ) {ehci_vdbg (ehci,"iso delay\n" ); goto idle_timeout; }
drivers/usb/host/ehci-sched.c +2 -2
@@ -1121,8 +1121,8 @@ iso_stream_find (struct ehci_hcd *ehci, urb->interval); } -/* if dev->ep [epnum] is a QH, info1.maxpacket is nonzero */ - }else if (unlikely (stream->hw_info1 !=0 )) { +/* if dev->ep [epnum] is a QH, hw is set */ + }else if (unlikely (stream->hw !=NULL )) {ehci_dbg (ehci,"dev %s ep%d%s, not iso??\n" , urb->dev->devpath, epnum,usb_pipein (urb->pipe) ?"in" :"out" );
drivers/usb/host/ehci.h +2 -3
@@ -394,9 +394,8 @@ struct ehci_iso_sched {* acts like a qh would, if EHCI had them for ISO. */ struct ehci_iso_stream { -/* first two fields match QH, but info1 == 0 */ -__hc32 hw_next; -__hc32 hw_info1; +/* first field matches ehci_hq, but is NULL */ +struct ehci_qh_hw *hw;u32 refcount;u8 bEndpointAddress;
PATCH 66/116 USB: qcserial: add new device ids
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bernhard Rosenkraenzer <[email protected]>
commit 0725e95ea56698774e893edb7e7276b1d6890954 upstream.
This patch adds various USB device IDs for Gobi 2000 devices, as found in the drivers available at https://www.codeaurora.org/wiki/GOBI_Releases
--- drivers/usb/serial/qcserial.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/usb/serial/qcserial.c +29 -0
@@ -47,6 +47,35 @@ static struct usb_device_id id_table[] = {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ + {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ + {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ + {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ + {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ + {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ + {USB_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ + {USB_DEVICE(0x03f0, 0x241d)}, /* HP Gobi 2000 QDL device (VP412) */ + {USB_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ + {USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) */ + {USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ + {USB_DEVICE(0x05c6, 0x9264)}, /* Asus Gobi 2000 QDL device (VR305) */ + {USB_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ + {USB_DEVICE(0x05c6, 0x9234)}, /* Top Global Gobi 2000 QDL device (VR306) */ + {USB_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ + {USB_DEVICE(0x05c6, 0x9274)}, /* iRex Technologies Gobi 2000 QDL device (VR307) */ + {USB_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ + {USB_DEVICE(0x1199, 0x9000)}, /* Sierra Wireless Gobi 2000 QDL device (VT773) */ + {USB_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x16d8, 0x8001)}, /* CMDTech Gobi 2000 QDL device (VU922) */ + {USB_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, id_table);
PATCH 67/116 USB: xHCI: re-initialize cmd_completion
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andiry Xu <[email protected]>
commit 1d68064a7d80da4a7334cab0356162e36229c1a1 upstream.
When a signal interrupts a Configure Endpoint command, the cmd_completion used in xhci_configure_endpoint() is not re-initialized and the wait_for_completion_interruptible_timeout() will return failure. Initialize cmd_completion in xhci_configure_endpoint().
--- drivers/usb/host/xhci-hcd.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-hcd.c +1 -0
@@ -1157,6 +1157,7 @@ static int xhci_configure_endpoint(struc cmd_completion = &virt_dev->cmd_completion; cmd_status = &virt_dev->cmd_status; } +init_completion (cmd_completion);if (!ctx_change) ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma,
PATCH 68/116 USB: serial: ftdi: add CONTEC vendor and product id
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Sangorrin <[email protected]>
commit dee5658b482e9e2ac7d6205dc876fc11d4008138 upstream.
This is a patch to ftdi_sio_ids.h and ftdi_sio.c that adds identifiers for CONTEC USB serial converter. I tested it with the device COM-1(USB)H
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -658,6 +658,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, + { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) },
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -501,6 +501,13 @@#define CONTEC_COM1USBH_PID 0x8311/* COM-1(USB)H */ /* +* Contec products (http://www.contec.com) +* Submitted by Daniel Sangorrin +*/ +#define CONTEC_VID 0x06CE/* Vendor ID */ +#define CONTEC_COM1USBH_PID 0x8311/* COM-1(USB)H */ + +/* * Definitions for B&B Electronics products. */ #define BANDB_VID 0x0856/* B&B Electronics Vendor ID */
PATCH 69/116 USB: option: fix incorrect manufacturer name in usb/serial/option: MAXON->CMOTECH
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nathaniel McCallum <[email protected]>
commit eaff4cdc978f414cf7b5441a333de3070d80e9c7 upstream.
--- drivers/usb/serial/option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +2 -2
@@ -288,7 +288,7 @@ static int option_resume(struct usb_ser#define QUALCOMM_VENDOR_ID 0x05C6 -#define MAXON_VENDOR_ID 0x16d8 +#define CMOTECH_VENDOR_ID 0x16d8#define TELIT_VENDOR_ID 0x1bc7#define TELIT_PRODUCT_UC864E 0x1003
@@ -520,7 +520,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ - { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ + { USB_DEVICE(CMOTECH_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
PATCH 70/116 USB: option: move hardcoded PID to a macro in usb/serial/option
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nathaniel McCallum <[email protected]>
commit bb73ed2a268a29ab1b7d8cc50b5f248578e7e188 upstream.
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -289,6 +289,7 @@ static int option_resume(struct usb_ser#define QUALCOMM_VENDOR_ID 0x05C6#define CMOTECH_VENDOR_ID 0x16d8 +#define CMOTECH_PRODUCT_6280 0x6280#define TELIT_VENDOR_ID 0x1bc7#define TELIT_PRODUCT_UC864E 0x1003
@@ -520,7 +521,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ - { USB_DEVICE(CMOTECH_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
PATCH 71/116 USB: option: add support for a new CMOTECH device to usb/serial/option
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nathaniel McCallum <[email protected]>
commit 3b04872aa75006e2a4adaaec21e9c9ede8b8ad9d upstream.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -289,6 +289,7 @@ static int option_resume(struct usb_ser#define QUALCOMM_VENDOR_ID 0x05C6#define CMOTECH_VENDOR_ID 0x16d8 +#define CMOTECH_PRODUCT_6008 0x6008#define CMOTECH_PRODUCT_6280 0x6280#define TELIT_VENDOR_ID 0x1bc7
@@ -522,6 +523,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
PATCH 72/116 usb: r8a66597-hcd: fix removed from an attached hub
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yoshihiro Shimoda <[email protected]>
commit d835933436ac0d1e8f5b35fe809fd4e767e55d6e upstream.
fix the problem that when a USB hub is attached to the r8a66597-hcd and a device is removed from that hub, it's likely that a kernel panic follows.
--- drivers/usb/host/r8a66597-hcd.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/usb/host/r8a66597-hcd.c +11 -5
@@ -418,7 +418,7 @@ static u8 alloc_usb_address(struct r8a66/* this function must be called with interrupt disabled */ static void free_usb_address (struct r8a66597 *r8a66597, -struct r8a66597_device *dev) +struct r8a66597_device *dev,int reset) {int port;
@@ -430,7 +430,13 @@ static void free_usb_address(struct r8a6 dev->state =USB_STATE_DEFAULT ; r8a66597->address_map &= ~(1 << dev->address); dev->address =0 ; -dev_set_drvdata (&dev->udev->dev,NULL ); +/* +* Only when resetting USB, it is necessary to erase drvdata. When +* a usb device with usb hub is disconnect, "dev->udev" is already +* freed on usb_desconnect(). So we cannot access the data. +*/ +if (reset) +dev_set_drvdata (&dev->udev->dev,NULL );list_del (&dev->device_list);kfree (dev);
@@ -1067,7 +1073,7 @@ static void r8a66597_usb_disconnect(strustruct r8a66597_device *dev = r8a66597->root_hub[port].dev;disable_r8a66597_pipe_all (r8a66597, dev); -free_usb_address (r8a66597, dev); +free_usb_address (r8a66597, dev,0 );start_root_hub_sampling (r8a66597, port,0 ); }
@@ -2085,7 +2091,7 @@ static void update_usb_address_map(strucspin_lock_irqsave (&r8a66597->lock, flags); dev =get_r8a66597_device (r8a66597, addr);disable_r8a66597_pipe_all (r8a66597, dev); -free_usb_address (r8a66597, dev); +free_usb_address (r8a66597, dev,0 );put_child_connect_map (r8a66597, addr);spin_unlock_irqrestore (&r8a66597->lock, flags); }
@@ -2228,7 +2234,7 @@ static int r8a66597_hub_control(struct u rh->port |= (1 <<USB_PORT_FEAT_RESET );disable_r8a66597_pipe_all (r8a66597, dev); -free_usb_address (r8a66597, dev); +free_usb_address (r8a66597, dev,1 );r8a66597_mdfy (r8a66597,USBRST ,USBRST |UACT ,get_dvstctr_reg (port));
PATCH 73/116 wl1251: fix potential crash
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Grazvydas Ignotas <[email protected]>
commit 3f60ebc9d6291863652d564bacc430629271e6a9 upstream.
In case debugfs does not init for some reason (or is disabled on older kernels) driver does not allocate stats.fw_stats structure, but tries to clear it later and trips on a NULL pointer:
Unable to handle kernel NULL pointer dereference at virtual address 00000000 PC is at __memzero+0x24/0x80 Backtrace: [<bf0ddb88>] (wl1251_debugfs_reset+0x0/0x30 [wl1251]) [<bf0d6a2c>] (wl1251_op_stop+0x0/0x12c [wl1251]) [<bf0bc228>] (ieee80211_stop_device+0x0/0x74 [mac80211]) [<bf0b0d10>] (ieee80211_stop+0x0/0x4ac [mac80211]) [<c02deeac>] (dev_close+0x0/0xb4) [<c02deac0>] (dev_change_flags+0x0/0x184) [<c031f478>] (devinet_ioctl+0x0/0x704) [<c0320720>] (inet_ioctl+0x0/0x100)
Add a NULL pointer check to fix this.
--- drivers/net/wireless/wl12xx/wl1251_debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/wl12xx/wl1251_debugfs.c +2 -1
@@ -443,7 +443,8 @@ out:void wl1251_debugfs_reset (struct wl1251 *wl) { -memset (wl->stats.fw_stats,0 ,sizeof (*wl->stats.fw_stats)); +if (wl->stats.fw_stats !=NULL ) +memset (wl->stats.fw_stats,0 ,sizeof (*wl->stats.fw_stats)); wl->stats.retry_count =0 ; wl->stats.excessive_retries =0 ; }
PATCH 74/116 jme: Fix VLAN memory leak
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guo-Fu Tseng <[email protected]>
commit 17da69b8bfbe441a33a873ad5dd7d3d85800bf2b upstream.
Fix memory leak while receiving 8021q tagged packet which is not registered by user.
--- drivers/net/jme.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/jme.c +2 -0
@@ -946,6 +946,8 @@ jme_alloc_and_feed_skb(struct jme_adapte jme->jme_vlan_rx (skb, jme->vlgrp,le16_to_cpu (rxdesc->descwb.vlan));NET_STAT (jme).rx_bytes +=4 ; + }else { +dev_kfree_skb (skb); } }else { jme->jme_rx (skb);
PATCH 75/116 jme: Protect vlgrp structure by pause RX actions.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guo-Fu Tseng <[email protected]>
commit bf5e5360fd1df1ae429ebbd81838d7d0879797d1 upstream.
Temporary stop the RX IRQ, and disable (sync) tasklet or napi. And restore it after finished the vlgrp pointer assignment.
--- drivers/net/jme.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/net/jme.c +33 -0
@@ -2087,12 +2087,45 @@ jme_tx_timeout(struct net_device *netdevjme_reset_link (jme); } +static inline void jme_pause_rx (struct jme_adapter *jme) +{ +atomic_dec (&jme->link_changing); + +jme_set_rx_pcc (jme,PCC_OFF ); +if (test_bit (JME_FLAG_POLL , &jme->flags)) { +JME_NAPI_DISABLE (jme); + }else { +tasklet_disable (&jme->rxclean_task); +tasklet_disable (&jme->rxempty_task); + } +} + +static inline void jme_resume_rx (struct jme_adapter *jme) +{ +struct dynpcc_info *dpi = &(jme->dpi); + +if (test_bit (JME_FLAG_POLL , &jme->flags)) { +JME_NAPI_ENABLE (jme); + }else { +tasklet_hi_enable (&jme->rxclean_task); +tasklet_hi_enable (&jme->rxempty_task); + } + dpi->cur =PCC_P1 ; + dpi->attempt =PCC_P1 ; + dpi->cnt =0 ; +jme_set_rx_pcc (jme,PCC_P1 ); + +atomic_inc (&jme->link_changing); +} +static void jme_vlan_rx_register (struct net_device *netdev,struct vlan_group *grp) {struct jme_adapter *jme =netdev_priv (netdev); +jme_pause_rx (jme); jme->vlgrp = grp; +jme_resume_rx (jme); } static void
PATCH 76/116 edac, mce: Filter out invalid values
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 5b89d2f9ace1970324facc68ca9b8fae19ce8096 upstream.
Print the CPU associated with the error only when the field is valid.
--- drivers/edac/edac_mce_amd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/edac/edac_mce_amd.c +6 -2
@@ -311,9 +311,13 @@ void amd_decode_nb_mce(int node_id, struif (regs->nbsh &K8_NBSH_ERR_CPU_VAL )pr_cont (", core: %u\n" , (u8)(regs->nbsh &0xf )); }else { -pr_cont (", core: %d\n" ,ilog2 ((regs->nbsh &0xf ))); - } +u8 assoc_cpus = regs->nbsh &0xf ; + +if (assoc_cpus >0 ) +pr_cont (", core: %d" ,fls (assoc_cpus) -1 ); +pr_cont ("\n" ); + }pr_emerg ("%s.\n" ,EXT_ERR_MSG (xec));
PATCH 77/116 iwlwifi: use dma_alloc_coherent
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stanislaw Gruszka <[email protected]>
commit f36d04abe684f9e2b07c6ebe9f77ae20eb5c1e84 upstream.
Change pci_alloc_consistent() to dma_alloc_coherent() so we can use GFP_KERNEL flag.
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 8 +++----- drivers/net/wireless/iwlwifi/iwl-core.c | 12 ++++++------ drivers/net/wireless/iwlwifi/iwl-helpers.h | 7 ++++--- drivers/net/wireless/iwlwifi/iwl-rx.c | 21 +++++++++++---------- drivers/net/wireless/iwlwifi/iwl-tx.c | 23 ++++++++++++----------- drivers/net/wireless/iwlwifi/iwl3945-base.c | 16 ++++++++-------- 6 files changed, 44 insertions(+), 43 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +3 -5
@@ -2545,11 +2545,9 @@ int iwl3945_hw_set_hw_params(struct iwl_memset ((void *)&priv->hw_params,0 ,sizeof (struct iwl_hw_params )); - priv->shared_virt = -pci_alloc_consistent (priv->pci_dev, -sizeof (struct iwl3945_shared ), - &priv->shared_phys); - + priv->shared_virt =dma_alloc_coherent (&priv->pci_dev->dev, +sizeof (struct iwl3945_shared ), + &priv->shared_phys,GFP_KERNEL );if (!priv->shared_virt) {IWL_ERR (priv,"failed to allocate pci memory\n" );mutex_unlock (&priv->mutex);
drivers/net/wireless/iwlwifi/iwl-core.c +6 -6
@@ -1598,9 +1598,9 @@ EXPORT_SYMBOL(iwl_uninit_drv);void iwl_free_isr_ict (struct iwl_priv *priv) {if (priv->ict_tbl_vir) { -pci_free_consistent (priv->pci_dev, (sizeof (u32) *ICT_COUNT ) + -PAGE_SIZE , priv->ict_tbl_vir, - priv->ict_tbl_dma); +dma_free_coherent (&priv->pci_dev->dev, + (sizeof (u32) *ICT_COUNT ) +PAGE_SIZE , + priv->ict_tbl_vir, priv->ict_tbl_dma); priv->ict_tbl_vir =NULL ; } }
@@ -1616,9 +1616,9 @@ int iwl_alloc_isr_ict(struct iwl_priv *pif (priv->cfg->use_isr_legacy)return 0 ;/* allocate shrared data table */ - priv->ict_tbl_vir =pci_alloc_consistent (priv->pci_dev, (sizeof (u32) * -ICT_COUNT ) +PAGE_SIZE , - &priv->ict_tbl_dma); + priv->ict_tbl_vir =dma_alloc_coherent (&priv->pci_dev->dev, + (sizeof (u32) *ICT_COUNT ) +PAGE_SIZE , + &priv->ict_tbl_dma,GFP_KERNEL );if (!priv->ict_tbl_vir)return -ENOMEM ;
drivers/net/wireless/iwlwifi/iwl-helpers.h +4 -3
@@ -80,8 +80,8 @@ static inline void iwl_free_fw_desc(stru struct fw_desc *desc) {if (desc->v_addr) -pci_free_consistent (pci_dev, desc->len, - desc->v_addr, desc->p_addr); +dma_free_coherent (&pci_dev->dev, desc->len, + desc->v_addr, desc->p_addr); desc->v_addr =NULL ; desc->len =0 ; }
@@ -89,7 +89,8 @@ static inline void iwl_free_fw_desc(strustatic inline int iwl_alloc_fw_desc (struct pci_dev *pci_dev,struct fw_desc *desc) { - desc->v_addr =pci_alloc_consistent (pci_dev, desc->len, &desc->p_addr); + desc->v_addr =dma_alloc_coherent (&pci_dev->dev, desc->len, + &desc->p_addr,GFP_KERNEL );return (desc->v_addr !=NULL ) ?0 : -ENOMEM ; }
drivers/net/wireless/iwlwifi/iwl-rx.c +11 -10
@@ -345,10 +345,10 @@ void iwl_rx_queue_free(struct iwl_priv * } } -pci_free_consistent (priv->pci_dev,4 *RX_QUEUE_SIZE , rxq->bd, - rxq->dma_addr); -pci_free_consistent (priv->pci_dev,sizeof (struct iwl_rb_status ), - rxq->rb_stts, rxq->rb_stts_dma); +dma_free_coherent (&priv->pci_dev->dev,4 *RX_QUEUE_SIZE , rxq->bd, + rxq->dma_addr); +dma_free_coherent (&priv->pci_dev->dev,sizeof (struct iwl_rb_status ), + rxq->rb_stts, rxq->rb_stts_dma); rxq->bd =NULL ; rxq->rb_stts =NULL ; }
@@ -357,7 +357,7 @@ EXPORT_SYMBOL(iwl_rx_queue_free);int iwl_rx_queue_alloc (struct iwl_priv *priv) {struct iwl_rx_queue *rxq = &priv->rxq; -struct pci_dev *dev = priv->pci_dev; +struct device *dev = &priv->pci_dev->dev;int i;spin_lock_init (&rxq->lock);
@@ -365,12 +365,13 @@ int iwl_rx_queue_alloc(struct iwl_priv *INIT_LIST_HEAD (&rxq->rx_used);/* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */ - rxq->bd =pci_alloc_consistent (dev,4 *RX_QUEUE_SIZE , &rxq->dma_addr); + rxq->bd =dma_alloc_coherent (dev,4 *RX_QUEUE_SIZE , &rxq->dma_addr, +GFP_KERNEL );if (!rxq->bd) goto err_bd; - rxq->rb_stts =pci_alloc_consistent (dev,sizeof (struct iwl_rb_status ), - &rxq->rb_stts_dma); + rxq->rb_stts =dma_alloc_coherent (dev,sizeof (struct iwl_rb_status ), + &rxq->rb_stts_dma,GFP_KERNEL );if (!rxq->rb_stts) goto err_rb;
@@ -387,8 +388,8 @@ int iwl_rx_queue_alloc(struct iwl_priv *return 0 ; err_rb: -pci_free_consistent (priv->pci_dev,4 *RX_QUEUE_SIZE , rxq->bd, - rxq->dma_addr); +dma_free_coherent (&priv->pci_dev->dev,4 *RX_QUEUE_SIZE , rxq->bd, + rxq->dma_addr); err_bd:return -ENOMEM ; }
drivers/net/wireless/iwlwifi/iwl-tx.c +12 -11
@@ -60,7 +60,8 @@ static const u16 default_tid_to_tx_fifo[static inline int iwl_alloc_dma_ptr (struct iwl_priv *priv,struct iwl_dma_ptr *ptr,size_t size) { - ptr->addr =pci_alloc_consistent (priv->pci_dev, size, &ptr->dma); + ptr->addr =dma_alloc_coherent (&priv->pci_dev->dev, size, &ptr->dma, +GFP_KERNEL );if (!ptr->addr)return -ENOMEM ; ptr->size = size;
@@ -73,7 +74,7 @@ static inline void iwl_free_dma_ptr(struif (unlikely (!ptr->addr))return ; -pci_free_consistent (priv->pci_dev, ptr->size, ptr->addr, ptr->dma); +dma_free_coherent (&priv->pci_dev->dev, ptr->size, ptr->addr, ptr->dma);memset (ptr,0 ,sizeof (*ptr)); }
@@ -145,7 +146,7 @@ void iwl_tx_queue_free(struct iwl_priv * {struct iwl_tx_queue *txq = &priv->txq[txq_id];struct iwl_queue *q = &txq->q; -struct pci_dev *dev = priv->pci_dev; +struct device *dev = &priv->pci_dev->dev;int i, len;if (q->n_bd ==0 )
@@ -164,8 +165,8 @@ void iwl_tx_queue_free(struct iwl_priv */* De-alloc circular buffer of TFDs */ if (txq->q.n_bd) -pci_free_consistent (dev, priv->hw_params.tfd_size * - txq->q.n_bd, txq->tfds, txq->q.dma_addr); +dma_free_coherent (dev, priv->hw_params.tfd_size * + txq->q.n_bd, txq->tfds, txq->q.dma_addr);/* De-alloc array of per-TFD driver data */ kfree (txq->txb);
@@ -194,7 +195,7 @@ void iwl_cmd_queue_free(struct iwl_priv {struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM ];struct iwl_queue *q = &txq->q; -struct pci_dev *dev = priv->pci_dev; +struct device *dev = &priv->pci_dev->dev;int i, len;if (q->n_bd ==0 )
@@ -209,8 +210,8 @@ void iwl_cmd_queue_free(struct iwl_priv/* De-alloc circular buffer of TFDs */ if (txq->q.n_bd) -pci_free_consistent (dev, priv->hw_params.tfd_size * - txq->q.n_bd, txq->tfds, txq->q.dma_addr); +dma_free_coherent (dev, priv->hw_params.tfd_size * txq->q.n_bd, + txq->tfds, txq->q.dma_addr);/* deallocate arrays */ kfree (txq->cmd);
@@ -301,7 +302,7 @@ static int iwl_queue_init(struct iwl_pristatic int iwl_tx_queue_alloc (struct iwl_priv *priv,struct iwl_tx_queue *txq,u32 id) { -struct pci_dev *dev = priv->pci_dev; +struct device *dev = &priv->pci_dev->dev;size_t tfd_sz = priv->hw_params.tfd_size *TFD_QUEUE_SIZE_MAX ;/* Driver private data, only for Tx (not command) queues,
@@ -320,8 +321,8 @@ static int iwl_tx_queue_alloc(struct iwl/* Circular buffer of transmit frame descriptors (TFDs), * shared with device */ - txq->tfds =pci_alloc_consistent (dev, tfd_sz, &txq->q.dma_addr); - + txq->tfds =dma_alloc_coherent (dev, tfd_sz, &txq->q.dma_addr, +GFP_KERNEL );if (!txq->tfds) {IWL_ERR (priv,"pci_alloc_consistent(%zd) failed\n" , tfd_sz); goto error;
drivers/net/wireless/iwlwifi/iwl3945-base.c +8 -8
@@ -356,10 +356,10 @@ static int iwl3945_send_beacon_cmd(strucstatic void iwl3945_unset_hw_params (struct iwl_priv *priv) {if (priv->shared_virt) -pci_free_consistent (priv->pci_dev, -sizeof (struct iwl3945_shared ), - priv->shared_virt, - priv->shared_phys); +dma_free_coherent (&priv->pci_dev->dev, +sizeof (struct iwl3945_shared ), + priv->shared_virt, + priv->shared_phys); } static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
@@ -1272,10 +1272,10 @@ static void iwl3945_rx_queue_free(struct } } -pci_free_consistent (priv->pci_dev,4 *RX_QUEUE_SIZE , rxq->bd, - rxq->dma_addr); -pci_free_consistent (priv->pci_dev,sizeof (struct iwl_rb_status ), - rxq->rb_stts, rxq->rb_stts_dma); +dma_free_coherent (&priv->pci_dev->dev,4 *RX_QUEUE_SIZE , rxq->bd, + rxq->dma_addr); +dma_free_coherent (&priv->pci_dev->dev,sizeof (struct iwl_rb_status ), + rxq->rb_stts, rxq->rb_stts_dma); rxq->bd =NULL ; rxq->rb_stts =NULL ; }
PATCH 78/116 iwlwifi: Silence tfds_in_queue message
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Adel Gadllah <[email protected]>
commit c8406ea8fa1adde8dc5400127281d497bbcdb84a upstream.
Commit a239a8b47cc0e5e6d7416a89f340beac06d5edaa introduced a noisy message, that fills up the log very fast.
The error seems not to be fatal (the connection is stable and performance is ok), so make it IWL_DEBUG_TX rather than IWL_ERR.
--- drivers/net/wireless/iwlwifi/iwl-tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-tx.c +1 -1
@@ -126,7 +126,7 @@ void iwl_free_tfds_in_queue(struct iwl_pif (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;else { -IWL_ERR (priv,"free more than tfds_in_queue (%u:%d)\n" , +IWL_DEBUG_TX (priv,"free more than tfds_in_queue (%u:%d)\n" , priv->stations[sta_id].tid[tid].tfds_in_queue, freed); priv->stations[sta_id].tid[tid].tfds_in_queue =0 ;
PATCH 79/116 SUNRPC: Fix a potential memory leak in auth_gss
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit cdead7cf12896c0e50a8be2e52de52c364603095 upstream.
The function alloc_enc_pages() currently fails to release the pointer rqstp->rq_enc_pages in the error path.
--- net/sunrpc/auth_gss/auth_gss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
net/sunrpc/auth_gss/auth_gss.c +2 -3
@@ -1273,9 +1273,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) rqstp->rq_release_snd_buf = priv_release_snd_buf;return 0 ; out_free: -for (i--; i >=0 ; i--) { -__free_page (rqstp->rq_enc_pages[i]); - } + rqstp->rq_enc_pages_num = i; +priv_release_snd_buf (rqstp); out:return -EAGAIN ; }
PATCH 80/116 sunrpc: handle allocation errors from __rpc_lookup_create()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit f1f0abe192a72e75d7c59972e30784d043fd8d73 upstream.
__rpc_lookup_create() can return ERR_PTR(-ENOMEM).
--- net/sunrpc/rpc_pipe.c | 2 ++ 1 file changed, 2 insertions(+)
net/sunrpc/rpc_pipe.c +2 -0
@@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_creatstruct dentry *dentry; dentry =__rpc_lookup_create (parent, name); +if (IS_ERR (dentry)) +return dentry;if (dentry->d_inode ==NULL )return dentry;dput (dentry);
PATCH 81/116 if_tunnel.h: add missing ams/byteorder.h include
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Paulius Zaleckas <[email protected]>
commit 9bf35c8dddd56f7f247a27346f74f5adc18071f4 upstream.
When compiling userspace application which includes if_tunnel.h and uses GRE_* defines you will get undefined reference to __cpu_to_be16.
Fix this by adding missing #include <asm/byteorder.h>
--- include/linux/if_tunnel.h | 1 + 1 file changed, 1 insertion(+)
include/linux/if_tunnel.h +1 -0
@@ -2,6 +2,7 @@#define _IF_TUNNEL_H_#include <linux/types.h> +#include <asm/byteorder.h> #ifdef __KERNEL__#include <linux/ip.h>
PATCH 82/116 fs/partitions/msdos: add support for large disks
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Taylor <[email protected]>
commit 3fbf586cf7f245392142e5407c2a56f1cff979b6 upstream.
In order to use disks larger than 2TiB on Windows XP, it is necessary to use 4096-byte logical sectors in an MBR.
Although the kernel storage and functions called from msdos.c used "sector_t" internally, msdos.c still used u32 variables, which results in the ability to handle XP-compatible large disks.
This patch changes the internal variables to "sector_t".
Daniel said: "In the near future, WD will be releasing products that need this patch".
--- fs/partitions/msdos.c | 74 ++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 35 deletions(-)
fs/partitions/msdos.c +39 -35
@@ -31,14 +31,17 @@*/ #include <asm/unaligned.h> -#define SYS_IND (p) (get_unaligned(&p->sys_ind)) -#define NR_SECTS (p) ({ __le32 __a = get_unaligned(&p->nr_sects); \ - le32_to_cpu(__a); \ - }) - -#define START_SECT (p) ({ __le32 __a = get_unaligned(&p->start_sect); \ - le32_to_cpu(__a); \ - }) +#define SYS_IND (p) get_unaligned(&p->sys_ind) + +static inline sector_t nr_sects (struct partition *p) +{ +return (sector_t )get_unaligned_le32 (&p->nr_sects); +} + +static inline sector_t start_sect (struct partition *p) +{ +return (sector_t )get_unaligned_le32 (&p->start_sect); +}static inline int is_extended_partition (struct partition *p) {
@@ -104,13 +107,13 @@ static int aix_magic_present(unsigned chstatic void parse_extended (struct parsed_partitions *state,struct block_device *bdev, -u32 first_sector,u32 first_size) +sector_t first_sector,sector_t first_size) {struct partition *p;Sector sect;unsigned char *data; -u32 this_sector, this_size; -int sector_size =bdev_logical_block_size (bdev) /512 ; +sector_t this_sector, this_size; +sector_t sector_size =bdev_logical_block_size (bdev) /512 ;int loopct =0 ;/* number of links followed without finding a data partition */ int i;
@@ -145,14 +148,14 @@ parse_extended(struct parsed_partitions* First process the data partition(s) */ for (i=0 ; i<4 ; i++, p++) { -u32 offs, size, next; -if (!NR_SECTS (p) ||is_extended_partition (p)) +sector_t offs, size, next; +if (!nr_sects (p) ||is_extended_partition (p))continue ;/* Check the 3rd and 4th entries - these sometimes contain random garbage */ - offs =START_SECT (p)*sector_size; - size =NR_SECTS (p)*sector_size; + offs =start_sect (p)*sector_size; + size =nr_sects (p)*sector_size; next = this_sector + offs;if (i >=2 ) {if (offs + size > this_size)
@@ -179,13 +182,13 @@ parse_extended(struct parsed_partitions*/ p -=4 ;for (i=0 ; i<4 ; i++, p++) -if (NR_SECTS (p) &&is_extended_partition (p)) +if (nr_sects (p) &&is_extended_partition (p))break ;if (i ==4 ) goto done;/* nothing left to do */ - this_sector = first_sector +START_SECT (p) * sector_size; - this_size =NR_SECTS (p) * sector_size; + this_sector = first_sector +start_sect (p) * sector_size; + this_size =nr_sects (p) * sector_size;put_dev_sector (sect); } done:
@@ -197,7 +200,7 @@ done:static void parse_solaris_x86 (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_SOLARIS_X86_PARTITION Sector sect;
@@ -244,7 +247,7 @@ parse_solaris_x86(struct parsed_partitio*/ static void parse_bsd (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin,char *flavour, +sector_t offset,sector_t size,int origin,char *flavour,int max_partitions) {Sector sect;
@@ -263,7 +266,7 @@ parse_bsd(struct parsed_partitions *statif (le16_to_cpu (l->d_npartitions) < max_partitions) max_partitions =le16_to_cpu (l->d_npartitions);for (p = l->d_partitions; p - l->d_partitions < max_partitions; p++) { -u32 bsd_start, bsd_size; +sector_t bsd_start, bsd_size;if (state->next == state->limit)break ;
@@ -290,7 +293,7 @@ parse_bsd(struct parsed_partitions *statstatic void parse_freebsd (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_BSD_DISKLABEL parse_bsd(state, bdev, offset, size, origin,
@@ -300,7 +303,7 @@ parse_freebsd(struct parsed_partitions *static void parse_netbsd (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_BSD_DISKLABEL parse_bsd(state, bdev, offset, size, origin,
@@ -310,7 +313,7 @@ parse_netbsd(struct parsed_partitions *sstatic void parse_openbsd (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_BSD_DISKLABEL parse_bsd(state, bdev, offset, size, origin,
@@ -324,7 +327,7 @@ parse_openbsd(struct parsed_partitions **/ static void parse_unixware (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_UNIXWARE_DISKLABEL Sector sect;
@@ -348,7 +351,8 @@ parse_unixware(struct parsed_partitionsif (p->s_label !=UNIXWARE_FS_UNUSED )put_partition (state, state->next++, -START_SECT (p),NR_SECTS (p)); +le32_to_cpu (p->start_sect), +le32_to_cpu (p->nr_sects)); p++; }put_dev_sector (sect);
@@ -363,7 +367,7 @@ parse_unixware(struct parsed_partitions*/ static void parse_minix (struct parsed_partitions *state,struct block_device *bdev, -u32 offset,u32 size,int origin) +sector_t offset,sector_t size,int origin) {#ifdef CONFIG_MINIX_SUBPARTITION Sector sect;
@@ -390,7 +394,7 @@ parse_minix(struct parsed_partitions *st/* add each partition in use */ if (SYS_IND (p) ==MINIX_PARTITION )put_partition (state, state->next++, -START_SECT (p),NR_SECTS (p)); +start_sect (p),nr_sects (p)); }printk (" >\n" ); }
@@ -401,7 +405,7 @@ parse_minix(struct parsed_partitions *ststatic struct {unsigned char id;void (*parse)(struct parsed_partitions *,struct block_device *, -u32 ,u32 ,int ); +sector_t ,sector_t ,int ); } subtypes[] = { {FREEBSD_PARTITION , parse_freebsd}, {NETBSD_PARTITION , parse_netbsd},
@@ -415,7 +419,7 @@ static struct {int msdos_partition (struct parsed_partitions *state,struct block_device *bdev) { -int sector_size =bdev_logical_block_size (bdev) /512 ; +sector_t sector_size =bdev_logical_block_size (bdev) /512 ;Sector sect;unsigned char *data;struct partition *p;
@@ -483,8 +487,8 @@ int msdos_partition(struct parsed_partit state->next =5 ;for (slot =1 ; slot <=4 ; slot++, p++) { -u32 start =START_SECT (p)*sector_size; -u32 size =NR_SECTS (p)*sector_size; +sector_t start =start_sect (p)*sector_size; +sector_t size =nr_sects (p)*sector_size;if (!size)continue ;if (is_extended_partition (p)) {
@@ -513,7 +517,7 @@ int msdos_partition(struct parsed_partitunsigned char id =SYS_IND (p);int n; -if (!NR_SECTS (p)) +if (!nr_sects (p))continue ;for (n =0 ; subtypes[n].parse && id != subtypes[n].id; n++)
@@ -521,8 +525,8 @@ int msdos_partition(struct parsed_partitif (!subtypes[n].parse)continue ; - subtypes[n].parse (state, bdev,START_SECT (p)*sector_size, -NR_SECTS (p)*sector_size, slot); + subtypes[n].parse (state, bdev,start_sect (p)*sector_size, +nr_sects (p)*sector_size, slot); }put_dev_sector (sect);return 1 ;
PATCH 83/116 fs/partition/msdos: fix unusable extended partition for > 512B sector
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: OGAWA Hirofumi <[email protected]>
commit 8e0cc811e0f8029a7225372fb0951fab102c012f upstream.
Smaller size than a minimum blocksize can't be used, after all it's handled like 0 size.
For extended partition itself, this makes sure to use bigger size than one logical sector size at least.
--- fs/partitions/msdos.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
fs/partitions/msdos.c +10 -3
@@ -492,9 +492,16 @@ int msdos_partition(struct parsed_partitif (!size)continue ;if (is_extended_partition (p)) { -/* prevent someone doing mkfs or mkswap on an -extended partition, but leave room for LILO */ -put_partition (state, slot, start, size ==1 ?1 :2 ); +/* +* prevent someone doing mkfs or mkswap on an +* extended partition, but leave room for LILO +* FIXME: this uses one logical sector for > 512b +* sector, although it may not be enough/proper. +*/ +sector_t n =2 ; + n =min (size,max (sector_size, n)); +put_partition (state, slot, start, n); +printk (" <" );parse_extended (state, bdev, start, size);printk (" >" );
PATCH 84/116 PCI: fix return value from pcix_get_max_mmrbc()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit 25daeb550b69e89aff59bc6a84218a12b5203531 upstream.
For the PCI_X_STATUS register, pcix_get_max_mmrbc() is returning an incorrect value, which is based on:
(stat & PCI_X_STATUS_MAX_READ) >> 12
Valid return values are 512, 1024, 2048, 4096, which correspond to a 'stat' (masked and right shifted by 21) of 0, 1, 2, 3, respectively.
A right shift by 11 would generate the correct return value when 'stat' (masked and right shifted by 21) has a value of 1 or 2. But for a value of 0 or 3 it's not possible to generate the correct return value by only right shifting.
Fix is based on pcix_get_mmrbc()'s similar dealings with the PCI_X_CMD register.
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
@@ -2361,7 +2361,7 @@ int pcix_get_max_mmrbc(struct pci_dev *dif (err)return -EINVAL ; -return (stat &PCI_X_STATUS_MAX_READ ) >>12 ; +return 512 << ((stat &PCI_X_STATUS_MAX_READ ) >>21 ); }EXPORT_SYMBOL (pcix_get_max_mmrbc);
PATCH 85/116 PCI: fix access of PCI_X_CMD by pcix get and set mmrbc functions
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit bdc2bda7c4dd253026cc1fce45fc939304749029 upstream.
An e1000 driver on a system with a PCI-X bus was always being returned a value of 135 from both pcix_get_mmrbc() and pcix_set_mmrbc(). This value reflects an error return of PCIBIOS_BAD_REGISTER_NUMBER from pci_bus_read_config_dword(,, cap + PCI_X_CMD,).
This is because for a dword, the following portion of the PCI_OP_READ() macro:
if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER;
expands to:
if (pos & 3) return PCIBIOS_BAD_REGISTER_NUMBER;
And is always true for 'cap + PCI_X_CMD', which is 0xe4 + 2 = 0xe6. ('cap' is the result of calling pci_find_capability(, PCI_CAP_ID_PCIX).)
The same problem exists for pci_bus_write_config_dword(,, cap + PCI_X_CMD,). In both cases, instead of calling _dword(), _word() should be called.
--- drivers/pci/pci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/pci.c +6 -5
@@ -2375,13 +2375,13 @@ EXPORT_SYMBOL(pcix_get_max_mmrbc);int pcix_get_mmrbc (struct pci_dev *dev) {int ret, cap; -u32 cmd; +u16 cmd; cap =pci_find_capability (dev,PCI_CAP_ID_PCIX );if (!cap)return -EINVAL ; - ret =pci_read_config_dword (dev, cap +PCI_X_CMD , &cmd); + ret =pci_read_config_word (dev, cap +PCI_X_CMD , &cmd);if (!ret) ret =512 << ((cmd &PCI_X_CMD_MAX_READ ) >>2 );
@@ -2401,7 +2401,8 @@ EXPORT_SYMBOL(pcix_get_mmrbc);int pcix_set_mmrbc (struct pci_dev *dev,int mmrbc) {int cap, err = -EINVAL ; -u32 stat, cmd, v, o; +u32 stat, v, o; +u16 cmd;if (mmrbc <512 || mmrbc >4096 || !is_power_of_2 (mmrbc)) goto out;
@@ -2419,7 +2420,7 @@ int pcix_set_mmrbc(struct pci_dev *dev,if (v > (stat &PCI_X_STATUS_MAX_READ ) >>21 )return -E2BIG ; - err =pci_read_config_dword (dev, cap +PCI_X_CMD , &cmd); + err =pci_read_config_word (dev, cap +PCI_X_CMD , &cmd);if (err) goto out;
@@ -2431,7 +2432,7 @@ int pcix_set_mmrbc(struct pci_dev *dev, cmd &= ~PCI_X_CMD_MAX_READ ; cmd |= v <<2 ; - err =pci_write_config_dword (dev, cap +PCI_X_CMD , cmd); + err =pci_write_config_word (dev, cap +PCI_X_CMD , cmd); } out:return err;
PATCH 86/116 PCI: cleanup error return for pcix get and set mmrbc functions
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit 7c9e2b1c4784c6e574f69dbd904b2822f2e04d6e upstream.
pcix_get_mmrbc() returns the maximum memory read byte count (mmrbc), if successful, or an appropriate error value, if not.
Distinguishing errors from correct values and understanding the meaning of an error can be somewhat confusing in that:
correct values: 512, 1024, 2048, 4096 errors: -EINVAL -22 PCIBIOS_FUNC_NOT_SUPPORTED 0x81 PCIBIOS_BAD_VENDOR_ID 0x83 PCIBIOS_DEVICE_NOT_FOUND 0x86 PCIBIOS_BAD_REGISTER_NUMBER 0x87 PCIBIOS_SET_FAILED 0x88 PCIBIOS_BUFFER_TOO_SMALL 0x89
The PCIBIOS_ errors are returned from the PCI functions generated by the PCI_OP_READ() and PCI_OP_WRITE() macros.
In a similar manner, pcix_set_mmrbc() also returns the PCIBIOS_ error values returned from pci_read_config_[word|dword]() and pci_write_config_word().
Following pcix_get_max_mmrbc()'s example, the following patch simply returns -EINVAL for all PCIBIOS_ errors encountered by pcix_get_mmrbc(), and -EINVAL or -EIO for those encountered by pcix_set_mmrbc().
This simplification was chosen in light of the fact that none of the current callers of these functions are interested in the specific type of error encountered. In the future, should this change, one could simply create a function that maps each PCIBIOS_ error to a corresponding unique errno value, which could be called by pcix_get_max_mmrbc(), pcix_get_mmrbc(), and pcix_set_mmrbc().
Additionally, this patch eliminates some unnecessary variables.
--- drivers/pci/pci.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-)
drivers/pci/pci.c +16 -20
@@ -2350,15 +2350,14 @@ EXPORT_SYMBOL_GPL(pci_reset_function);*/ int pcix_get_max_mmrbc (struct pci_dev *dev) { -int err, cap; +int cap;u32 stat; cap =pci_find_capability (dev,PCI_CAP_ID_PCIX );if (!cap)return -EINVAL ; - err =pci_read_config_dword (dev, cap +PCI_X_STATUS , &stat); -if (err) +if (pci_read_config_dword (dev, cap +PCI_X_STATUS , &stat))return -EINVAL ;return 512 << ((stat &PCI_X_STATUS_MAX_READ ) >>21 );
@@ -2374,18 +2373,17 @@ EXPORT_SYMBOL(pcix_get_max_mmrbc);*/ int pcix_get_mmrbc (struct pci_dev *dev) { -int ret, cap; +int cap;u16 cmd; cap =pci_find_capability (dev,PCI_CAP_ID_PCIX );if (!cap)return -EINVAL ; - ret =pci_read_config_word (dev, cap +PCI_X_CMD , &cmd); -if (!ret) - ret =512 << ((cmd &PCI_X_CMD_MAX_READ ) >>2 ); +if (pci_read_config_word (dev, cap +PCI_X_CMD , &cmd)) +return -EINVAL ; -return ret; +return 512 << ((cmd &PCI_X_CMD_MAX_READ ) >>2 ); }EXPORT_SYMBOL (pcix_get_mmrbc);
@@ -2400,29 +2398,27 @@ EXPORT_SYMBOL(pcix_get_mmrbc);*/ int pcix_set_mmrbc (struct pci_dev *dev,int mmrbc) { -int cap, err = -EINVAL ; +int cap;u32 stat, v, o;u16 cmd;if (mmrbc <512 || mmrbc >4096 || !is_power_of_2 (mmrbc)) - goto out; +return -EINVAL ; v =ffs (mmrbc) -10 ; cap =pci_find_capability (dev,PCI_CAP_ID_PCIX );if (!cap) - goto out; +return -EINVAL ; - err =pci_read_config_dword (dev, cap +PCI_X_STATUS , &stat); -if (err) - goto out; +if (pci_read_config_dword (dev, cap +PCI_X_STATUS , &stat)) +return -EINVAL ;if (v > (stat &PCI_X_STATUS_MAX_READ ) >>21 )return -E2BIG ; - err =pci_read_config_word (dev, cap +PCI_X_CMD , &cmd); -if (err) - goto out; +if (pci_read_config_word (dev, cap +PCI_X_CMD , &cmd)) +return -EINVAL ; o = (cmd &PCI_X_CMD_MAX_READ ) >>2 ;if (o != v) {
@@ -2432,10 +2428,10 @@ int pcix_set_mmrbc(struct pci_dev *dev, cmd &= ~PCI_X_CMD_MAX_READ ; cmd |= v <<2 ; - err =pci_write_config_word (dev, cap +PCI_X_CMD , cmd); +if (pci_write_config_word (dev, cap +PCI_X_CMD , cmd)) +return -EIO ; } -out: -return err; +return 0 ; }EXPORT_SYMBOL (pcix_set_mmrbc);
PATCH 87/116 PCI quirk: RS780/RS880: work around missing MSI initialization
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit a5ee4eb75413c145334c30e43f1af9875dad6fd7 upstream.
AMD says in section 2.5.4 (GFX MSI Enable) of #43291 (AMD 780G Family Register Programming Requirements):
The SBIOS must enable internal graphics MSI capability in GCCFG by setting the following: NBCFG.NB_CNTL.STRAP_MSI_ENABLE='1'
Quite a few BIOS writers misinterpret this sentence and think that enabling MSI is an optional feature. However, clearing that bit just prevents delivery of MSI messages but does not remove the MSI PCI capabilities registers, and so leaves these devices unusable for any driver that attempts to use MSI.
Setting that bit is not possible after the BIOS has locked down the configuration registers, so we have to manually disable MSI for the affected devices.
This fixes the codec communication errors in the HDA driver when accessing the HDMI audio device, and allows us to get rid of the overcautious quirk in radeon_irq_kms.c.
--- drivers/pci/quirks.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/pci/quirks.c +33 -0
@@ -2463,6 +2463,39 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATDECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x4375 , quirk_msi_intx_disable_bug); +/* +* MSI does not work with the AMD RS780/RS880 internal graphics and HDMI audio +* devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit. +*/ +static void __init rs780_int_gfx_disable_msi (struct pci_dev *int_gfx_bridge) +{ +u32 nb_cntl; + +if (!int_gfx_bridge->subordinate) +return ; + +pci_bus_write_config_dword (int_gfx_bridge->bus,PCI_DEVFN (0 ,0 ), +0x60 ,0 ); +pci_bus_read_config_dword (int_gfx_bridge->bus,PCI_DEVFN (0 ,0 ), +0x64 , &nb_cntl); + +if (!(nb_cntl &BIT (10 ))) { +dev_warn (&int_gfx_bridge->dev, +FW_WARN "RS780: MSI for internal graphics disabled\n" ); + int_gfx_bridge->subordinate->bus_flags |=PCI_BUS_FLAGS_NO_MSI ; + } +} + +#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX 0x9602 + +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD , +PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX , + rs780_int_gfx_disable_msi); +/* wrong vendor ID on M4A785TD motherboard: */ +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ASUSTEK , +PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX , + rs780_int_gfx_disable_msi); +#endif /* CONFIG_PCI_MSI */ #ifdef CONFIG_PCI_IOV
Linus Torvalds
NAKRe: [087/116] PCI quirk: RS780/RS880: work around missing MSI initialization
Quoted 8 lines · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit
a5ee4eb75413c145334c30e43f1af9875dad6fd7upstream.
NAK.
Rafael reports this causes a regression. I don't think we know why, but more importantly, that definitely means this is not stable material.
Linus
Re: [087/116] PCI quirk: RS780/RS880: work around missing MSI initialization
Quoted 9 lines · Linus Torvalds
Quoted 5 lines · Greg KH
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 8 lines
Quoted 3 lines
From: Clemens Ladisch <[email protected]>
commit
a5ee4eb75413c145334c30e43f1af9875dad6fd7upstream.NAK.
Rafael reports this causes a regression. I don't think we know why, but more importantly, that definitely means this is not stable material.
Thanks, I've now dropped this from the .32 and .33 queues.
greg k-h
PATCH 88/116 rt2860sta: Fix argument to linux_pci_unmap_single()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
John Halton wrote in <http://bugs.debian.org/575726>:
Quoted 3 lines
Whenever
wpa_supplicantis deactivated (whether by killing the process or during a normal shutdown) I am getting a kerneloops that prevents the computer from completing shutdown. Here is the relevant syslog output:
The backtrace points to an incorrect call from RTMPFreeTxRxRingMemory() into linux_pci_unmap_single(). This appears to have been fixed in Linux 2.6.33 by this change:
commit ca97b8388838ee9ea4b4bad04948f8f7f8a607a3
Author: Bartlomiej Zolnierkiewicz <[email protected]> Date: Tue Sep 22 20:44:07 2009 +0200
Staging: rt28x0: updates from vendor's V2.1.0.0 drivers
For stable-2.6.32, just fix this one function call.
--- drivers/staging/rt2860/common/2860_rtmp_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rt2860/common/2860_rtmp_init.c +1 -1
@@ -716,7 +716,7 @@ VOID RTMPFreeTxRxRingMemory( {if ((pAd->RxRing.Cell[index].DmaBuf.AllocVa) && (pAd->RxRing.Cell[index].pNdisPacket)) { -PCI_UNMAP_SINGLE (pObj->pci_dev, pAd->RxRing.Cell[index].DmaBuf.AllocPa, pAd->RxRing.Cell[index].DmaBuf.AllocSize,PCI_DMA_FROMDEVICE ); +PCI_UNMAP_SINGLE (pAd, pAd->RxRing.Cell[index].DmaBuf.AllocPa, pAd->RxRing.Cell[index].DmaBuf.AllocSize,PCI_DMA_FROMDEVICE );RELEASE_NDIS_PACKET (pAd, pAd->RxRing.Cell[index].pNdisPacket,NDIS_STATUS_SUCCESS ); } }
PATCH 89/116 ath9k: fix BUG_ON triggered by PAE frames
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit 4fdec031b9169b3c17938b9c4168f099f457169c upstream.
When I initially stumbled upon sequence number problems with PAE frames in ath9k, I submitted a patch to remove all special cases for PAE frames and let them go through the normal transmit path.
Out of concern about crypto incompatibility issues, this change was merged instead:
commit 6c8afef551fef87a3bf24f8a74c69a7f2f72fc82
Author: Sujith <[email protected]> Date: Tue Feb 9 10:07:00 2010 +0530
ath9k: Fix sequence numbers for PAE frames
After a lot of testing, I'm able to reliably trigger a driver crash on rekeying with current versions with this change in place.
It seems that the driver does not support sending out regular MPDUs with the same TID while an A-MPDU session is active.
This leads to duplicate entries in the TID Tx buffer, which hits the following BUG_ON in ath_tx_addto_baw():
index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
BUG_ON(tid->tx_buf[cindex] != NULL);I believe until we actually have a reproducible case of an incompatibility with another AP using no PAE special cases, we should simply get rid of this mess.
This patch completely fixes my crash issues in STA mode and makes it stay connected without throughput drops or connectivity issues even when the AP is configured to a very short group rekey interval.
--- drivers/net/wireless/ath/ath9k/xmit.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +1 -20
@@ -1320,25 +1320,6 @@ static enum ath9k_pkt_type get_hw_packetreturn htype; } -static bool is_pae (struct sk_buff *skb) -{ -struct ieee80211_hdr *hdr; -__le16 fc; - - hdr = (struct ieee80211_hdr *)skb->data; - fc = hdr->frame_control; - -if (ieee80211_is_data (fc)) { -if (ieee80211_is_nullfunc (fc) || -/* Port Access Entity (IEEE 802.1X) */ - (skb->protocol ==cpu_to_be16 (ETH_P_PAE ))) { -return true; - } - } - -return false; -} -static int get_hw_crypto_keytype (struct sk_buff *skb) {struct ieee80211_tx_info *tx_info =IEEE80211_SKB_CB (skb);
@@ -1648,7 +1629,7 @@ static void ath_tx_start_dma(struct ath_ goto tx_done; } -if ((tx_info->flags &IEEE80211_TX_CTL_AMPDU ) && !is_pae (skb)) { +if (tx_info->flags &IEEE80211_TX_CTL_AMPDU ) {/* * Try aggregation if it's a unicast data frame * and the destination is HT capable.
PATCH 90/116 cpuset: fix the problem that cpuset_mem_spread_node() returns an offline node
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Miao Xie <[email protected]>
commit 5ab116c9349ef52d6fbd2e2917a53f13194b048e upstream.
cpuset_mem_spread_node() returns an offline node, and causes an oops.
This patch fixes it by initializing task->mems_allowed to node_states[N_HIGH_MEMORY], and updating task->mems_allowed when doing memory hotplug.
--- init/main.c | 2 +- kernel/cpuset.c | 20 ++++++++++++-------- kernel/kthread.c | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-)
init/main.c +1 -1
@@ -846,7 +846,7 @@ static int __init kernel_init(void * unu/* * init can allocate pages on any node */ -set_mems_allowed (node_possible_map); +set_mems_allowed (node_states[N_HIGH_MEMORY ]);/* * init can run on any cpu. */
kernel/cpuset.c +12 -8
@@ -921,9 +921,6 @@ static int update_cpumask(struct cpuset* call to guarantee_online_mems(), as we know no one is changing * our task's cpuset. * -* Hold callback_mutex around the two modifications of our tasks -* mems_allowed to synchronize with cpuset_mems_allowed(). -* * While the mm_struct we are migrating is typically from some * other task, the task_struct mems_allowed that we are hacking * is for our current task, which must allocate new pages for that
@@ -1392,11 +1389,10 @@ static void cpuset_attach(struct cgroup_if (cs == &top_cpuset) {cpumask_copy (cpus_attach, cpu_possible_mask); - to = node_possible_map; }else {guarantee_online_cpus (cs, cpus_attach); -guarantee_online_mems (cs, &to); } +guarantee_online_mems (cs, &to);/* do per-task migration stuff possibly for each in the threadgroup */ cpuset_attach_task (tsk, &to, cs);
@@ -2091,15 +2087,23 @@ static int cpuset_track_online_cpus(strustatic int cpuset_track_online_nodes (struct notifier_block *self,unsigned long action,void *arg) { +nodemask_t oldmems; +cgroup_lock ();switch (action) {case MEM_ONLINE : -case MEM_OFFLINE : + oldmems = top_cpuset.mems_allowed;mutex_lock (&callback_mutex); top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY ];mutex_unlock (&callback_mutex); -if (action ==MEM_OFFLINE ) -scan_for_empty_cpusets (&top_cpuset); +update_tasks_nodemask (&top_cpuset, &oldmems,NULL ); +break ; +case MEM_OFFLINE : +/* +* needn't update top_cpuset.mems_allowed explicitly because +* scan_for_empty_cpusets() will update it. +*/ +scan_for_empty_cpusets (&top_cpuset);break ;default :break ;
kernel/kthread.c +1 -1
@@ -196,7 +196,7 @@ int kthreadd(void *unused)set_task_comm (tsk,"kthreadd" );ignore_signals (tsk);set_cpus_allowed_ptr (tsk, cpu_all_mask); -set_mems_allowed (node_possible_map); +set_mems_allowed (node_states[N_HIGH_MEMORY ]); current->flags |=PF_NOFREEZE |PF_FREEZER_NOSIG ;
PATCH 91/116 softlockup: Stop spurious softlockup messages due to overflow
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Colin Ian King <[email protected]>
commit 8c2eb4805d422bdbf60ba00ff233c794d23c3c00 upstream.
Ensure additions on touch_ts do not overflow. This can occur when the top 32 bits of the TSC reach 0xffffffff causing additions to touch_ts to overflow and this in turn generates spurious softlockup warnings.
LKML-Reference: <1268994482.1798.6.camel@lenovo>
--- kernel/softlockup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softlockup.c +2 -2
@@ -140,11 +140,11 @@ void softlockup_tick(void)* Wake up the high-prio watchdog task twice per * threshold timespan. */ -if (now > touch_timestamp + softlockup_thresh/2 ) +if (time_after (now - softlockup_thresh/2 , touch_timestamp))wake_up_process (per_cpu (watchdog_task, this_cpu));/* Warn about unreasonable delays: */ -if (now <= (touch_timestamp + softlockup_thresh)) +if (time_before_eq (now - softlockup_thresh, touch_timestamp))return ;per_cpu (print_timestamp, this_cpu) = touch_timestamp;
PATCH 92/116 drm/i915: Avoid NULL deref in get_pages() unwind after error.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Wilson <[email protected]>
commit 1f2b10131f83f7caa67bf1273cec126b4283015d upstream.
Fixes:
http://bugzilla.kernel.org/show_bug.cgi?id=15527
NULL pointer dereference in i915_gem_object_save_bit_17_swizzle
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<f82b5d2b>] i915_gem_object_save_bit_17_swizzle+0x5b/0xc0 [i915] Call Trace: [<f82aea55>] ? i915_gem_object_put_pages+0x125/0x150 [i915] [<f82aeb71>] ? i915_gem_object_get_pages+0xf1/0x110 [i915] [<f82b0de8>] ? i915_gem_object_bind_to_gtt+0xb8/0x2a0 [i915] [<c02db74d>] ? drm_mm_get_block_generic+0x4d/0x180 [<f82b11cd>] ? i915_gem_mmap_gtt_ioctl+0x16d/0x240 [i915] [<f82ae786>] ? i915_gem_madvise_ioctl+0x86/0x120 [i915]
--- drivers/gpu/drm/i915/i915_gem.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +12 -9
@@ -1470,9 +1470,6 @@ i915_gem_object_put_pages(struct drm_gem obj_priv->dirty =0 ;for (i =0 ; i < page_count; i++) { -if (obj_priv->pages[i] ==NULL ) -break ; -if (obj_priv->dirty)set_page_dirty (obj_priv->pages[i]);
@@ -2246,7 +2243,6 @@ i915_gem_object_get_pages(struct drm_gemstruct address_space *mapping;struct inode *inode;struct page *page; -int ret;if (obj_priv->pages_refcount++ !=0 )return 0 ;
@@ -2269,11 +2265,9 @@ i915_gem_object_get_pages(struct drm_gemmapping_gfp_mask (mapping) | __GFP_COLD | gfpmask); -if (IS_ERR (page)) { - ret =PTR_ERR (page); -i915_gem_object_put_pages (obj); -return ret; - } +if (IS_ERR (page)) + goto err_pages; + obj_priv->pages[i] = page; }
@@ -2281,6 +2275,15 @@ i915_gem_object_get_pages(struct drm_gemi915_gem_object_do_bit_17_swizzle (obj);return 0 ; + +err_pages: +while (i--) +page_cache_release (obj_priv->pages[i]); + +drm_free_large (obj_priv->pages); + obj_priv->pages =NULL ; + obj_priv->pages_refcount--; +return PTR_ERR (page); }static void i965_write_fence_reg (struct drm_i915_fence_reg *reg)
PATCH 93/116 netfilter: xt_recent: fix regression in rules using a zero hit_count
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Patrick McHardy <[email protected]>
commit ef1691504c83ba3eb636c0cfd3ed33f7a6d0b4ee upstream.
Commit 8ccb92ad (netfilter: xt_recent: fix false match) fixed supposedly false matches in rules using a zero hit_count. As it turns out there is nothing false about these matches and people are actually using entries with a hit_count of zero to make rules dependant on addresses inserted manually through /proc.
Since this slipped past the eyes of three reviewers, instead of reverting the commit in question, this patch explicitly checks for a hit_count of zero to make the intentions more clear.
--- net/netfilter/xt_recent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_recent.c +1 -1
@@ -260,7 +260,7 @@ recent_mt(const struct sk_buff *skb, confor (i =0 ; i < e->nstamps; i++) {if (info->seconds &&time_after (time, e->stamps[i]))continue ; -if (info->hit_count && ++hits >= info->hit_count) { +if (!info->hit_count || ++hits >= info->hit_count) { ret = !ret;break ; }
PATCH 94/116 x86: Fix placement of FIX_OHCI1394_BASE
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Beulich <[email protected]>
commit ff30a0543e9a6cd732582063e7cae951cdb7acf2 upstream.
Ever for 32-bit with sufficiently high NR_CPUS, and starting with commit 789d03f584484af85dbdc64935270c8e45f36ef7 also for 64-bit, the statically allocated early fixmap page tables were not covering FIX_OHCI1394_BASE, leading to a boot time crash when "ohci1394_dma=early" was used. Despite this entry not being a permanently used one, it needs to be moved into the permanent range since it has to be close to FIX_DBGP_BASE and FIX_EARLYCON_MEM_BASE.
Fixes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=14487
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/fixmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/include/asm/fixmap.h +3 -3
@@ -82,6 +82,9 @@ enum fixed_addresses {#endif FIX_DBGP_BASE, FIX_EARLYCON_MEM_BASE, +#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT + FIX_OHCI1394_BASE, +#endif #ifdef CONFIG_X86_LOCAL_APIC FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */#endif
@@ -126,9 +129,6 @@ enum fixed_addresses {FIX_BTMAP_END = __end_of_permanent_fixed_addresses +256 - (__end_of_permanent_fixed_addresses &255 ),FIX_BTMAP_BEGIN =FIX_BTMAP_END +NR_FIX_BTMAPS *FIX_BTMAPS_SLOTS -1 , -#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT -FIX_OHCI1394_BASE , -#endif #ifdef CONFIG_X86_32 FIX_WP_TEST, #endif
PATCH 95/116 x86, amd: Restrict usage of c1e_idle()
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andreas Herrmann <[email protected]>
commit 035a02c1e1de31888e8b6adac0ff667971ac04db upstream.
Currently c1e_idle returns true for all CPUs greater than or equal to family 0xf model 0x40. This covers too many CPUs.
Meanwhile a respective erratum for the underlying problem was filed (#400). This patch adds the logic to check whether erratum #400 applies to a given CPU.
Especially for CPUs where SMI/HW triggered C1e is not supported, c1e_idle() doesn't need to be used. We can check this by looking at the respective OSVW bit for erratum #400.
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/msr-index.h | 2 ++ arch/x86/kernel/process.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-)
arch/x86/include/asm/msr-index.h +2 -0
@@ -104,6 +104,8 @@#define MSR_AMD64_PATCH_LEVEL 0x0000008b#define MSR_AMD64_NB_CFG 0xc001001f#define MSR_AMD64_PATCH_LOADER 0xc0010020 +#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140 +#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD64_IBSFETCHCTL 0xc0011030#define MSR_AMD64_IBSFETCHLINAD 0xc0011031#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
arch/x86/kernel/process.c +24 -8
@@ -439,21 +439,37 @@ static int __cpuinit mwait_usable(const }/* -* Check for AMD CPUs, which have potentially C1E support +* Check for AMD CPUs, where APIC timer interrupt does not wake up CPU from C1e. +* For more information see +* - Erratum #400 for NPT family 0xf and family 0x10 CPUs +* - Erratum #365 for family 0x11 (not affected because C1e not in use) */ static int __cpuinit check_c1e_idle (const struct cpuinfo_x86 *c) { +u64 val;if (c->x86_vendor !=X86_VENDOR_AMD ) -return 0 ; - -if (c->x86 <0x0F ) -return 0 ; + goto no_c1e_idle;/* Family 0x0f models < rev F do not have C1E */ -if (c->x86 ==0x0f && c->x86_model <0x40 ) -return 0 ; +if (c->x86 ==0x0F && c->x86_model >=0x40 ) +return 1 ; + +if (c->x86 ==0x10 ) { +/* +* check OSVW bit for CPUs that are not affected +* by erratum #400 +*/ +rdmsrl (MSR_AMD64_OSVW_ID_LENGTH , val); +if (val >=2 ) { +rdmsrl (MSR_AMD64_OSVW_STATUS , val); +if (!(val &BIT (1 ))) + goto no_c1e_idle; + } +return 1 ; + } -return 1 ; +no_c1e_idle: +return 0 ; }static cpumask_var_t c1e_mask;
PATCH 96/116 hwmon: (coretemp) Add missing newline to dev_warn() message
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit 4d7a5644e4adfafe76c2bd8ee168e3f3b5dae3a8 upstream.
Add missing newline to dev_warn() message string. This is more of an issue with older kernels that don't automatically add a newline if it was missing from the end of the previous line.
--- drivers/hwmon/coretemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/coretemp.c +1 -1
@@ -228,7 +228,7 @@ static int __devinit adjust_tjmax(structif (err) {dev_warn (dev,"Unable to access MSR 0xEE, for Tjmax, left" -" at default" ); +" at default\n" ); }else if (eax &0x40000000 ) { tjmax = tjmax_ee; }
PATCH 97/116 ALSA: hda: Use LPIB for ga-ma770-ud3 board
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 9ec8ddad59fadd8021adfea4cb716a49b0e232e9 upstream.
The OR states that position_fix=1 is necessary to work around glitching during volume adjustments using PulseAudio.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2228,6 +2228,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x1106 ,0x3288 ,"ASUS M2V-MX SE" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01f6 ,"Dell Latitude 131L" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x1458 ,0xa022 ,"ga-ma770-ud3" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x820f ,"Biostar Microtech" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB),
PATCH 98/116 ALSA: ac97: Add Toshiba P500 to ac97 jack sense blacklist
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Chen <[email protected]>
commit 5cd165e7057020884e430941c24454d3df9a799d upstream.
The OR has verified that both 'Headphone Jack Sense' and 'Line Jack Sense' need to be muted for sound to be audible, so just add the machine's SSID to the ac97 jack sense blacklist.
--- sound/pci/ac97/ac97_patch.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/ac97/ac97_patch.c +1 -0
@@ -1873,6 +1873,7 @@ static unsigned int ad1981_jacks_blackli0x10280160 ,/* Dell Dimension 2400 */ 0x104380b0 ,/* Asus A7V8X-MX */ 0x11790241 ,/* Toshiba Satellite A-15 S127 */ +0x1179ff10 ,/* Toshiba P500 */ 0x144dc01a ,/* Samsung NP-X20C004/SEG */ 0 /* end */ };
PATCH 99/116 ALSA: ac97: Add IBM ThinkPad R40e to Headphone/Line Jack Sense blacklist
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit e1f7f02b45cf33a774d56e505ce1718af9392f5e upstream.
This model needs both 'Headphone Jack Sense' and 'Line Jack Sense' muted for audible audio, so just add its SSID to the blacklist and don't enumerate the controls.
--- sound/pci/ac97/ac97_patch.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/ac97/ac97_patch.c +1 -0
@@ -1867,6 +1867,7 @@ static unsigned int ad1981_jacks_blackli0x10140523 ,/* Thinkpad R40 */ 0x10140534 ,/* Thinkpad X31 */ 0x10140537 ,/* Thinkpad T41p */ +0x1014053e ,/* Thinkpad R40e */ 0x10140554 ,/* Thinkpad T42p/R50p */ 0x10140567 ,/* Thinkpad T43p 2668-G7U */ 0x10140581, /* Thinkpad X41-2527 */
PATCH 100/116 ALSA: hda: Use ALC260_WILL quirk for another Acer model (0x1025007f)
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 950200e2ff11daae1c5d9426703bdd494603f38b upstream.
The original reporter states that this quirk is necessary to obtain reasonable gain for playback. Without it, sound is inaudible. Tested with playback (spkr and hp) and capture.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -6252,6 +6252,7 @@ static const char *alc260_models[ALC260_static struct snd_pci_quirk alc260_cfg_tbl[] = {SND_PCI_QUIRK (0x1025 ,0x007b ,"Acer C20x" ,ALC260_ACER ), +SND_PCI_QUIRK (0x1025 ,0x007f ,"Acer" ,ALC260_WILL ),SND_PCI_QUIRK (0x1025 ,0x008f ,"Acer" ,ALC260_ACER ),SND_PCI_QUIRK (0x1509 ,0x4540 ,"Favorit 100XS" ,ALC260_FAVORIT100 ),SND_PCI_QUIRK (0x103c ,0x2808 ,"HP d5700" ,ALC260_HP_3013 ),
PATCH 101/116 ath9k: Enable TIM timer interrupt only when needed.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <[email protected]>
commit 3f7c5c10e9dc6bf90179eb9f7c06151d508fb324 upstream.
The TIM timer interrupt is enabled even before the ACK of nullqos is received which is unnecessary.
Also clean up the CONF_PS part of config callback properly for better readability.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/main.c | 25 ++++++++++++++----------- drivers/net/wireless/ath/ath9k/xmit.c | 7 +++---- 3 files changed, 18 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
@@ -368,6 +368,7 @@ void ath_tx_aggr_start(struct ath_softc u16 tid, u16 *ssn);void ath_tx_aggr_stop (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid);void ath_tx_aggr_resume (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid); +void ath9k_enable_ps (struct ath_softc *sc);/********/ /* VIFs */
drivers/net/wireless/ath/ath9k/main.c +14 -11
@@ -2305,6 +2305,19 @@ static void ath9k_remove_interface(strucmutex_unlock (&sc->mutex); } +void ath9k_enable_ps (struct ath_softc *sc) +{ + sc->ps_enabled = true; +if (!(sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_AUTOSLEEP )) { +if ((sc->imask &ATH9K_INT_TIM_TIMER ) ==0 ) { + sc->imask |=ATH9K_INT_TIM_TIMER ; +ath9k_hw_set_interrupts (sc->sc_ah, + sc->imask); + } + } +ath9k_hw_setrxabort (sc->sc_ah,1 ); +} +static int ath9k_config (struct ieee80211_hw *hw,u32 changed) {struct ath_wiphy *aphy = hw->priv;
@@ -2336,19 +2349,9 @@ static int ath9k_config(struct ieee80211if (changed &IEEE80211_CONF_CHANGE_PS ) {if (conf->flags &IEEE80211_CONF_PS ) { sc->sc_flags |=SC_OP_PS_ENABLED ; -if (!(ah->caps.hw_caps & -ATH9K_HW_CAP_AUTOSLEEP )) { -if ((sc->imask &ATH9K_INT_TIM_TIMER ) ==0 ) { - sc->imask |=ATH9K_INT_TIM_TIMER ; -ath9k_hw_set_interrupts (sc->sc_ah, - sc->imask); - } - } - sc->ps_enabled = true;if ((sc->sc_flags &SC_OP_NULLFUNC_COMPLETED )) { sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED ; - sc->ps_enabled = true; -ath9k_hw_setrxabort (sc->sc_ah,1 ); +ath9k_enable_ps (sc); } }else { sc->ps_enabled = false;
drivers/net/wireless/ath/ath9k/xmit.c +3 -4
@@ -1979,10 +1979,9 @@ static void ath_tx_processq(struct ath_sif (bf->bf_isnullfunc && (ds->ds_txstat.ts_status &ATH9K_TX_ACKED )) { -if ((sc->sc_flags &SC_OP_PS_ENABLED )) { - sc->ps_enabled = true; -ath9k_hw_setrxabort (sc->sc_ah,1 ); - }else +if ((sc->sc_flags &SC_OP_PS_ENABLED )) +ath9k_enable_ps (sc); +else sc->sc_flags |=SC_OP_NULLFUNC_COMPLETED ; }
PATCH 102/116 mac80211: Retry null data frame for power save
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <[email protected]>
commit 375177bf35efc08e1bd37bbda4cc0c8cc4db8500 upstream.
Even if the null data frame is not acked by the AP, mac80211 goes into power save. This might lead to loss of frames from the AP.
Prevent this by restarting dynamic_ps_timer when ack is not received for null data frames.
--- include/net/mac80211.h | 4 ++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/main.c | 15 +++++++++++++++ net/mac80211/mlme.c | 20 +++++++++++++++----- 4 files changed, 35 insertions(+), 5 deletions(-)
include/net/mac80211.h +4 -0
@@ -908,6 +908,9 @@ enum ieee80211_tkip_key_type {* @IEEE80211_HW_BEACON_FILTER: * Hardware supports dropping of irrelevant beacon frames to * avoid waking up cpu. +* @IEEE80211_HW_REPORTS_TX_ACK_STATUS: +* Hardware can provide ack status reports of Tx frames to +* the stack. */ enum ieee80211_hw_flags {IEEE80211_HW_RX_INCLUDES_FCS =1 <<1 ,
@@ -924,6 +927,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_SUPPORTS_DYNAMIC_PS =1 <<12 ,IEEE80211_HW_MFP_CAPABLE =1 <<13 ,IEEE80211_HW_BEACON_FILTER =1 <<14 , + IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<15, };/**
net/mac80211/ieee80211_i.h +1 -0
@@ -264,6 +264,7 @@ enum ieee80211_sta_flags {IEEE80211_STA_DISABLE_11N =BIT (4 ),IEEE80211_STA_CSA_RECEIVED =BIT (5 ),IEEE80211_STA_MFP_ENABLED =BIT (6 ), + IEEE80211_STA_NULLFUNC_ACKED = BIT(7), };/* flags for MLME request */
net/mac80211/main.c +15 -0
@@ -441,6 +441,7 @@ void ieee80211_tx_status(struct ieee8021rcu_read_lock (); sband = local->hw.wiphy->bands[info->band]; + fc = hdr->frame_control; sta =sta_info_get (local, hdr->addr1);
@@ -522,6 +523,20 @@ void ieee80211_tx_status(struct ieee8021 local->dot11FailedCount++; } +if (ieee80211_is_nullfunc (fc) &&ieee80211_has_pm (fc) && + (local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS ) && + !(info->flags &IEEE80211_TX_CTL_INJECTED ) && + local->ps_sdata && !(local->scanning)) { +if (info->flags &IEEE80211_TX_STAT_ACK ) { + local->ps_sdata->u.mgd.flags |= +IEEE80211_STA_NULLFUNC_ACKED ; +ieee80211_queue_work (&local->hw, + &local->dynamic_ps_enable_work); + }else +mod_timer (&local->dynamic_ps_timer, jiffies + +msecs_to_jiffies (10 )); + } +/* this was a transmitted frame, but now we want to reuse it */ skb_orphan (skb);
net/mac80211/mlme.c +15 -5
@@ -650,8 +650,11 @@ static void ieee80211_enable_ps(struct i }else {if (local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK )ieee80211_send_nullfunc (local, sdata,1 ); - conf->flags |=IEEE80211_CONF_PS ; -ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + +if (!(local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS )) { + conf->flags |=IEEE80211_CONF_PS ; +ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + } } }
@@ -742,6 +745,7 @@ void ieee80211_dynamic_ps_enable_work(st container_of(work, struct ieee80211_local, dynamic_ps_enable_work);struct ieee80211_sub_if_data *sdata = local->ps_sdata; +struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;/* can only happen when PS was just disabled anyway */ if (!sdata)
@@ -750,11 +754,16 @@ void ieee80211_dynamic_ps_enable_work(stif (local->hw.conf.flags &IEEE80211_CONF_PS )return ; -if (local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK ) +if ((local->hw.flags &IEEE80211_HW_PS_NULLFUNC_STACK ) && + (!(ifmgd->flags &IEEE80211_STA_NULLFUNC_ACKED )))ieee80211_send_nullfunc (local, sdata,1 ); - local->hw.conf.flags |=IEEE80211_CONF_PS ; -ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); +if (!(local->hw.flags &IEEE80211_HW_REPORTS_TX_ACK_STATUS ) || + (ifmgd->flags &IEEE80211_STA_NULLFUNC_ACKED )) { + ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED ; + local->hw.conf.flags |=IEEE80211_CONF_PS ; +ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + } }void ieee80211_dynamic_ps_timer (unsigned long data)
@@ -2458,6 +2467,7 @@ int ieee80211_mgd_assoc(struct ieee80211list_add (&wk->list, &ifmgd->work_list); ifmgd->flags &= ~IEEE80211_STA_DISABLE_11N ; + ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED ;for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
PATCH 103/116 ath9k: Enable IEEE80211_HW_REPORTS_TX_ACK_STATUS flag for ath9k
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
commit 05df49865be08b30e7ba91b9d3d94d7d52dd3033 upstream.
--- drivers/net/wireless/ath/ath9k/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/main.c +1 -0
@@ -1544,6 +1544,7 @@ void ath_set_hw_capab(struct ath_softc *IEEE80211_HW_AMPDU_AGGREGATION |IEEE80211_HW_SUPPORTS_PS |IEEE80211_HW_PS_NULLFUNC_STACK | +IEEE80211_HW_REPORTS_TX_ACK_STATUS |IEEE80211_HW_SPECTRUM_MGMT ;if (AR_SREV_9160_10_OR_LATER (sc->sc_ah) || modparam_nohwcrypt)
PATCH 104/116 mac80211: Reset dynamic ps timer in Rx path.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vivek Natarajan <[email protected]>
commit e15276a4b220c54db665cf46a92bd9ceb9aeb052 upstream.
The current mac80211 implementation enables power save if there is no Tx traffic for a specific timeout. Hence, PS is triggered even if there is a continuous Rx only traffic(like UDP) going on. This makes the drivers to wait on the tim bit in the next beacon to awake which leads to redundant sleep-wake cycles. Fix this by restarting the dynamic ps timer on receiving every data packet.
--- net/mac80211/rx.c | 8 ++++++++ 1 file changed, 8 insertions(+)
net/mac80211/rx.c +8 -0
@@ -1590,6 +1590,7 @@ static ieee80211_rx_result debug_noinlin ieee80211_rx_h_data(struct ieee80211_rx_data *rx) {struct net_device *dev = rx->dev; +struct ieee80211_local *local = rx->local;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;__le16 fc = hdr->frame_control;int err;
@@ -1612,6 +1613,13 @@ ieee80211_rx_h_data(struct ieee80211_rx_ dev->stats.rx_packets++; dev->stats.rx_bytes += rx->skb->len; +if (ieee80211_is_data (hdr->frame_control) && + !is_multicast_ether_addr (hdr->addr1) && + local->hw.conf.dynamic_ps_timeout >0 && local->ps_sdata) { +mod_timer (&local->dynamic_ps_timer, jiffies + +msecs_to_jiffies (local->hw.conf.dynamic_ps_timeout)); + } +ieee80211_deliver_skb (rx);return RX_QUEUED ;
PATCH 105/116 leds-gpio: fix default state handling on OF platforms
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anton Vorontsov <[email protected]>
commit 0493a4ff10959ff4c8e0d65efee25b7ffd4fa5db upstream.
The driver wrongly sets default state for LEDs that don't specify default-state property.
Currently the driver handles default state this way:
memset(&led, 0, sizeof(led));
for_each_child_of_node(np, child) {
state = of_get_property(child, "default-state", NULL);
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
...
}
ret = create_gpio_led(&led, ...);
}Which means that all LEDs that do not specify default-state will inherit the last value of the default-state property, which is wrong.
This patch fixes the issue by moving LED's template initialization into the loop body.
drivers/leds/leds-gpio.c +1 -2
@@ -211,7 +211,6 @@ static int __devinit of_gpio_leds_probe(struct of_device *ofdev, const struct of_device_id *match) {struct device_node *np = ofdev->node, *child; -struct gpio_led led;struct gpio_led_of_platform_data *pdata;int count =0 , ret;
@@ -226,8 +225,8 @@ static int __devinit of_gpio_leds_probe(struct of_device *ofdev,if (!pdata)return -ENOMEM ; -memset (&led,0 ,sizeof (led));for_each_child_of_node (np, child) { +struct gpio_led led = {};enum of_gpio_flags flags;const char *state;
PATCH 106/116 quota: manage reserved space when quota is not active [v2]
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dmitry Monakhov <[email protected]>
commit c469070aea5a0ada45a836937c776fd3083dae2b upstream.
Since we implemented generic reserved space management interface, then it is possible to account reserved space even when quota is not active (similar to i_blocks/i_bytes).
Without this patch following testcase result in massive comlain from WARN_ON in dquot_claim_space()
TEST_CASE:
mount /dev/sdb /mnt -oquota
dd if=/dev/zero of=/mnt/test bs=1M count=1
quotaon /mnt
# fs_reserved_spave == 1Mb # quota_reserved_space == 0, because quota was disabled dd if=/dev/zero of=/mnt/test seek=1 bs=1M count=1 # fs_reserved_spave == 2Mb # quota_reserved_space == 1Mb sync # ->dquot_claim_space() -> WARN_ON
--- fs/quota/dquot.c | 10 ++++++---- include/linux/quotaops.h | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-)
fs/quota/dquot.c +6 -4
@@ -1399,28 +1399,30 @@ static qsize_t *inode_reserved_space(strreturn inode->i_sb->dq_op->get_reserved_space (inode); } -static void inode_add_rsv_space (struct inode *inode,qsize_t number) +void inode_add_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) += number;spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_add_rsv_space); - -static void inode_claim_rsv_space (struct inode *inode,qsize_t number) +void inode_claim_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) -= number;__inode_add_bytes (inode, number);spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_claim_rsv_space); -static void inode_sub_rsv_space (struct inode *inode,qsize_t number) +void inode_sub_rsv_space (struct inode *inode,qsize_t number) {spin_lock (&inode->i_lock); *inode_reserved_space (inode) -= number;spin_unlock (&inode->i_lock); } +EXPORT_SYMBOL (inode_sub_rsv_space);static qsize_t inode_get_rsv_space (struct inode *inode) {
include/linux/quotaops.h +9 -2
@@ -26,6 +26,10 @@ static inline void writeout_quota_sb(str sb->s_qcop->quota_sync (sb, type); } +void inode_add_rsv_space (struct inode *inode,qsize_t number); +void inode_claim_rsv_space (struct inode *inode,qsize_t number); +void inode_sub_rsv_space (struct inode *inode,qsize_t number); +int dquot_initialize (struct inode *inode,int type);int dquot_drop (struct inode *inode);struct dquot *dqget (struct super_block *sb,unsigned int id,int type);
@@ -42,7 +46,6 @@ int dquot_alloc_inode(const struct inodeint dquot_reserve_space (struct inode *inode,qsize_t number,int prealloc);int dquot_claim_space (struct inode *inode,qsize_t number);void dquot_release_reserved_space (struct inode *inode,qsize_t number); -qsize_t dquot_get_reserved_space (struct inode *inode);int dquot_free_space (struct inode *inode,qsize_t number);int dquot_free_inode (const struct inode *inode,qsize_t number);
@@ -199,6 +202,8 @@ static inline int vfs_dq_reserve_space(sif (inode->i_sb->dq_op->reserve_space (inode, nr,0 ) ==NO_QUOTA )return 1 ; } +else +inode_add_rsv_space (inode, nr);return 0 ; }
@@ -221,7 +226,7 @@ static inline int vfs_dq_claim_space(strif (inode->i_sb->dq_op->claim_space (inode, nr) ==NO_QUOTA )return 1 ; }else -inode_add_bytes (inode, nr); +inode_claim_rsv_space (inode, nr);mark_inode_dirty (inode);return 0 ;
@@ -235,6 +240,8 @@ void vfs_dq_release_reservation_space(st {if (sb_any_quota_active (inode->i_sb)) inode->i_sb->dq_op->release_rsv (inode, nr); +else +inode_sub_rsv_space (inode, nr); }static inline void vfs_dq_free_space_nodirty (struct inode *inode,qsize_t nr)
PATCH 107/116 quota: Fix warning when a delayed write happens before quota is enabled
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit 0a5a9c725512461d19397490f3adf29931dca1f2 upstream.
If a delayed-allocation write happens before quota is enabled, the kernel spits out a warning:
WARNING: at fs/quota/dquot.c:988 dquot_claim_space+0x77/0x112()
because the fact that user has some delayed allocation is not recorded in quota structure.
Make dquot_initialize() update amount of reserved space for user if it sees inode has some space reserved. Also make sure that reserved quota space does not go negative and we warn about the filesystem bug just once.
--- fs/quota/dquot.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-)
fs/quota/dquot.c +31 -4
@@ -229,6 +229,8 @@ static struct hlist_head *dquot_hash;struct dqstats dqstats;EXPORT_SYMBOL (dqstats); +static qsize_t inode_get_rsv_space (struct inode *inode); +static inline unsigned int hashfn (const struct super_block *sb,unsigned int id,int type) {
@@ -820,11 +822,14 @@ static int dqinit_needed(struct inode *istatic void add_dquot_ref (struct super_block *sb,int type) {struct inode *inode, *old_inode =NULL ; +int reserved =0 ;spin_lock (&inode_lock);list_for_each_entry (inode, &sb->s_inodes, i_sb_list) {if (inode->i_state & (I_FREEING |I_CLEAR |I_WILL_FREE |I_NEW ))continue ; +if (unlikely (inode_get_rsv_space (inode) >0 )) + reserved =1 ;if (!atomic_read (&inode->i_writecount))continue ;if (!dqinit_needed (inode, type))
@@ -845,6 +850,12 @@ static void add_dquot_ref(struct super_b }spin_unlock (&inode_lock);iput (old_inode); + +if (reserved) { +printk (KERN_WARNING "VFS (%s): Writes happened before quota" +" was turned on thus quota information is probably " +"inconsistent. Please run quotacheck(8).\n" , sb->s_id); + } }/*
@@ -958,10 +969,12 @@ static inline void dquot_resv_space(stru/* * Claim reserved quota space */ -static void dquot_claim_reserved_space (struct dquot *dquot, -qsize_t number) +static void dquot_claim_reserved_space (struct dquot *dquot,qsize_t number) { -WARN_ON (dquot->dq_dqb.dqb_rsvspace < number); +if (dquot->dq_dqb.dqb_rsvspace < number) { +WARN_ON_ONCE (1 ); + number = dquot->dq_dqb.dqb_rsvspace; + } dquot->dq_dqb.dqb_curspace += number; dquot->dq_dqb.dqb_rsvspace -= number; }
@@ -969,7 +982,12 @@ static void dquot_claim_reserved_space(sstatic inline void dquot_free_reserved_space (struct dquot *dquot,qsize_t number) { - dquot->dq_dqb.dqb_rsvspace -= number; +if (dquot->dq_dqb.dqb_rsvspace >= number) + dquot->dq_dqb.dqb_rsvspace -= number; +else { +WARN_ON_ONCE (1 ); + dquot->dq_dqb.dqb_rsvspace =0 ; + } }static void dquot_decr_inodes (struct dquot *dquot,qsize_t number)
@@ -1287,6 +1305,7 @@ static int info_bdq_free(struct dquot *dreturn QUOTA_NL_BHARDBELOW ;return QUOTA_NL_NOWARN ; } +/* * Initialize quota pointers in inode * We do things in a bit complicated way but by that we avoid calling
@@ -1298,6 +1317,7 @@ int dquot_initialize(struct inode *inodeint cnt, ret =0 ;struct dquot *got[MAXQUOTAS ] = {NULL ,NULL };struct super_block *sb = inode->i_sb; +qsize_t rsv;/* First test before acquiring mutex - solves deadlocks when we * re-enter the quota code and are already holding the mutex */
@@ -1332,6 +1352,13 @@ int dquot_initialize(struct inode *inodeif (!inode->i_dquot[cnt]) { inode->i_dquot[cnt] = got[cnt]; got[cnt] =NULL ; +/* +* Make quota reservation system happy if someone +* did a write before quota was turned on +*/ + rsv =inode_get_rsv_space (inode); +if (unlikely (rsv)) +dquot_resv_space (inode->i_dquot[cnt], rsv); } } out_err:
PATCH 108/116 ahci: use BIOS date in broken_suspend list
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 9deb343189b3cf45e84dd08480f330575ffe2004 upstream.
HP is recycling both DMI_PRODUCT_NAME and DMI_BIOS_VERSION making ahci_broken_suspend() trigger for later products which are not affected by the original problems. Match BIOS date instead of version and add references to bko's so that full information can be found easier later.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=15462
--- drivers/ata/ahci.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/ata/ahci.c +20 -8
@@ -2831,6 +2831,14 @@ static bool ahci_broken_suspend(struct p* On HP dv[4-6] and HDX18 with earlier BIOSen, link * to the harddisk doesn't become online after * resuming from STR. Warn and fail suspend. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=12276 +* +* Use dates instead of versions to match as HP is +* apparently recycling both product and version +* strings. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=15462 */ { .ident = "dv4",
@@ -2839,7 +2847,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv4 Notebook PC"), }, - .driver_data ="F.30" ,/* cutoff BIOS version */ + .driver_data ="20090105" ,/* F.30 */ }, { .ident = "dv5",
@@ -2848,7 +2856,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv5 Notebook PC"), }, - .driver_data ="F.16" ,/* cutoff BIOS version */ + .driver_data ="20090506" ,/* F.16 */ }, { .ident = "dv6",
@@ -2857,7 +2865,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP Pavilion dv6 Notebook PC"), }, - .driver_data ="F.21" ,/* cutoff BIOS version */ + .driver_data ="20090423" ,/* F.21 */ }, { .ident = "HDX18",
@@ -2866,7 +2874,7 @@ static bool ahci_broken_suspend(struct pDMI_MATCH (DMI_PRODUCT_NAME , "HP HDX18 Notebook PC"), }, - .driver_data = "F.23", /* cutoff BIOS version */ + .driver_data = "20090430", /* F.23 */ },/* * Acer eMachines G725 has the same problem. BIOS
@@ -2874,6 +2882,8 @@ static bool ahci_broken_suspend(struct p* work. Inbetween, there are V1.06, V2.06 and V3.03 * that we don't have much idea about. For now, * blacklist anything older than V3.04. +* +* http://bugzilla.kernel.org/show_bug.cgi?id=15104 */ { .ident = "G725",
@@ -2881,19 +2891,21 @@ static bool ahci_broken_suspend(struct p DMI_MATCH(DMI_SYS_VENDOR, "eMachines"), DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"), }, - .driver_data = "V3.04", /* cutoff BIOS version */ + .driver_data = "20091216", /* V3.04 */ }, { }/* terminate list */ };const struct dmi_system_id *dmi =dmi_first_match (sysids); -const char *ver; +int year, month, date; +char buf[9 ];if (!dmi || pdev->bus->number || pdev->devfn !=PCI_DEVFN (0x1f ,2 ))return false; - ver =dmi_get_system_info (DMI_BIOS_VERSION ); +dmi_get_date (DMI_BIOS_DATE , &year, &month, &date); +snprintf (buf,sizeof (buf),"%04d%02d%02d" , year, month, date); -return !ver ||strcmp (ver, dmi->driver_data) <0 ; +return strcmp (buf, dmi->driver_data) <0 ; }static bool ahci_broken_online (struct pci_dev *pdev)
PATCH 109/116 Bluetooth: Fix potential bad memory access with sysfs files
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcel Holtmann <[email protected]>
commit 101545f6fef4a0a3ea8daf0b5b880df2c6a92a69 upstream.
When creating a high number of Bluetooth sockets (L2CAP, SCO and RFCOMM) it is possible to scribble repeatedly on arbitrary pages of memory. Ensure that the content of these sysfs files is always less than one page. Even if this means truncating. The files in question are scheduled to be moved over to debugfs in the future anyway.
Based on initial patches from Neil Brown and Linus Torvalds
--- net/bluetooth/l2cap.c | 10 +++++++++- net/bluetooth/rfcomm/core.c | 13 ++++++++++++- net/bluetooth/rfcomm/sock.c | 11 ++++++++++- net/bluetooth/sco.c | 11 ++++++++++- 4 files changed, 41 insertions(+), 4 deletions(-)
net/bluetooth/l2cap.c +9 -1
@@ -3885,16 +3885,24 @@ static ssize_t l2cap_sysfs_show(struct cstruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&l2cap_sk_list.lock);sk_for_each (sk, node, &l2cap_sk_list.head) {struct l2cap_pinfo *pi =l2cap_pi (sk); +int len; - str +=sprintf (str,"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n" , + len =snprintf (str, size,"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state,__le16_to_cpu (pi->psm), pi->scid, pi->dcid, pi->imtu, pi->omtu, pi->sec_level); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&l2cap_sk_list.lock);
net/bluetooth/rfcomm/core.c +12 -1
@@ -2096,6 +2096,7 @@ static ssize_t rfcomm_dlc_sysfs_show(strstruct rfcomm_session *s;struct list_head *pp, *p;char *str = buf; +int size =PAGE_SIZE ;rfcomm_lock ();
@@ -2104,11 +2105,21 @@ static ssize_t rfcomm_dlc_sysfs_show(strlist_for_each (pp, &s->dlcs) {struct sock *sk = s->sock->sk; struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); +int len; - str +=sprintf (str,"%s %s %ld %d %d %d %d\n" , + len =snprintf (str, size,"%s %s %ld %d %d %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits); + + size -= len; +if (size <=0 ) +break ; + + str += len; } + +if (size <=0 ) +break ; }rfcomm_unlock ();
net/bluetooth/rfcomm/sock.c +10 -1
@@ -1065,13 +1065,22 @@ static ssize_t rfcomm_sock_sysfs_show(ststruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&rfcomm_sk_list.lock);sk_for_each (sk, node, &rfcomm_sk_list.head) { - str +=sprintf (str,"%s %s %d %d\n" , +int len; + + len =snprintf (str, size,"%s %s %d %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state,rfcomm_pi (sk)->channel); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&rfcomm_sk_list.lock);
net/bluetooth/sco.c +10 -1
@@ -957,13 +957,22 @@ static ssize_t sco_sysfs_show(struct clastruct sock *sk;struct hlist_node *node;char *str = buf; +int size =PAGE_SIZE ;read_lock_bh (&sco_sk_list.lock);sk_for_each (sk, node, &sco_sk_list.head) { - str +=sprintf (str,"%s %s %d\n" , +int len; + + len =snprintf (str, size,"%s %s %d\n" ,batostr (&bt_sk (sk)->src),batostr (&bt_sk (sk)->dst), sk->sk_state); + + size -= len; +if (size <=0 ) +break ; + + str += len; }read_unlock_bh (&sco_sk_list.lock);
PATCH 110/116 Bluetooth: Fix kernel crash on L2CAP stress tests
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrei Emeltchenko <[email protected]>
commit c2c77ec83bdad17fb688557b5b3fdc36661dd1c6 upstream.
Added very simple check that req buffer has enough space to fit configuration parameters. Shall be enough to reject packets with configuration size more than req buffer.
Crash trace below
[ 6069.659393] Unable to handle kernel paging request at virtual address 02000205 [ 6069.673034] Internal error: Oops: 805 [#1] PREEMPT ... [ 6069.727172] PC is at l2cap_add_conf_opt+0x70/0xf0 [l2cap] [ 6069.732604] LR is at l2cap_recv_frame+0x1350/0x2e78 [l2cap] ... [ 6070.030303] Backtrace: [ 6070.032806] [<bf1c2880>] (l2cap_add_conf_opt+0x0/0xf0 [l2cap]) from [<bf1c6624>] (l2cap_recv_frame+0x1350/0x2e78 [l2cap]) [ 6070.043823] r8:dc5d3100 r7:df2a91d6 r6:00000001 r5:df2a8000 r4:00000200 [ 6070.050659] [<bf1c52d4>] (l2cap_recv_frame+0x0/0x2e78 [l2cap]) from [<bf1c8408>] (l2cap_recv_acldata+0x2bc/0x350 [l2cap]) [ 6070.061798] [<bf1c814c>] (l2cap_recv_acldata+0x0/0x350 [l2cap]) from [<bf0037a4>] (hci_rx_task+0x244/0x478 [bluetooth]) [ 6070.072631] r6:dc647700 r5:00000001 r4:df2ab740 [ 6070.077362] [<bf003560>] (hci_rx_task+0x0/0x478 [bluetooth]) from [<c006b9fc>] (tasklet_action+0x78/0xd8) [ 6070.087005] [<c006b984>] (tasklet_action+0x0/0xd8) from [<c006c160>]
--- net/bluetooth/l2cap.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bluetooth/l2cap.c +5 -0
@@ -2813,6 +2813,11 @@ static inline int l2cap_config_rsp(strucint len = cmd->len -sizeof (*rsp);char req[64 ]; +if (len >sizeof (req) -sizeof (struct l2cap_conf_req )) { +l2cap_send_disconn_req (conn, sk); + goto done; + } +/* throw out any old stored conf requests */ result =L2CAP_CONF_SUCCESS ; len = l2cap_parse_conf_rsp(sk, rsp->data,
PATCH 111/116 sh: Fix zImage boot using fixed PMB.
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
commit 319c2cc761505ee54a9536c5d0b9c2ee3fb33866 upstream.
--- arch/sh/boot/compressed/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/boot/compressed/misc.c +1 -1
@@ -132,7 +132,7 @@ void decompress_kernel(void) output_addr = (CONFIG_MEMORY_START +0x2000 );#else output_addr =PHYSADDR ((unsigned long )&_text+PAGE_SIZE ); -#ifdef CONFIG_29BIT +#if defined(CONFIG_29BIT ) || defined(CONFIG_PMB_FIXED ) output_addr |=P2SEG ;#endif #endif
PATCH 112/116 b43: Workaround circular locking in hw-tkip key update callback
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Buesch <[email protected]>
commit 96869a39399269a776a94812e9fff3d38b47d838 upstream
The TKIP key update callback is called from the RX path, where the driver mutex is already locked. This results in a circular locking bug. Avoid this by removing the lock.
Johannes noted that there is a separate bug: The callback still breaks on SDIO hardware, because SDIO hardware access needs to sleep, but we are not allowed to sleep in the callback due to mac80211's RCU locking.
--- drivers/net/wireless/b43/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/b43/main.c +4 -7
@@ -852,19 +852,16 @@ static void b43_op_update_tkip_key(strucif (B43_WARN_ON (!modparam_hwtkip))return ; -mutex_lock (&wl->mutex); - +/* This is only called from the RX path through mac80211, where +* our mutex is already locked. */ +B43_WARN_ON (!mutex_is_locked (&wl->mutex)); dev = wl->current_dev; -if (!dev ||b43_status (dev) <B43_STAT_INITIALIZED ) - goto out_unlock; +B43_WARN_ON (!dev ||b43_status (dev) <B43_STAT_INITIALIZED );keymac_write (dev, index,NULL );/* First zero out mac to avoid race */ rx_tkip_phase1_write (dev, index, iv32, phase1key);keymac_write (dev, index, addr); - -out_unlock: -mutex_unlock (&wl->mutex); } static void do_key_write(struct b43_wldev *dev,
PATCH 113/116 block: Backport of various I/O topology fixes from 2.6.33 and 2.6.34
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
block: Backport of various I/O topology fixes from 2.6.33 and 2.6.34
The stacking code incorrectly scaled up the data offset in some cases causing misaligned devices to report alignment. Rewrite the stacking algorithm to remedy this.
(Upstream commit 9504e0864b58b4a304820dcf3755f1da80d5e72f)
The top device misalignment flag would not be set if the added bottom device was already misaligned as opposed to causing a stacking failure.
Also massage the reporting so that an error is only returned if adding the bottom device caused the misalignment. I.e. don't return an error if the top is already flagged as misaligned.
(Upstream commit fe0b393f2c0a0d23a9bc9ed7dc51a1ee511098bd)
lcm() was defined to take integer-sized arguments. The supplied arguments are multiplied, however, causing us to overflow given sufficiently large input. That in turn led to incorrect optimal I/O size reporting in some cases. Switch lcm() over to unsigned long similar to gcd() and move the function from blk-settings.c to lib.
--- block/blk-settings.c | 93 +++++++++++++++++++++++++++++++++++++-------------- include/linux/lcm.h | 8 ++++ lib/Makefile | 2 - lib/lcm.c | 15 ++++++++ 4 files changed, 92 insertions(+), 26 deletions(-)
block/blk-settings.c +68 -25
@@ -8,6 +8,7 @@#include <linux/blkdev.h> #include <linux/bootmem.h> /* for max_pfn/max_low_pfn */ #include <linux/gcd.h> +#include <linux/lcm.h> #include "blk.h"
@@ -490,18 +491,31 @@ EXPORT_SYMBOL(blk_queue_stack_limits);/** * blk_stack_limits - adjust queue_limits for stacked devices -* @t: the stacking driver limits (top) -* @b: the underlying queue limits (bottom) +* @t: the stacking driver limits (top device) +* @b: the underlying queue limits (bottom, component device) * @offset: offset to beginning of data within component device * * Description: -* Merges two queue_limit structs. Returns 0 if alignment didn't -* change. Returns -1 if adding the bottom device caused -* misalignment. +* This function is used by stacking drivers like MD and DM to ensure +* that all component devices have compatible block sizes and +* alignments. The stacking driver must provide a queue_limits +* struct (top) and then iteratively call the stacking function for +* all component (bottom) devices. The stacking function will +* attempt to combine the values and ensure proper alignment. +* +* Returns 0 if the top and bottom queue_limits are compatible. The +* top device's block sizes and alignment offsets may be adjusted to +* ensure alignment with the bottom device. If no compatible sizes +* and alignments exist, -1 is returned and the resulting top +* queue_limits will have the misaligned flag set to indicate that +* the alignment_offset is undefined. */ int blk_stack_limits (struct queue_limits *t,struct queue_limits *b,sector_t offset) { +sector_t alignment; +unsigned int top, bottom, ret =0 ; + t->max_sectors =min_not_zero (t->max_sectors, b->max_sectors); t->max_hw_sectors =min_not_zero (t->max_hw_sectors, b->max_hw_sectors); t->bounce_pfn =min_not_zero (t->bounce_pfn, b->bounce_pfn);
@@ -518,6 +532,26 @@ int blk_stack_limits(struct queue_limits t->max_segment_size =min_not_zero (t->max_segment_size, b->max_segment_size); + t->misaligned |= b->misaligned; + + alignment =queue_limit_alignment_offset (b, offset); + +/* Bottom device has different alignment. Check that it is +* compatible with the current top alignment. +*/ +if (t->alignment_offset != alignment) { + + top =max (t->physical_block_size, t->io_min) + + t->alignment_offset; + bottom =max (b->physical_block_size, b->io_min) + alignment; + +/* Verify that top and bottom intervals line up */ +if (max (top, bottom) & (min (top, bottom) -1 )) { + t->misaligned =1 ; + ret =-1 ; + } + } + t->logical_block_size =max (t->logical_block_size, b->logical_block_size);
@@ -525,37 +559,46 @@ int blk_stack_limits(struct queue_limits b->physical_block_size); t->io_min =max (t->io_min, b->io_min); + t->io_opt =lcm (t->io_opt, b->io_opt); + t->no_cluster |= b->no_cluster; -/* Bottom device offset aligned? */ -if (offset && - (offset & (b->physical_block_size -1 )) != b->alignment_offset) { +/* Physical block size a multiple of the logical block size? */ +if (t->physical_block_size & (t->logical_block_size -1 )) { + t->physical_block_size = t->logical_block_size; t->misaligned =1 ; -return -1 ; + ret =-1 ; } -/* If top has no alignment offset, inherit from bottom */ -if (!t->alignment_offset) - t->alignment_offset = - b->alignment_offset & (b->physical_block_size -1 ); +/* Minimum I/O a multiple of the physical block size? */ +if (t->io_min & (t->physical_block_size -1 )) { + t->io_min = t->physical_block_size; + t->misaligned =1 ; + ret =-1 ; + } -/* Top device aligned on logical block boundary? */ -if (t->alignment_offset & (t->logical_block_size -1 )) { +/* Optimal I/O a multiple of the physical block size? */ +if (t->io_opt & (t->physical_block_size -1 )) { + t->io_opt =0 ; t->misaligned =1 ; -return -1 ; + ret =-1 ; } -/* Find lcm() of optimal I/O size */ -if (t->io_opt && b->io_opt) - t->io_opt = (t->io_opt * b->io_opt) /gcd (t->io_opt, b->io_opt); -else if (b->io_opt) - t->io_opt = b->io_opt; +/* Find lowest common alignment_offset */ + t->alignment_offset =lcm (t->alignment_offset, alignment) + & (max (t->physical_block_size, t->io_min) -1 ); + +/* Verify that new alignment_offset is on a logical block boundary */ +if (t->alignment_offset & (t->logical_block_size -1 )) { + t->misaligned =1 ; + ret =-1 ; + } -/* Verify that optimal I/O size is a multiple of io_min */ -if (t->io_min && t->io_opt % t->io_min) -return -1 ; +/* Discard */ + t->max_discard_sectors =min_not_zero (t->max_discard_sectors, + b->max_discard_sectors); -return 0 ; +return ret; }EXPORT_SYMBOL (blk_stack_limits);
include/linux/lcm.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _LCM_H +#define _LCM_H + +#include <linux/compiler.h> + +unsigned long lcm(unsigned long a, unsigned long b) __attribute_const__; + +#endif /* _LCM_H */
lib/Makefile +1 -1
@@ -21,7 +21,7 @@ lib-y += kobject.o kref.o klist.o obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ - string_helpers.o gcd.o + string_helpers.o gcd.o lcm.o ifeq ($(CONFIG_DEBUG_KOBJECT),y) CFLAGS_kobject.o += -DDEBUG
lib/lcm.c new file +15 -0
@@ -0,0 +1,15 @@ +#include <linux/kernel.h> +#include <linux/gcd.h> +#include <linux/module.h> + +/* Lowest common multiple */ +unsigned long lcm (unsigned long a,unsigned long b) +{ +if (a && b) +return (a * b) /gcd (a, b); +else if (b) +return b; + +return a; +} +EXPORT_SYMBOL_GPL (lcm);
PATCH 114/116 s3cmci: initialize default platform data no_wprotect and no_detect with 1
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
commit c212808a1ba6bfba489006399b8152a047305acf upstream.
If no platform_data was givin to the device it's going to use it's default platform data struct which has all fields initialized to zero. As a result the driver is going to try to request gpio0 both as write protect and card detect pin. Which of course will fail and makes the driver unusable
Previously to the introduction of no_wprotect and no_detect the behavior was to assume that if no platform data was given there is no write protect or card detect pin. This patch restores that behavior.
--- drivers/mmc/host/s3cmci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/host/s3cmci.c +2 -0
@@ -1361,6 +1361,8 @@ static struct mmc_host_ops s3cmci_ops =static struct s3c24xx_mci_pdata s3cmci_def_pdata = {/* This is currently here to avoid a number of if (host->pdata) * checks. Any zero fields to ensure reaonable defaults are picked. */ + .no_wprotect =1 , + .no_detect =1 , };#ifdef CONFIG_CPU_FREQ
PATCH 115/116 x86: Fix sched_clock_cpu for systems with unsynchronized TSC
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dimitri Sivanich <[email protected]>
commit 14be1f7454ea96ee614467a49cf018a1a383b189 upstream.
On UV systems, the TSC is not synchronized across blades. The sched_clock_cpu() function is returning values that can go backwards (I've seen as much as 8 seconds) when switching between cpus.
As each cpu comes up, early_init_intel() will currently set the sched_clock_stable flag true. When mark_tsc_unstable() runs, it clears the flag, but this only occurs once (the first time a cpu comes up whose TSC is not synchronized with cpu 0). After this, early_init_intel() will set the flag again as the next cpu comes up.
Only set sched_clock_stable if tsc has not been marked unstable.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/intel.c +2 -1
@@ -70,7 +70,8 @@ static void __cpuinit early_init_intel(sif (c->x86_power & (1 <<8 )) {set_cpu_cap (c,X86_FEATURE_CONSTANT_TSC );set_cpu_cap (c,X86_FEATURE_NONSTOP_TSC ); - sched_clock_stable =1 ; +if (!check_tsc_unstable ()) + sched_clock_stable =1 ; }/*
PATCH 116/116 GFS2: Skip check for mandatory locks when unlocking
In reply to Greg KH2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sachin Prabhu <[email protected]>
commit 720e7749279bde0d08684b1bb4e7a2eedeec6394 upstream.
gfs2_lock() will skip locks on file which have mode set to 02666. This is a problem in cases where the mode of the file is changed after a process has obtained a lock on the file. Such a lock will be skipped and will result in a BUG in locks_remove_flock().
gfs2_lock() should skip the check for mandatory locks when unlocking a file.
--- fs/gfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/file.c +1 -1
@@ -606,7 +606,7 @@ static int gfs2_lock(struct file *file,if (!(fl->fl_flags &FL_POSIX ))return -ENOLCK ; -if (__mandatory_lock (&ip->i_inode)) +if (__mandatory_lock (&ip->i_inode) && fl->fl_type !=F_UNLCK )return -ENOLCK ;if (cmd ==F_CANCELLK ) {
cover 2.6.31.13-stable review
In reply to Greg KHThis is the start of the stable review cycle for the 2.6.31.13 release. There are 89 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by April 1, 2010, 22:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.31.13-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/filesystems/tmpfs.txt | 6 +- Makefile | 2 +- arch/powerpc/include/asm/elf.h | 8 +- arch/powerpc/include/asm/thread_info.h | 2 - arch/powerpc/kernel/process.c | 12 -- arch/sh/kernel/process_64.c | 2 +- arch/sparc/include/asm/elf_64.h | 13 +-- arch/sparc/include/asm/thread_info_64.h | 4 +- arch/sparc/kernel/process_64.c | 8 - arch/x86/ia32/ia32_aout.c | 12 +- arch/x86/include/asm/elf.h | 10 +- arch/x86/include/asm/fixmap.h | 6 +- arch/x86/include/asm/io_apic.h | 1 + arch/x86/include/asm/kvm_x86_emulate.h | 2 +- arch/x86/include/asm/thread_info.h | 2 - arch/x86/kernel/acpi/boot.c | 9 +- arch/x86/kernel/apic/apic_flat_64.c | 5 + arch/x86/kernel/apic/io_apic.c | 50 ++++++ arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 +- arch/x86/kernel/microcode_core.c | 4 +- arch/x86/kernel/process.c | 12 -- arch/x86/kernel/process_64.c | 11 ++ arch/x86/kvm/x86_emulate.c | 5 +- arch/x86/pci/i386.c | 9 + drivers/acpi/processor_idle.c | 28 ++-- drivers/base/class.c | 2 + drivers/block/cciss.c | 3 + drivers/char/agp/backend.c | 4 +- drivers/char/nozomi.c | 2 +- drivers/char/tty_io.c | 2 + drivers/connector/connector.c | 175 -------------------- drivers/edac/i5000_edac.c | 8 +- drivers/gpu/drm/r128/r128_cce.c | 18 ++- drivers/gpu/drm/r128/r128_drv.h | 8 + drivers/gpu/drm/r128/r128_state.c | 36 +++-- drivers/hid/hid-apple.c | 7 + drivers/hid/hid-core.c | 3 + drivers/hid/hid-ids.h | 3 + drivers/hwmon/adt7462.c | 2 +- drivers/hwmon/coretemp.c | 2 +- drivers/hwmon/fschmd.c | 7 +- drivers/hwmon/lm78.c | 25 ++-- drivers/hwmon/w83781d.c | 26 ++-- drivers/i2c/busses/i2c-pca-isa.c | 4 +- drivers/i2c/busses/i2c-pca-platform.c | 4 +- drivers/i2c/busses/i2c-tiny-usb.c | 12 +- drivers/i2c/i2c-core.c | 5 +- drivers/input/mouse/alps.c | 252 ++++++++++++++++++++++++++--- drivers/input/mouse/alps.h | 1 + drivers/media/dvb/dvb-usb/af9015.c | 4 +- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 + drivers/media/video/em28xx/em28xx-dvb.c | 1 + drivers/media/video/pwc/pwc-ctrl.c | 2 +- drivers/media/video/uvc/uvc_driver.c | 3 + drivers/media/video/uvc/uvc_video.c | 4 +- drivers/media/video/uvc/uvcvideo.h | 3 +- drivers/misc/enclosure.c | 1 + drivers/mtd/ubi/cdev.c | 1 - drivers/net/sfc/tx.c | 4 +- drivers/net/wireless/airo.c | 34 ++-- drivers/net/wireless/ath/ath5k/eeprom.c | 32 ++++- drivers/net/wireless/ath/ath5k/eeprom.h | 8 + drivers/net/wireless/b43/b43.h | 1 + drivers/net/wireless/b43/main.c | 13 ++- drivers/parisc/ccio-dma.c | 4 +- drivers/parisc/sba_iommu.c | 4 +- drivers/rtc/rtc-fm3130.c | 6 +- drivers/scsi/megaraid/megaraid_sas.c | 2 +- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 17 ++ drivers/serial/8250.c | 7 +- drivers/serial/8250_pnp.c | 10 +- drivers/usb/core/devices.c | 2 +- drivers/usb/core/devio.c | 61 +++++--- drivers/usb/core/hub.c | 3 + drivers/usb/core/message.c | 8 +- drivers/usb/core/sysfs.c | 6 + drivers/usb/host/ehci-hcd.c | 5 +- drivers/usb/host/ehci-hub.c | 20 +++- drivers/usb/host/ehci-q.c | 11 +- drivers/usb/host/uhci-hcd.c | 15 ++- drivers/usb/host/uhci-hub.c | 2 +- drivers/usb/serial/generic.c | 2 + drivers/usb/storage/unusual_devs.h | 7 - drivers/usb/storage/usb.c | 3 +- drivers/xen/balloon.c | 4 - fs/binfmt_aout.c | 1 + fs/binfmt_elf.c | 27 +--- fs/binfmt_elf_fdpic.c | 3 + fs/binfmt_flat.c | 1 + fs/binfmt_som.c | 1 + fs/cifs/readdir.c | 1 + fs/ecryptfs/crypto.c | 4 +- fs/ecryptfs/file.c | 14 +- fs/exec.c | 39 +++-- fs/namei.c | 14 ++- fs/nfs/fscache.c | 21 ++-- fs/notify/dnotify/dnotify.c | 3 +- fs/notify/inotify/inotify_fsnotify.c | 2 +- fs/notify/inotify/inotify_user.c | 4 +- fs/notify/notification.c | 2 +- fs/ntfs/malloc.h | 2 +- fs/partitions/efi.c | 30 +++-- fs/partitions/efi.h | 8 +- fs/reiserfs/inode.c | 17 ++- include/linux/binfmts.h | 1 + include/linux/connector.h | 32 ---- include/linux/enclosure.h | 2 + include/linux/mm.h | 1 + include/linux/sched.h | 24 +++- init/main.c | 4 +- ipc/msg.c | 1 + ipc/sem.c | 1 + ipc/shm.c | 1 + kernel/futex.c | 30 +++- kernel/time/clockevents.c | 5 +- mm/mempolicy.c | 40 +++-- mm/migrate.c | 3 + mm/page_alloc.c | 2 +- mm/slab.c | 2 +- mm/swap.c | 2 +- mm/vmalloc.c | 8 +- net/core/sock.c | 4 +- net/dccp/proto.c | 6 +- net/decnet/dn_route.c | 2 +- net/ipv4/route.c | 2 +- net/ipv4/tcp.c | 4 +- net/netfilter/nf_conntrack_core.c | 4 +- net/netfilter/x_tables.c | 2 +- net/netfilter/xt_hashlimit.c | 8 +- net/netlink/af_netlink.c | 6 +- net/sctp/protocol.c | 6 +- security/selinux/hooks.c | 2 +- sound/pci/hda/hda_intel.c | 6 + sound/usb/usbaudio.c | 2 +- 134 files changed, 931 insertions(+), 624 deletions(-)
PATCH 1/89 Fix potential crash with sys_move_pages
2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 6f5a55f1a6c5abee15a0e878e5c74d9f1569b8b0 upstream.
We incorrectly depended on the 'node_state/node_isset()' functions testing the node range, rather than checking it explicitly. That's not reliable, even if it might often happen to work. So do the proper explicit test.
--- mm/migrate.c | 3 +++ 1 file changed, 3 insertions(+)
mm/migrate.c +3 -0
@@ -937,6 +937,9 @@ static int do_pages_move(struct mm_struc goto out_pm; err = -ENODEV ; +if (node <0 || node >=MAX_NUMNODES ) + goto out_pm; +if (!node_state (node,N_HIGH_MEMORY )) goto out_pm;
PATCH 2/89 futex: Handle futex value corruption gracefully
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 59647b6ac3050dd964bc556fe6ef22f4db5b935c upstream.
The WARN_ON in lookup_pi_state which complains about a mismatch between pi_state->owner->pid and the pid which we retrieved from the user space futex is completely bogus.
The code just emits the warning and then continues despite the fact that it detected an inconsistent state of the futex. A conveniant way for user space to spam the syslog.
Replace the WARN_ON by a consistency check. If the values do not match return -EINVAL and let user space deal with the mess it created.
This also fixes the missing task_pid_vnr() when we compare the pi_state->owner pid with the futex value.
--- kernel/futex.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
kernel/futex.c +19 -2
@@ -531,8 +531,25 @@ lookup_pi_state(u32 uval, struct futex_hreturn -EINVAL ;WARN_ON (!atomic_read (&pi_state->refcount)); -WARN_ON (pid && pi_state->owner && - pi_state->owner->pid != pid); + +/* +* When pi_state->owner is NULL then the owner died +* and another waiter is on the fly. pi_state->owner +* is fixed up by the task which acquires +* pi_state->rt_mutex. +* +* We do not check for pid == 0 which can happen when +* the owner died and robust_list_exit() cleared the +* TID. +*/ +if (pid && pi_state->owner) { +/* +* Bail out if user space manipulated the +* futex value. +*/ +if (pid !=task_pid_vnr (pi_state->owner)) +return -EINVAL ; + }atomic_inc (&pi_state->refcount); *ps = pi_state;
PATCH 3/89 futex: Handle user space corruption gracefully
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Gleixner <[email protected]>
commit 51246bfd189064079c54421507236fd2723b18f3 upstream.
If the owner of a PI futex dies we fix up the pi_state and set pi_state->owner to NULL. When a malicious or just sloppy programmed user space application sets the futex value to 0 e.g. by calling pthread_mutex_init(), then the futex can be acquired again. A new waiter manages to enqueue itself on the pi_state w/o damage, but on unlock the kernel dereferences pi_state->owner and oopses.
Prevent this by checking pi_state->owner in the unlock path. If pi_state->owner is not current we know that user space manipulated the futex value. Ignore the mess and return -EINVAL.
This catches the above case and also the case where a task hijacks the futex by setting the tid value and then tries to unlock it.
--- kernel/futex.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/futex.c +7 -0
@@ -776,6 +776,13 @@ static int wake_futex_pi(u32 __user *uadif (!pi_state)return -EINVAL ; +/* +* If current does not own the pi_state then the futex is +* inconsistent and user space fiddled with the futex value. +*/ +if (pi_state->owner != current) +return -EINVAL ; +spin_lock (&pi_state->pi_mutex.wait_lock); new_owner =rt_mutex_next_owner (&pi_state->pi_mutex);
PATCH 4/89 futex_lock_pi() key refcnt fix
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mikael Pettersson <[email protected]>
commit 5ecb01cfdf96c5f465192bdb2a4fd4a61a24c6cc upstream.
This fixes a futex key reference count bug in futex_lock_pi(), where a key's reference count is incremented twice but decremented only once, causing the backing object to not be released.
If the futex is created in a temporary file in an ext3 file system, this bug causes the file's inode to become an "undead" orphan, which causes an oops from a BUG_ON() in ext3_put_super() when the file system is unmounted. glibc's test suite is known to trigger this, see <http://bugzilla.kernel.org/show_bug.cgi?id=14256>.
The bug is a regression from 2.6.28-git3, namely Peter Zijlstra's 38d47c1b7075bd7ec3881141bb3629da58f88dab "[PATCH] futex: rely on get_user_pages() for shared futexes". That commit made get_futex_key() also increment the reference count of the futex key, and updated its callers to decrement the key's reference count before returning. Unfortunately the normal exit path in futex_lock_pi() wasn't corrected:
the reference count is incremented by get_futex_key() and queue_lock(), but the normal exit path only decrements once, via unqueue_me_pi(). The fix is to put_futex_key() after unqueue_me_pi(), since 2.6.31 this is easily done by 'goto out_put_key' rather than 'goto out'.
--- kernel/futex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/futex.c +1 -1
@@ -1974,7 +1974,7 @@ retry_private:/* Unqueue and drop the lock */ unqueue_me_pi (&q); - goto out; + goto out_put_key; out_unlock_put_key:queue_unlock (&q, hb);
PATCH 5/89 SECURITY: selinux, fix update_rlimit_cpu parameter
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 17740d89785aeb4143770923d67c293849414710 upstream.
Don't pass current RLIMIT_RTTIME to update_rlimit_cpu() in selinux_bprm_committing_creds, since update_rlimit_cpu expects RLIMIT_CPU limit.
Use proper rlim[RLIMIT_CPU].rlim_cur instead to fix that.
--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/hooks.c +1 -1
@@ -2360,7 +2360,7 @@ static void selinux_bprm_committing_cred initrlim = init_task.signal->rlim + i; rlim->rlim_cur =min (rlim->rlim_max, initrlim->rlim_cur); } -update_rlimit_cpu (rlim->rlim_cur); +update_rlimit_cpu (current->signal->rlim[RLIMIT_CPU ].rlim_cur); } }
PATCH 6/89 UBI: fix volume creation input checking
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mika Westerberg <[email protected]>
commit c5ce5b46af76f52dea21f467397d24c4ae6cb3ff upstream.
Do not use an unchecked variable UBI_IOCMKVOL ioctl.
--- drivers/mtd/ubi/cdev.c | 1 - 1 file changed, 1 deletion(-)
drivers/mtd/ubi/cdev.c +0 -1
@@ -853,7 +853,6 @@ static long ubi_cdev_ioctl(struct file *break ; } - req.name[req.name_len] ='\0' ; err =verify_mkvol_req (ubi, &req);if (err)break ;
PATCH 7/89 cciss: Make cciss_seq_show handle holes in the h->drv[] array
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stephen M. Cameron <[email protected]>
commit 531c2dc70d339c5dfa8c3eb628c3459dc6f3a075 upstream.
It is possible (and expected) for there to be holes in the h->drv[] array, that is, some elements may be NULL pointers. cciss_seq_show needs to be made aware of this possibility to avoid an Oops.
To reproduce the Oops which this fixes:
1) Create two "arrays" in the Array Configuratino Utility and several logical drives on each array.
2) cat /proc/driver/cciss/cciss* in an infinite loop
3) delete some of the logical drives in the first "array."
--- drivers/block/cciss.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/block/cciss.c +3 -0
@@ -323,6 +323,9 @@ static int cciss_seq_show(struct seq_filif (*pos > h->highest_lun)return 0 ; +if (drv ==NULL )/* it's possible for h->drv[] to have holes. */ +return 0 ; +if (drv->heads ==0 )return 0 ;
PATCH 8/89 CPUFREQ: Fix use after free of struct powernow_k8_data
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Renninger <[email protected]>
commit 557a701c16553b0b691dbb64ef30361115a80f64 upstream.
Easy fix for a regression introduced in 2.6.31.
On managed CPUs the cpufreq.c core will call driver->exit(cpu) on the managed cpus and powernow_k8 will free the core's data.
Later driver->get(cpu) function might get called trying to read out the current freq of a managed cpu and the NULL pointer check does not work on the freed object -> better set it to NULL.
->get() is unsigned and must return 0 as invalid frequency.
Reference:
http://bugzilla.kernel.org/show_bug.cgi?id=14391
--- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +2 -1
@@ -1372,6 +1372,7 @@ static int __devexit powernowk8_cpu_exitkfree (data->powernow_table);kfree (data); +per_cpu (powernow_data, pol->cpu) =NULL ;return 0 ; }
@@ -1391,7 +1392,7 @@ static unsigned int powernowk8_get(unsigint err;if (!data) -return -EINVAL ; +return 0 ;smp_call_function_single (cpu, query_values_on_cpu, &err, true);if (err)
PATCH 9/89 resource: add helpers for fetching rlimits
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 3e10e716abf3c71bdb5d86b8f507f9e72236c9cd upstream.
We want to be sure that compiler fetches the limit variable only once, so add helpers for fetching current and maximal resource limits which do that.
Add them to sched.h (instead of resource.h) due to circular dependency
sched.h->resource.h->task_struct
Alternative would be to create a separate res_access.h or similar.
--- include/linux/sched.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
include/linux/sched.h +22 -0
@@ -2485,6 +2485,28 @@ static inline void mm_init_owner(struct#define TASK_STATE_TO_CHAR_STR "RSDTtZX" +static inline unsigned long task_rlimit (const struct task_struct *tsk, +unsigned int limit) +{ +return ACCESS_ONCE (tsk->signal->rlim[limit].rlim_cur); +} + +static inline unsigned long task_rlimit_max (const struct task_struct *tsk, +unsigned int limit) +{ +return ACCESS_ONCE (tsk->signal->rlim[limit].rlim_max); +} + +static inline unsigned long rlimit (unsigned int limit) +{ +return task_rlimit (current, limit); +} + +static inline unsigned long rlimit_max (unsigned int limit) +{ +return task_rlimit_max (current, limit); +} +#endif /* __KERNEL__ */ #endif
PATCH 10/89 rtc-fm3130: add missing braces
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sergey Matyukevich <[email protected]>
commit f4b5162820de60204afa5c8639335f4931b7fb0c upstream.
Add missing braces for multiline 'if' statements in fm3130_probe.
--- drivers/rtc/rtc-fm3130.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/rtc/rtc-fm3130.c +4 -2
@@ -376,20 +376,22 @@ static int __devinit fm3130_probe(struct }/* Disabling calibration mode */ -if (fm3130->regs[FM3130_RTC_CONTROL ] &FM3130_RTC_CONTROL_BIT_CAL ) +if (fm3130->regs[FM3130_RTC_CONTROL ] &FM3130_RTC_CONTROL_BIT_CAL ) {i2c_smbus_write_byte_data (client,FM3130_RTC_CONTROL , fm3130->regs[FM3130_RTC_CONTROL ] & ~(FM3130_RTC_CONTROL_BIT_CAL ));dev_warn (&client->dev,"Disabling calibration mode!\n" ); + }/* Disabling read and write modes */ if (fm3130->regs[FM3130_RTC_CONTROL ] &FM3130_RTC_CONTROL_BIT_WRITE || - fm3130->regs[FM3130_RTC_CONTROL ] &FM3130_RTC_CONTROL_BIT_READ ) + fm3130->regs[FM3130_RTC_CONTROL ] &FM3130_RTC_CONTROL_BIT_READ ) {i2c_smbus_write_byte_data (client,FM3130_RTC_CONTROL , fm3130->regs[FM3130_RTC_CONTROL ] & ~(FM3130_RTC_CONTROL_BIT_READ |FM3130_RTC_CONTROL_BIT_WRITE ));dev_warn (&client->dev,"Disabling READ or WRITE mode!\n" ); + }/* oscillator off? turn it on, so clock can tick. */ if (fm3130->regs[FM3130_CAL_CONTROL ] & FM3130_CAL_CONTROL_BIT_nOSCEN)
PATCH 11/89 ath5k: Fix eeprom checksum check for custom sized eeproms
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 359207c687cc8f4f9845c8dadd0d6dabad44e584 upstream.
Commit 8bf3d79bc401ca417ccf9fc076d3295d1a71dbf5 enabled EEPROM checksum checks to avoid bogus bug reports but failed to address updating the code to consider devices with custom EEPROM sizes. Devices with custom sized EEPROMs have the upper limit size stuffed in the EEPROM. Use this as the upper limit instead of the static default size. In case of a checksum error also provide back the max size and whether or not this was the default size or a custom one. If the EEPROM is busted we add a failsafe check to ensure we don't loop forever or try to read bogus areas of hardware.
This closes bug 14874
http://bugzilla.kernel.org/show_bug.cgi?id=14874
--- drivers/net/wireless/ath/ath5k/eeprom.c | 32 +++++++++++++++++++++++++++++--- drivers/net/wireless/ath/ath5k/eeprom.h | 8 ++++++++ 2 files changed, 37 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath5k/eeprom.c +29 -3
@@ -97,7 +97,7 @@ ath5k_eeprom_init_header(struct ath5k_hwstruct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;int ret;u16 val; -u32 cksum, offset; +u32 cksum, offset, eep_max =AR5K_EEPROM_INFO_MAX ;/* * Read values from EEPROM and store them in the capability structure
@@ -116,12 +116,38 @@ ath5k_eeprom_init_header(struct ath5k_hw* Validate the checksum of the EEPROM date. There are some * devices with invalid EEPROMs. */ -for (cksum =0 , offset =0 ; offset <AR5K_EEPROM_INFO_MAX ; offset++) { +AR5K_EEPROM_READ (AR5K_EEPROM_SIZE_UPPER , val); +if (val) { + eep_max = (val &AR5K_EEPROM_SIZE_UPPER_MASK ) << +AR5K_EEPROM_SIZE_ENDLOC_SHIFT ; +AR5K_EEPROM_READ (AR5K_EEPROM_SIZE_LOWER , val); + eep_max = (eep_max | val) -AR5K_EEPROM_INFO_BASE ; + +/* +* Fail safe check to prevent stupid loops due +* to busted EEPROMs. XXX: This value is likely too +* big still, waiting on a better value. +*/ +if (eep_max > (3 *AR5K_EEPROM_INFO_MAX )) { +ATH5K_ERR (ah->ah_sc,"Invalid max custom EEPROM size: " +"%d (0x%04x) max expected: %d (0x%04x)\n" , + eep_max, eep_max, +3 *AR5K_EEPROM_INFO_MAX , +3 *AR5K_EEPROM_INFO_MAX ); +return -EIO ; + } + } + +for (cksum =0 , offset =0 ; offset < eep_max; offset++) {AR5K_EEPROM_READ (AR5K_EEPROM_INFO (offset), val); cksum ^= val; }if (cksum !=AR5K_EEPROM_INFO_CKSUM ) { -ATH5K_ERR (ah->ah_sc,"Invalid EEPROM checksum 0x%04x\n" , cksum); +ATH5K_ERR (ah->ah_sc,"Invalid EEPROM " +"checksum: 0x%04x eep_max: 0x%04x (%s)\n" , + cksum, eep_max, + eep_max ==AR5K_EEPROM_INFO_MAX ? +"default size" :"custom size" );return -EIO ; }
drivers/net/wireless/ath/ath5k/eeprom.h +8 -0
@@ -34,6 +34,14 @@#define AR5K_EEPROM_RFKILL_POLARITY_S 1#define AR5K_EEPROM_REG_DOMAIN 0x00bf/* EEPROM regdom */ + +/* FLASH(EEPROM) Defines for AR531X chips */ +#define AR5K_EEPROM_SIZE_LOWER 0x1b/* size info -- lower */ +#define AR5K_EEPROM_SIZE_UPPER 0x1c/* size info -- upper */ +#define AR5K_EEPROM_SIZE_UPPER_MASK 0xfff0 +#define AR5K_EEPROM_SIZE_UPPER_SHIFT 4 +#define AR5K_EEPROM_SIZE_ENDLOC_SHIFT 12 +#define AR5K_EEPROM_CHECKSUM 0x00c0/* EEPROM checksum */ #define AR5K_EEPROM_INFO_BASE 0x00c0/* EEPROM header */ #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE)
PATCH 12/89 clockevent: Dont remove broadcast device when cpu is dead
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Xiaotian Feng <[email protected]>
commit ea9d8e3f45404d411c00ae67b45cc35c58265bb7 upstream.
Marc reported that the BUG_ON in clockevents_notify() triggers on his system. This happens because the kernel tries to remove an active clock event device (used for broadcasting) from the device list.
The handling of devices which can be used as per cpu device and as a global broadcast device is suboptimal.
The simplest solution for now (and for stable) is to check whether the device is used as global broadcast device, but this needs to be revisited.
[ tglx: restored the cpuweight check and massaged the changelog ]
LKML-Reference: <[email protected]>
--- kernel/time/clockevents.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/time/clockevents.c +4 -1
@@ -20,6 +20,8 @@#include <linux/sysdev.h> #include <linux/tick.h> +#include "tick-internal.h" +/* The registered clock event devices */ static LIST_HEAD (clockevent_devices);static LIST_HEAD (clockevents_released);
@@ -258,7 +260,8 @@ void clockevents_notify(unsigned long re cpu = *((int *)arg);list_for_each_entry_safe (dev, tmp, &clockevent_devices, list) {if (cpumask_test_cpu (cpu, dev->cpumask) && -cpumask_weight (dev->cpumask) ==1 ) { +cpumask_weight (dev->cpumask) ==1 && + !tick_is_broadcast_device (dev)) {BUG_ON (dev->mode !=CLOCK_EVT_MODE_UNUSED );list_del (&dev->list); }
PATCH 13/89 connector: Delete buggy notification code.
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Evgeniy Polyakov <[email protected]>
commit f98bfbd78c37c5946cc53089da32a5f741efdeb7 upstream.
Quoted 9 lines · Greg KH
Quoted 5 lines
There are at least two ways to fix it: using a big cannon and a small one. The former way is to disable notification registration, since it is not used by anyone at all. Second way is to check whether calling process is root and its destination group is -1 (kind of priveledged one) before command is dispatched to workqueue.
Well if no one is using it, removing it makes the most sense, right?
No objection from me, care to make up a patch either way for this?
Getting it is not used, let's drop support for notifications about (un)registered events from connector.
Another option was to check credentials on receiving, but we can always restore it without bugs if needed, but genetlink has a wider code base and none complained, that userspace can not get notification when some other clients were (un)registered.
Kudos for Sebastian Krahmer <[email protected]>, who found a bug in the code.
--- drivers/connector/connector.c | 175 ------------------------------------------ include/linux/connector.h | 32 ------- 2 files changed, 207 deletions(-)
drivers/connector/connector.c +0 -175
@@ -36,17 +36,6 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR ("Evgeniy Polyakov <[email protected]>" );MODULE_DESCRIPTION ("Generic userspace <-> kernelspace connector." ); -static u32 cn_idx =CN_IDX_CONNECTOR ; -static u32 cn_val =CN_VAL_CONNECTOR ; - -module_param (cn_idx, uint,0 ); -module_param (cn_val, uint,0 ); -MODULE_PARM_DESC (cn_idx,"Connector's main device idx." ); -MODULE_PARM_DESC (cn_val,"Connector's main device val." ); - -static DEFINE_MUTEX (notify_lock); -static LIST_HEAD (notify_list); -static struct cn_dev cdev;static int cn_already_initialized;
@@ -210,54 +199,6 @@ static void cn_rx_skb(struct sk_buff *__ }/* -* Notification routing. -* -* Gets id and checks if there are notification request for it's idx -* and val. If there are such requests notify the listeners with the -* given notify event. -* -*/ -static void cn_notify (struct cb_id *id,u32 notify_event) -{ -struct cn_ctl_entry *ent; - -mutex_lock (¬ify_lock); -list_for_each_entry (ent, ¬ify_list, notify_entry) { -int i; -struct cn_notify_req *req; -struct cn_ctl_msg *ctl = ent->msg; -int idx_found, val_found; - - idx_found = val_found =0 ; - - req = (struct cn_notify_req *)ctl->data; -for (i =0 ; i < ctl->idx_notify_num; ++i, ++req) { -if (id->idx >= req->first && - id->idx < req->first + req->range) { - idx_found =1 ; -break ; - } - } - -for (i =0 ; i < ctl->val_notify_num; ++i, ++req) { -if (id->val >= req->first && - id->val < req->first + req->range) { - val_found =1 ; -break ; - } - } - -if (idx_found && val_found) { -struct cn_msg m = { .ack = notify_event, }; - -memcpy (&m.id, id,sizeof (m.id)); -cn_netlink_send (&m, ctl->group,GFP_KERNEL ); - } - } -mutex_unlock (¬ify_lock); -} - -/* * Callback add routing - adds callback with given ID and name. * If there is registered callback with the same ID it will not be added. *
@@ -276,8 +217,6 @@ int cn_add_callback(struct cb_id *id, chif (err)return err; -cn_notify (id,0 ); -return 0 ; }EXPORT_SYMBOL_GPL (cn_add_callback);
@@ -295,111 +234,9 @@ void cn_del_callback(struct cb_id *id)struct cn_dev *dev = &cdev;cn_queue_del_callback (dev->cbdev, id); -cn_notify (id,1 ); }EXPORT_SYMBOL_GPL (cn_del_callback); -/* -* Checks two connector's control messages to be the same. -* Returns 1 if they are the same or if the first one is corrupted. -*/ -static int cn_ctl_msg_equals (struct cn_ctl_msg *m1,struct cn_ctl_msg *m2) -{ -int i; -struct cn_notify_req *req1, *req2; - -if (m1->idx_notify_num != m2->idx_notify_num) -return 0 ; - -if (m1->val_notify_num != m2->val_notify_num) -return 0 ; - -if (m1->len != m2->len) -return 0 ; - -if ((m1->idx_notify_num + m1->val_notify_num) *sizeof (*req1) != - m1->len) -return 1 ; - - req1 = (struct cn_notify_req *)m1->data; - req2 = (struct cn_notify_req *)m2->data; - -for (i =0 ; i < m1->idx_notify_num; ++i) { -if (req1->first != req2->first || req1->range != req2->range) -return 0 ; - req1++; - req2++; - } - -for (i =0 ; i < m1->val_notify_num; ++i) { -if (req1->first != req2->first || req1->range != req2->range) -return 0 ; - req1++; - req2++; - } - -return 1 ; -} - -/* -* Main connector device's callback. -* -* Used for notification of a request's processing. -*/ -static void cn_callback (struct cn_msg *msg,struct netlink_skb_parms *nsp) -{ -struct cn_ctl_msg *ctl; -struct cn_ctl_entry *ent; -u32 size; - -if (msg->len <sizeof (*ctl)) -return ; - - ctl = (struct cn_ctl_msg *)msg->data; - - size = (sizeof (*ctl) + ((ctl->idx_notify_num + - ctl->val_notify_num) * -sizeof (struct cn_notify_req ))); - -if (msg->len != size) -return ; - -if (ctl->len +sizeof (*ctl) != msg->len) -return ; - -/* -* Remove notification. -*/ -if (ctl->group ==0 ) { -struct cn_ctl_entry *n; - -mutex_lock (¬ify_lock); -list_for_each_entry_safe (ent, n, ¬ify_list, notify_entry) { -if (cn_ctl_msg_equals (ent->msg, ctl)) { -list_del (&ent->notify_entry); -kfree (ent); - } - } -mutex_unlock (¬ify_lock); - -return ; - } - - size +=sizeof (*ent); - - ent =kzalloc (size,GFP_KERNEL ); -if (!ent) -return ; - - ent->msg = (struct cn_ctl_msg *)(ent +1 ); - -memcpy (ent->msg, ctl, size -sizeof (*ent)); - -mutex_lock (¬ify_lock); -list_add (&ent->notify_entry, ¬ify_list); -mutex_unlock (¬ify_lock); -} -static int cn_proc_show (struct seq_file *m,void *v) {struct cn_queue_dev *dev = cdev.cbdev;
@@ -437,11 +274,8 @@ static const struct file_operations cn_fstatic int __devinit cn_init (void ) {struct cn_dev *dev = &cdev; -int err; dev->input = cn_rx_skb; - dev->id.idx = cn_idx; - dev->id.val = cn_val; dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, CN_NETLINK_USERS + 0xf,
@@ -457,14 +291,6 @@ static int __devinit cn_init(void) cn_already_initialized =1 ; - err =cn_add_callback (&dev->id,"connector" , &cn_callback); -if (err) { - cn_already_initialized =0 ; -cn_queue_free_dev (dev->cbdev); -netlink_kernel_release (dev->nls); -return -EINVAL ; - } -proc_net_fops_create (&init_net,"connector" ,S_IRUGO , &cn_file_ops);return 0 ;
@@ -478,7 +304,6 @@ static void __devexit cn_fini(void)proc_net_remove (&init_net,"connector" ); -cn_del_callback (&dev->id);cn_queue_free_dev (dev->cbdev);netlink_kernel_release (dev->nls); }
include/linux/connector.h +0 -32
@@ -24,9 +24,6 @@#include <linux/types.h> -#define CN_IDX_CONNECTOR 0xffffffff -#define CN_VAL_CONNECTOR 0xffffffff -/* * Process Events connector unique ids -- used for message routing */
@@ -73,30 +70,6 @@ struct cn_msg {__u8 data[0 ]; }; -/* -* Notify structure - requests notification about -* registering/unregistering idx/val in range [first, first+range]. -*/ -struct cn_notify_req { -__u32 first; -__u32 range; -}; - -/* -* Main notification control message -* *_notify_num - number of appropriate cn_notify_req structures after -* this struct. -* group - notification receiver's idx. -* len - total length of the attached data. -*/ -struct cn_ctl_msg { -__u32 idx_notify_num; -__u32 val_notify_num; -__u32 group; -__u32 len; -__u8 data[0 ]; -}; -#ifdef __KERNEL__#include <asm/atomic.h>
@@ -149,11 +122,6 @@ struct cn_callback_entry {u32 seq, group; }; -struct cn_ctl_entry { -struct list_head notify_entry; -struct cn_ctl_msg *msg; -}; -struct cn_dev {struct cb_id id;
PATCH 14/89 KVM: x86 emulator: limit instructions to 15 bytes
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <[email protected]>
commit eb3c79e64a70fb8f7473e30fa07e89c1ecc2c9bb upstream
While we are never normally passed an instruction that exceeds 15 bytes, smp games can cause us to attempt to interpret one, which will cause large latencies in non-preempt hosts.
--- arch/x86/include/asm/kvm_x86_emulate.h | 2 +- arch/x86/kvm/x86_emulate.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_x86_emulate.h +1 -1
@@ -129,7 +129,7 @@ struct decode_cache {u8 seg_override;unsigned int d;unsigned long regs[NR_VCPU_REGS ]; -unsigned long eip; +unsigned long eip, eip_orig;/* modrm */ u8 modrm;u8 modrm_mod;
arch/x86/kvm/x86_emulate.c +4 -1
@@ -606,6 +606,9 @@ static int do_insn_fetch(struct x86_emul {int rc =0 ; +/* x86 instructions are limited to 15 bytes. */ +if (eip + size - ctxt->decode.eip_orig >15 ) +return X86EMUL_UNHANDLEABLE ; eip += ctxt->cs_base;while (size--) { rc =do_fetch_insn_byte (ctxt, ops, eip++, dest++);
@@ -864,7 +867,7 @@ x86_decode_insn(struct x86_emulate_ctxt/* Shadow copy of register state. Committed on successful emulation. */ memset (c,0 ,sizeof (struct decode_cache )); - c->eip =kvm_rip_read (ctxt->vcpu); + c->eip = c->eip_orig =kvm_rip_read (ctxt->vcpu); ctxt->cs_base =seg_base (ctxt,VCPU_SREG_CS );memcpy (c->regs, ctxt->vcpu->arch.regs,sizeof c->regs);
PATCH 15/89 ALSA: usb-audio - Avoid Oops after disconnect
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 78b8d5d2ee280c463908fd75f3bdf246bcb6ac8d upstream.
As the release of substreams may be done asynchronously from the disconnection, close callback needs to check the shutdown flag before actually accessing the usb interface.
Reference: Novell bnc#505027
http://bugzilla.novell.com/show_bug.cgi?id=565027
--- sound/usb/usbaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/usbaudio.c +1 -1
@@ -1934,7 +1934,7 @@ static int snd_usb_pcm_close(struct snd_struct snd_usb_stream *as =snd_pcm_substream_chip (substream);struct snd_usb_substream *subs = &as->substream[direction]; -if (subs->interface >=0 ) { +if (!as->chip->shutdown && subs->interface >=0 ) {usb_set_interface (subs->dev, subs->interface,0 ); subs->interface =-1 ; }
PATCH 16/89 HID: add device IDs for new model of Apple Wireless Keyboard
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Schuerer-Waldheim <[email protected]>
commit 23aeb61e7e1f02fb0f3b8f9e798e75537ca1731d upstream.
Added device IDs for the new model of the Apple Wireless Keyboard (November 2009).
--- drivers/hid/hid-apple.c | 7 +++++++ drivers/hid/hid-core.c | 3 +++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 13 insertions(+)
drivers/hid/hid-apple.c +7 -0
@@ -431,6 +431,13 @@ static const struct hid_device_id apple_ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_KEYBOARD }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), + .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
drivers/hid/hid-core.c +3 -0
@@ -1259,6 +1259,9 @@ static const struct hid_device_id hid_bl { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
drivers/hid/hid-ids.h +3 -0
@@ -88,6 +88,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236#define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237#define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238 +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
PATCH 17/89 inotify: do not reuse watch descriptors
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Paris <[email protected]>
commit 9e572cc9877ee6c43af60778f6b8d5ba0692d935 upstream.
Since commit 7e790dd5fc937bc8d2400c30a05e32a9e9eef276 ("inotify: fix error paths in inotify_update_watch") inotify changed the manor in which it gave watch descriptors back to userspace. Previous to this commit inotify acted like the following:
inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 2
but after this patch inotify would return watch descriptors like so:
inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 1
which I saw as equivalent to opening an fd where
open(file) = 1; close(1); open(file) = 1;
seemed perfectly reasonable. The issue is that quite a bit of userspace apparently relies on the behavior in which watch descriptors will not be quickly reused. KDE relies on it, I know some selinux packages rely on it, and I have heard complaints from other random sources such as debian bug 558981.
Although the man page implies what we do is ok, we broke userspace so this patch almost reverts us to the old behavior. It is still slightly racey and I have patches that would fix that, but they are rather large and this will fix it for all real world cases. The race is as follows:
- task1 creates a watch and blocks in idr_new_watch() before it updates the hint.
- task2 creates a watch and updates the hint.
- task1 updates the hint with it's older wd
- task removes the watch created by task2
- task adds a new watch and will reuse the wd originally given to task2
it requires moving some locking around the hint (last_wd) but this should solve it for the real world and be -stable safe.
As a side effect this patch papers over a bug in the lib/idr code which is causing a large number WARN's to pop on people's system and many reports in kerneloops.org. I'm working on the root cause of that idr bug seperately but this should make inotify immune to that issue.
--- fs/notify/inotify/inotify_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/notify/inotify/inotify_user.c +2 -2
@@ -558,7 +558,7 @@ retry:spin_lock (&group->inotify_data.idr_lock); ret =idr_get_new_above (&group->inotify_data.idr, &tmp_ientry->fsn_entry, - group->inotify_data.last_wd, + group->inotify_data.last_wd+1 , &tmp_ientry->wd);spin_unlock (&group->inotify_data.idr_lock);if (ret) {
@@ -638,7 +638,7 @@ static struct fsnotify_group *inotify_nespin_lock_init (&group->inotify_data.idr_lock);idr_init (&group->inotify_data.idr); - group->inotify_data.last_wd =1 ; + group->inotify_data.last_wd =0 ; group->inotify_data.user = user; group->inotify_data.fa =NULL ;
PATCH 18/89 inotify: only warn once for inotify problems
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Paris <[email protected]>
commit 976ae32be45a736acd49215a7e4771ff91f161c3 upstream.
inotify will WARN() if it finds that the idr and the fsnotify internals somehow got out of sync. It was only supposed to do this once but due to this stupid bug it would warn every single time a problem was detected.
--- fs/notify/inotify/inotify_fsnotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/notify/inotify/inotify_fsnotify.c +1 -1
@@ -121,7 +121,7 @@ static int idr_callback(int id, void *p,if (warned)return 0 ; - warned = false; + warned = true; entry = p; ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
PATCH 19/89 edac: i5000_edac critical fix panic out of bounds
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tamas Vincze <[email protected]>
commit 118f3e1afd5534c15f9701f33514186cfc841a27 upstream.
EDAC MC0: INTERNAL ERROR: channel-b out of range (4 >= 4)
Kernel panic - not syncing: EDAC MC0: Uncorrected Error (XEN) Domain 0 crashed: 'noreboot' set - not rebooting.
This happens because FERR_NF_FBD bit 28 is not updated on i5000. Due to that, both bits 28 and 29 may be equal to one, returning channel = 3. As this value is invalid, EDAC core generates the panic.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14568
--- drivers/edac/i5000_edac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/edac/i5000_edac.c +7 -1
@@ -577,7 +577,13 @@ static void i5000_process_nonfatal_errordebugf0 ("\tUncorrected bits= 0x%x\n" , ue_errors); branch =EXTRACT_FBDCHAN_INDX (info->ferr_nf_fbd); - channel = branch; + +/* +* According with i5000 datasheet, bit 28 has no significance +* for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD +*/ + channel = branch &2 ; + bank =NREC_BANK (info->nrecmema); rank =NREC_RANK (info->nrecmema); rdwr =NREC_RDWR (info->nrecmema);
PATCH 20/89 megaraid_sas: remove sysfs poll_mode_io world writeable permissions
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bryn M. Reeves <[email protected]>
commit bb7d3f24c71e528989501617651b669fbed798cb upstream.
/sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior).
This turns off group and user write permissions, so that on typical production systems only root can write to it.
--- drivers/scsi/megaraid/megaraid_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas.c +1 -1
@@ -3451,7 +3451,7 @@ out:return retval; } -static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUGO, +static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR, megasas_sysfs_show_poll_mode_io, megasas_sysfs_set_poll_mode_io);
PATCH 21/89 page allocator: update NR_FREE_PAGES only when necessary
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: KOSAKI Motohiro <[email protected]>
commit 6ccf80eb15ccaca4d3f1ab5162b9ded5eecd9971 upstream.
commit f2260e6b (page allocator: update NR_FREE_PAGES only as necessary) made one minor regression. if __rmqueue() was failed, NR_FREE_PAGES stat go wrong. this patch fixes it.
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -1167,10 +1167,10 @@ again: }spin_lock_irqsave (&zone->lock, flags); page =__rmqueue (zone, order, migratetype); -__mod_zone_page_state (zone,NR_FREE_PAGES , -(1 << order));spin_unlock (&zone->lock);if (!page) goto failed; +__mod_zone_page_state (zone,NR_FREE_PAGES , -(1 << order)); }__count_zone_vm_events (PGALLOC , zone,1 << order);
PATCH 22/89 x86, apic: use physical mode for IBM summit platforms
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit dfea91d5a7c795fd6f4e1a97489a98e4e767463e upstream.
Chris McDermott from IBM confirmed that hurricane chipset in IBM summit platforms doesn't support logical flat mode. Irrespective of the other things like apic_id's, total number of logical cpu's, Linux kernel should default to physical mode for this system.
The 32-bit kernel does so using the OEM checks for the IBM summit platform. Add a similar OEM platform check for the 64bit kernel too.
Otherwise the linux kernel boot can hang on this platform under certain bios/platform settings.
--- arch/x86/kernel/apic/apic_flat_64.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kernel/apic/apic_flat_64.c +5 -0
@@ -240,6 +240,11 @@ static int physflat_acpi_madt_oem_check(printk (KERN_DEBUG "system APIC only can use physical flat" ); return 1; } + +if (!strncmp (oem_id,"IBM" ,3 ) && !strncmp (oem_table_id,"EXA" ,3 )) { +printk (KERN_DEBUG "IBM Summit detected, will use apic physical" ); +return 1 ; + }#endif return 0 ;
PATCH 23/89 reiserfs: truncate blocks not used by a write
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit ec8e2f7466ca370f5e09000ca40a71759afc9ac8 upstream.
It can happen that write does not use all the blocks allocated in write_begin either because of some filesystem error (like ENOSPC) or because page with data to write has been removed from memory. We truncate these blocks so that we don't have dangling blocks beyond i_size.
--- fs/reiserfs/inode.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
fs/reiserfs/inode.c +14 -3
@@ -2531,6 +2531,12 @@ static int reiserfs_writepage(struct pagreturn reiserfs_write_full_page (page, wbc); } +static void reiserfs_truncate_failed_write (struct inode *inode) +{ +truncate_inode_pages (inode->i_mapping, inode->i_size); +reiserfs_truncate_file (inode,0 ); +} + static int reiserfs_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags,
@@ -2597,6 +2603,8 @@ static int reiserfs_write_begin(struct fif (ret) {unlock_page (page);page_cache_release (page); +/* Truncate allocated blocks */ +reiserfs_truncate_failed_write (inode); }return ret; }
@@ -2689,8 +2697,7 @@ static int reiserfs_write_end(struct fil** transaction tracking stuff when the size changes. So, we have ** to do the i_size updates here. */ - pos += copied; -if (pos > inode->i_size) { +if (pos + copied > inode->i_size) {struct reiserfs_transaction_handle myth;reiserfs_write_lock (inode->i_sb);/* If the file have grown beyond the border where it
@@ -2708,7 +2715,7 @@ static int reiserfs_write_end(struct fil goto journal_error; }reiserfs_update_inode_transaction (inode); - inode->i_size = pos; + inode->i_size = pos + copied;/* * this will just nest into our transaction. It's important * to use mark_inode_dirty so the inode gets pushed around on the
@@ -2735,6 +2742,10 @@ static int reiserfs_write_end(struct fil out:unlock_page (page);page_cache_release (page); + +if (pos + len > inode->i_size) +reiserfs_truncate_failed_write (inode); +return ret ==0 ? copied : ret; journal_error:
PATCH 24/89 ecryptfs: initialize private persistent file before dereferencing pointer
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Erez Zadok <[email protected]>
commit e27759d7a333d1f25d628c4f7caf845c51be51c2 upstream.
Ecryptfs_open dereferences a pointer to the private lower file (the one stored in the ecryptfs inode), without checking if the pointer is NULL. Right afterward, it initializes that pointer if it is NULL. Swap order of statements to first initialize. Bug discovered by Duckjin Kang.
--- fs/ecryptfs/file.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
fs/ecryptfs/file.c +7 -7
@@ -191,13 +191,6 @@ static int ecryptfs_open(struct inode *i | ECRYPTFS_ENCRYPTED); }mutex_unlock (&crypt_stat->cs_mutex); -if ((ecryptfs_inode_to_private (inode)->lower_file->f_flags &O_RDONLY ) - && !(file->f_flags &O_RDONLY )) { - rc = -EPERM ; -printk (KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " -"file must hence be opened RO\n" , __func__); - goto out; - }if (!ecryptfs_inode_to_private (inode)->lower_file) { rc =ecryptfs_init_persistent_file (ecryptfs_dentry);if (rc) {
@@ -208,6 +201,13 @@ static int ecryptfs_open(struct inode *i goto out; } } +if ((ecryptfs_inode_to_private (inode)->lower_file->f_flags &O_RDONLY ) + && !(file->f_flags &O_RDONLY )) { + rc = -EPERM ; +printk (KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " +"file must hence be opened RO\n" , __func__); + goto out; + }ecryptfs_set_file_lower ( file,ecryptfs_inode_to_private (inode)->lower_file);if (S_ISDIR (ecryptfs_dentry->d_inode->i_mode)) {
PATCH 25/89 ecryptfs: use after free
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit ece550f51ba175c14ec3ec047815927d7386ea1f upstream.
The "full_alg_name" variable is used on a couple error paths, so we shouldn't free it until the end.
--- fs/ecryptfs/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ecryptfs/crypto.c +2 -2
@@ -1745,7 +1745,7 @@ ecryptfs_process_key_cipher(struct crypt char *cipher_name, size_t *key_size) { char dummy_key[ECRYPTFS_MAX_KEY_BYTES]; -char *full_alg_name; +char *full_alg_name =NULL ;int rc; *key_tfm =NULL ;
@@ -1760,7 +1760,6 @@ ecryptfs_process_key_cipher(struct cryptif (rc) goto out; *key_tfm =crypto_alloc_blkcipher (full_alg_name,0 ,CRYPTO_ALG_ASYNC ); -kfree (full_alg_name);if (IS_ERR (*key_tfm)) { rc =PTR_ERR (*key_tfm); printk(KERN_ERR "Unable to allocate crypto cipher with name "
@@ -1782,6 +1781,7 @@ ecryptfs_process_key_cipher(struct crypt goto out; } out: +kfree (full_alg_name);return rc; }
PATCH 26/89 nozomi: quick fix for the close/close bug
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Cox <[email protected]>
commit eeec32a731631a9bad9abb21c626b9f2840bee0d upstream.
Nozomi goes wrong if you get the sequence
open open close [stuff] close
which turns out to occur on some ppp type setups.
This is a quick patch up for the problem. It's not really fixing Nozomi which completely fails to implement tty open/close semantics and all the other needed stuff. Doing it right is a rather more invasive patch set and not one that will backport.
--- drivers/char/nozomi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/nozomi.c +1 -1
@@ -1628,10 +1628,10 @@ static void ntty_close(struct tty_struct dc->open_ttys--; port->count--; -tty_port_tty_set (port,NULL );if (port->count ==0 ) {DBG1 ("close: %d" , nport->token_dl); +tty_port_tty_set (port,NULL );spin_lock_irqsave (&dc->spin_mutex, flags); dc->last_ier &= ~(nport->token_dl);writew (dc->last_ier, dc->reg_ier);
PATCH 4/5 Fix flush_old_exec()/setup_new_exec() split
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 7ab02af428c2d312c0cf8fb0b01cc1eb21131a3d upstream.
Commit 221af7f87b9 ("Split 'flush_old_exec' into two functions") split the function at the point of no return - ie right where there were no more error cases to check. That made sense from a technical standpoint, but when we then also combined it with the actual personality setting going in between flush_old_exec() and setup_new_exec(), it needs to be a bit more careful.
In particular, we need to make sure that we really flush the old personality bits in the 'flush' stage, rather than later in the 'setup' stage, since otherwise we might be flushing the _new_ personality state that we're just setting up.
So this moves the flags and personality flushing (and 'flush_thread()', which is the arch-specific function that generally resets lazy FP state etc) of the old process into flush_old_exec(), so that it doesn't affect any state that execve() is setting up for the new process environment.
This was reported by Michal Simek as breaking his Microblaze qemu environment.
--- fs/exec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/exec.c +5 -5
@@ -948,6 +948,11 @@ int flush_old_exec(struct linux_binprm * goto out; bprm->mm =NULL ;/* We're using it now */ + + current->flags &= ~PF_RANDOMIZE ; +flush_thread (); + current->personality &= ~bprm->per_clear; +return 0 ; out:
@@ -984,9 +989,6 @@ void setup_new_exec(struct linux_binprm tcomm[i] ='\0' ;set_task_comm (current, tcomm); - current->flags &= ~PF_RANDOMIZE ; -flush_thread (); -/* Set the new mm task size. We have to do that late because it may * depend on TIF_32BIT which is only updated in flush_thread() on * some architectures like powerpc
@@ -1002,8 +1004,6 @@ void setup_new_exec(struct linux_binprmset_dumpable (current->mm, suid_dumpable); } - current->personality &= ~bprm->per_clear; -/* * Flush performance counters when crossing a * security domain:
PATCH 27/89 serial: 8250_pnp: use wildcard for serial Wacom tablets
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Garrett <[email protected]>
commit 6d34855d9aa281f72c533ecb827405139d1b0fe9 upstream.
Wacom claims that the WACF namespace will always be devoted to serial Wacom tablets. Remove the existing entries and add a wildcard to avoid having to update the kernel every time they add a new device.
--- drivers/serial/8250_pnp.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/serial/8250_pnp.c +1 -9
@@ -328,15 +328,7 @@ static const struct pnp_device_id pnp_de/* U.S. Robotics 56K Voice INT PnP*/ { "USR9190", 0 },/* Wacom tablets */ - { "WACF004", 0 }, - { "WACF005", 0 }, - { "WACF006", 0 }, - { "WACF007", 0 }, - { "WACF008", 0 }, - { "WACF009", 0 }, - { "WACF00A", 0 }, - { "WACF00B", 0 }, - { "WACF00C", 0 }, + { "WACFXXX", 0 },/* Compaq touchscreen */ { "FPI2002", 0 },/* Fujitsu Stylistic touchscreens */
PATCH 28/89 tty: fix race in tty_fasync
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 703625118069f9f8960d356676662d3db5a9d116 upstream.
We need to keep the lock held over the call to __f_setown() to prevent a PID race.
Thanks to Al Viro for pointing out the problem, and to Travis for making us look here in the first place.
--- drivers/char/tty_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tty_io.c +1 -1
@@ -1912,8 +1912,8 @@ static int tty_fasync(int fd, struct fil pid =task_pid (current); type =PIDTYPE_PID ; } -spin_unlock_irqrestore (&tty->ctrl_lock, flags); retval =__f_setown (filp, pid, type,0 ); +spin_unlock_irqrestore (&tty->ctrl_lock, flags);if (retval) goto out; }else {
PATCH 29/89 USB: add missing delay during remote wakeup
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 49d0f078f494b9d81e820a13dd8093a9bfb0b6b1 upstream.
This patch (as1330) fixes a bug in khbud's handling of remote wakeups. When a device sends a remote-wakeup request, the parent hub (or the host controller driver, for directly attached devices) begins the resume sequence and notifies khubd when the sequence finishes. At this point the port's SUSPEND feature is automatically turned off.
However the device needs an additional 10-ms resume-recovery time (TRSMRCY in the USB spec). Khubd does not wait for this delay if the SUSPEND feature is off, and as a result some devices fail to behave properly following a remote wakeup. This patch adds the missing delay to the remote-wakeup path.
It also extends the resume-signalling delay used by ehci-hcd and uhci-hcd from 20 ms (the value in the spec) to 25 ms (the value we use for non-remote-wakeup resumes). The extra time appears to help some devices.
--- drivers/usb/core/hub.c | 3 +++ drivers/usb/host/ehci-hcd.c | 5 +++-- drivers/usb/host/uhci-hub.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/usb/core/hub.c +3 -0
@@ -3188,6 +3188,9 @@ static void hub_events(void) USB_PORT_FEAT_C_SUSPEND); udev = hdev->children[i-1 ];if (udev) { +/* TRSMRCY = 10 msec */ +msleep (10 ); +usb_lock_device (udev); ret =remote_wakeup (hdev-> children[i-1 ]);
drivers/usb/host/ehci-hcd.c +3 -2
@@ -764,9 +764,10 @@ static irqreturn_t ehci_irq (struct usb_/* start 20 msec resume signaling from this port, * and make khubd collect PORT_STAT_C_SUSPEND to -* stop that signaling. +* stop that signaling. Use 5 ms extra for safety, +* like usb_port_resume() does. */ - ehci->reset_done [i] = jiffies +msecs_to_jiffies (20 ); + ehci->reset_done[i] = jiffies +msecs_to_jiffies (25 );ehci_dbg (ehci,"port %d remote wakeup\n" , i +1 );mod_timer (&hcd->rh_timer, ehci->reset_done[i]); }
drivers/usb/host/uhci-hub.c +1 -1
@@ -167,7 +167,7 @@ static void uhci_check_ports(struct uhci/* Port received a wakeup request */ set_bit (port, &uhci->resuming_ports); uhci->ports_timeout = jiffies + -msecs_to_jiffies (20 ); +msecs_to_jiffies (25 );/* Make sure we see the port again * after the resuming period is over. */
PATCH 30/89 USB: add speed values for USB 3.0 and wireless controllers
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit b132b04e193908a94d95065d0628f8fb0159cc55 upstream.
These controllers say "unknown" for their speed in sysfs, which obviously isn't correct.
--- drivers/usb/core/sysfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/core/sysfs.c +6 -0
@@ -111,6 +111,12 @@ show_speed(struct device *dev, struct decase USB_SPEED_HIGH : speed ="480" ;break ; +case USB_SPEED_VARIABLE : + speed ="480" ; +break ; +case USB_SPEED_SUPER : + speed ="5000" ; +break ;default : speed ="unknown" ; }
PATCH 31/89 USB: Dont use GFP_KERNEL while we cannot reset a storage device
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Oliver Neukum <[email protected]>
commit acbe2febe71abb2360b008e9ab3ee5c44169f78c upstream.
Memory allocations with GFP_KERNEL can cause IO to a storage device which can fail resulting in a need to reset the device. Therefore GFP_KERNEL cannot be safely used between usb_lock_device() and usb_unlock_device(). Replace by GFP_NOIO.
--- drivers/usb/core/devices.c | 2 +- drivers/usb/core/message.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/usb/core/devices.c +1 -1
@@ -494,7 +494,7 @@ static ssize_t usb_device_dump(char __usreturn 0 ;/* allocate 2^1 pages = 8K (on i386); * should be more than enough for one device */ - pages_start = (char *)__get_free_pages (GFP_KERNEL ,1 ); + pages_start = (char *)__get_free_pages (GFP_NOIO ,1 );if (!pages_start)return -ENOMEM ;
drivers/usb/core/message.c +4 -4
@@ -923,11 +923,11 @@ char *usb_cache_string(struct usb_deviceif (index <=0 )return NULL ; - buf =kmalloc (MAX_USB_STRING_SIZE ,GFP_KERNEL ); + buf =kmalloc (MAX_USB_STRING_SIZE ,GFP_NOIO );if (buf) { len =usb_string (udev, index, buf,MAX_USB_STRING_SIZE );if (len >0 ) { - smallbuf =kmalloc (++len,GFP_KERNEL ); + smallbuf =kmalloc (++len,GFP_NOIO );if (!smallbuf)return buf;memcpy (smallbuf, buf, len);
@@ -1694,7 +1694,7 @@ int usb_set_configuration(struct usb_devif (cp) { nintf = cp->desc.bNumInterfaces; new_interfaces =kmalloc (nintf *sizeof (*new_interfaces), -GFP_KERNEL ); +GFP_NOIO );if (!new_interfaces) {dev_err (&dev->dev,"Out of memory\n" );return -ENOMEM ;
@@ -1703,7 +1703,7 @@ int usb_set_configuration(struct usb_devfor (; n < nintf; ++n) { new_interfaces[n] =kzalloc (sizeof (struct usb_interface ), -GFP_KERNEL ); +GFP_NOIO );if (!new_interfaces[n]) {dev_err (&dev->dev,"Out of memory\n" ); ret = -ENOMEM ;
PATCH 32/89 USB: EHCI: fix handling of unusual interrupt intervals
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 1b9a38bfa6e664ff02511314f5586d711c83cc91 upstream.
This patch (as1320) fixes two problems related to interrupt-URB scheduling in ehci-hcd.
URBs with an interval of 2 or 4 microframes aren't handled. For the time being, the patch reduces to interval to 1 uframe.
URBs are constrained to have an interval no larger than 1024 frames by usb_submit_urb(). But some EHCI controllers allow use of a schedule as short as 256 frames; for these controllers we may have to decrease the interval to the actual schedule length.
The second problem isn't very significant since few devices expose interrupt endpoints with an interval larger than 256 frames. But the first problem is critical; it will prevent the kernel from working with devices having interrupt intervals of 2 or 4 uframes.
--- drivers/usb/host/ehci-q.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-q.c +8 -3
@@ -802,9 +802,10 @@ qh_make (* But interval 1 scheduling is simpler, and * includes high bandwidth. */ -dbg ("intr period %d uframes, NYET!" , - urb->interval); - goto done; + urb->interval =1 ; + }else if (qh->period > ehci->periodic_size) { + qh->period = ehci->periodic_size; + urb->interval = qh->period <<3 ; } }else {int think_time;
@@ -827,6 +828,10 @@ qh_make (usb_calc_bus_time (urb->dev->speed, is_input, 0, max_packet (maxp))); qh->period = urb->interval; +if (qh->period > ehci->periodic_size) { + qh->period = ehci->periodic_size; + urb->interval = qh->period; + } } }
PATCH 33/89 USB: EHCI & UHCI: fix race between root-hub suspend and port resume
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit cec3a53c7fe794237b582e8e77fc0e48465e65ee upstream.
This patch (as1321) fixes a problem with EHCI and UHCI root-hub
suspends: If the suspend occurs while a port is trying to resume, the resume doesn't finish and simply gets lost. When remote wakeup is enabled, this is undesirable behavior.
The patch checks first to see if any port resumes are in progress, and if they are then it fails the root-hub suspend with -EBUSY.
--- drivers/usb/host/ehci-hub.c | 20 +++++++++++++++++++- drivers/usb/host/uhci-hcd.c | 15 ++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-hub.c +19 -1
@@ -119,9 +119,26 @@ static int ehci_bus_suspend (struct usb_del_timer_sync (&ehci->watchdog);del_timer_sync (&ehci->iaa_watchdog); - port =HCS_N_PORTS (ehci->hcs_params);spin_lock_irq (&ehci->lock); +/* Once the controller is stopped, port resumes that are already +* in progress won't complete. Hence if remote wakeup is enabled +* for the root hub and any ports are in the middle of a resume or +* remote wakeup, we must fail the suspend. +*/ +if (hcd->self.root_hub->do_remote_wakeup) { + port =HCS_N_PORTS (ehci->hcs_params); +while (port--) { +if (ehci->reset_done[port] !=0 ) { +spin_unlock_irq (&ehci->lock); +ehci_dbg (ehci,"suspend failed because " +"port %d is resuming\n" , + port +1 ); +return -EBUSY ; + } + } + } +/* stop schedules, clean any completed work */ if (HC_IS_RUNNING (hcd->state)) {ehci_quiesce (ehci);
@@ -137,6 +154,7 @@ static int ehci_bus_suspend (struct usb_*/ ehci->bus_suspended =0 ; ehci->owned_ports =0 ; + port =HCS_N_PORTS (ehci->hcs_params);while (port--) {u32 __iomem *reg = &ehci->regs->port_status [port];u32 t1 =ehci_readl (ehci, reg) & ~PORT_RWC_BITS ;
drivers/usb/host/uhci-hcd.c +14 -1
@@ -749,7 +749,20 @@ static int uhci_rh_suspend(struct usb_hcspin_lock_irq (&uhci->lock);if (!test_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags)) rc = -ESHUTDOWN ; -else if (!uhci->dead) +else if (uhci->dead) + ;/* Dead controllers tell no tales */ + +/* Once the controller is stopped, port resumes that are already +* in progress won't complete. Hence if remote wakeup is enabled +* for the root hub and any ports are in the middle of a resume or +* remote wakeup, we must fail the suspend. +*/ +else if (hcd->self.root_hub->do_remote_wakeup && + uhci->resuming_ports) { +dev_dbg (uhci_dev (uhci),"suspend failed because a port " +"is resuming\n" ); + rc = -EBUSY ; + }else suspend_rh (uhci,UHCI_RH_SUSPENDED );spin_unlock_irq (&uhci->lock);return rc;
PATCH 34/89 USB: fix bitmask merge error
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit a91b593edd4b3e8aa91f671b763b27b8119eb49d upstream.
This patch adds a mask bit which was mistakenly omitted from the as1311 patch (usb-storage: add BAD_SENSE flag).
--- drivers/usb/storage/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/storage/usb.c +2 -1
@@ -430,7 +430,8 @@ static void adjust_quirks(struct us_datau16 vid =le16_to_cpu (us->pusb_dev->descriptor.idVendor);u16 pid =le16_to_cpu (us->pusb_dev->descriptor.idProduct);unsigned f =0 ; - unsigned int mask = (US_FL_SANE_SENSE | US_FL_FIX_CAPACITY | + unsigned int mask = (US_FL_SANE_SENSE | US_FL_BAD_SENSE | + US_FL_FIX_CAPACITY | US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE | US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 | US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
PATCH 35/89 usb: serial: fix memory leak in generic driver
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johan Hovold <[email protected]>
commit 2591530204a76fecc843529ade56afe865dd2657 upstream.
Fix a regression introduced by commit 715b1dc01fe44537e8fce9566e4bb48d6821d84b ("USB: usb_debug,usb_generic_serial: implement multi urb write").
URB transfer buffer was never freed when using multi-urb writes. Currently the only driver enabling multi-urb writes is usb_debug.
--- drivers/usb/serial/generic.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/generic.c +2 -0
@@ -480,6 +480,8 @@ void usb_serial_generic_write_bulk_callbdbg ("%s - port %d" , __func__, port->number);if (port->serial->type->max_in_flight_urbs) { +kfree (urb->transfer_buffer); +spin_lock_irqsave (&port->lock, flags); --port->urbs_in_flight; port->tx_bytes_flight -= urb->transfer_buffer_length;
PATCH 36/89 SCSI: enclosure: fix oops while iterating enclosure_status array
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Bottomley <[email protected]>
commit cc9b2e9f6603190c009e5d2629ce8e3f99571346 upstream.
Based on patch originally by Jeff Mahoney <[email protected]>
enclosure_status is expected to be a NULL terminated array of strings but isn't actually NULL terminated. When writing an invalid value to /sys/class/enclosure/.../.../status, it goes off the end of the array and Oopses.
Fix by making the assumption true and adding NULL at the end.
--- drivers/misc/enclosure.c | 1 + include/linux/enclosure.h | 2 ++ 2 files changed, 3 insertions(+)
drivers/misc/enclosure.c +1 -0
@@ -362,6 +362,7 @@ static const char *const enclosure_statu [ENCLOSURE_STATUS_NOT_INSTALLED] = "not installed", [ENCLOSURE_STATUS_UNKNOWN] = "unknown", [ENCLOSURE_STATUS_UNAVAILABLE] = "unavailable", + [ENCLOSURE_STATUS_MAX] = NULL, };static const char *const enclosure_type [] = {
include/linux/enclosure.h +2 -0
@@ -42,6 +42,8 @@ enum enclosure_status {ENCLOSURE_STATUS_NOT_INSTALLED ,ENCLOSURE_STATUS_UNKNOWN ,ENCLOSURE_STATUS_UNAVAILABLE , +/* last element for counting purposes */ + ENCLOSURE_STATUS_MAX };/* SFF-8485 activity light settings */
PATCH 37/89 x86/PCI/PAT: return EINVAL for pci mmap WC request for !pat_enabled
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit 2992e545ea006992ec9dc91c4fa996ce1e15f921 upstream.
Thomas Schlichter reported:
Quoted 5 lines
X.org uses libpciaccess which tries to mmap with write combining enabled via
/sys/bus/pci/devices/*/resource0_wc. Currently, when PAT is not enabled, the kernel does fall back to uncached mmap. Then libpciaccess thinks it succeeded mapping with write combining enabled and does not set up suited MTRR entries. ;-(
Instead of silently mapping pci mmap region as UC minus in the case of !pat_enabled and wc request, we can return error. Eric Anholt mentioned that caller (like X) typically follows up with UC minus pci mmap request and if there is a free mtrr slot, caller will manage adding WC mtrr.
Jesse Barnes says:
Quoted 3 lines
Older versions of libpciaccess will behave better if we do it that way (iirc it only allocates an MTRR if the
resource_wcfile doesn't exist or fails to get mapped).
--- arch/x86/pci/i386.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/x86/pci/i386.c +9 -0
@@ -282,6 +282,15 @@ int pci_mmap_page_range(struct pci_dev *return -EINVAL ; prot =pgprot_val (vma->vm_page_prot); + +/* +* Return error if pat is not enabled and write_combine is requested. +* Caller can followup with UC MINUS request and add a WC mtrr if there +* is a free mtrr slot. +*/ +if (!pat_enabled && write_combine) +return -EINVAL ; +if (pat_enabled && write_combine) prot |= _PAGE_CACHE_WC;else if (pat_enabled || boot_cpu_data.x86 >3 )
PATCH 38/89 USB: fix usbstorage for 2770:915d delivers no FAT
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ryan May <[email protected]>
commit 10d2cdb6102669279bee2d9a00a22431b74583d5 upstream.
Resolves kernel.org bug 14914.
Remove entry for 2770:915d (usb digital camera with mass storage support) from unusual_devs.h. The fix triggered by the entry causes the file system on the camera to be completely inaccessible (no partition table, the device is not mountable).
The patch works, but let me clarify a few things about it. All the patch does is remove the entry for this device from the drivers/usb/storage/unusual_devs.h, which is supposed to help with a problem with the device's reported size (I think). I'm pretty sure it was originally added for a reason, so I'm not sure removing it won't cause other problems to reappear. Also, I should note that this unusual_devs.h entry was present (and activating workarounds) in 2.6.29, but in that version everything works fine. Starting with 2.6.30, things no longer work.
--- drivers/usb/storage/unusual_devs.h | 7 ------- 1 file changed, 7 deletions(-)
drivers/usb/storage/unusual_devs.h +0 -7
@@ -1827,13 +1827,6 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0xUS_SC_DEVICE ,US_PR_DEVICE ,NULL , US_FL_GO_SLOW ), -/* Reported by Rohan Hart <[email protected]> */ -UNUSUAL_DEV (0x2770 ,0x915d ,0x0010 ,0x0010 , -"INTOVA" , -"Pixtreme" , -US_SC_DEVICE ,US_PR_DEVICE ,NULL , - US_FL_FIX_CAPACITY ), -/* Reported by Frederic Marchal <[email protected]> * Mio Moov 330 */
PATCH 39/89 vmalloc: remove BUG_ON due to racy counting of VM_LAZY_FREE
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yongseok Koh <[email protected]>
commit 88f5004430babb836cfce886d5d54c82166f8ba4 upstream.
In free_unmap_area_noflush(), va->flags is marked as VM_LAZY_FREE first, and then vmap_lazy_nr is increased atomically.
But, in __purge_vmap_area_lazy(), while traversing of vmap_are_list, nr is counted by checking VM_LAZY_FREE is set to va->flags. After counting the variable nr, kernel reads vmap_lazy_nr atomically and checks a BUG_ON condition whether nr is greater than vmap_lazy_nr to prevent vmap_lazy_nr from being negative.
The problem is that, if interrupted right after marking VM_LAZY_FREE, increment of vmap_lazy_nr can be delayed. Consequently, BUG_ON condition can be met because nr is counted more than vmap_lazy_nr.
It is highly probable when vmalloc/vfree are called frequently. This scenario have been verified by adding delay between marking VM_LAZY_FREE and increasing vmap_lazy_nr in free_unmap_area_noflush().
Even the vmap_lazy_nr is for checking high watermark, it never be the strict watermark. Although the BUG_ON condition is to prevent vmap_lazy_nr from being negative, vmap_lazy_nr is signed variable. So, it could go down to negative value temporarily.
Consequently, removing the BUG_ON condition is proper.
A possible BUG_ON message is like the below.
kernel BUG at mm/vmalloc.c:517!
invalid opcode: 0000 [#1] SMP
EIP: 0060:[<c04824a4>] EFLAGS: 00010297 CPU: 3 EIP is at __purge_vmap_area_lazy+0x144/0x150
EAX: ee8a8818 EBX: c08e77d4 ECX: e7c7ae40 EDX: c08e77ec
ESI: 000081fe EDI: e7c7ae60 EBP: e7c7ae64 ESP: e7c7ae3c
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Call Trace: [<c0482ad9>] free_unmap_vmap_area_noflush+0x69/0x70 [<c0482b02>] remove_vm_area+0x22/0x70 [<c0482c15>] __vunmap+0x45/0xe0 [<c04831ec>] vmalloc+0x2c/0x30 Code: 8d 59 e0 eb 04 66 90 89 cb 89 d0 e8 87 fe ff ff 8b 43 20 89 da 8d 48 e0 8d 43 20 3b 04 24 75 e7 fe 05 a8 a5 a3 c0 e9 78 ff ff ff <0f> 0b eb fe 90 8d b4 26 00 00 00 00 56 89 c6 b8 ac a5 a3 c0 31 EIP: [<c04824a4>] __purge_vmap_area_lazy+0x144/0x150 SS:ESP 0068:e7c7ae3c
[ See also http://marc.info/?l=linux-kernel&m=126335856228090&w=2 ]
--- mm/vmalloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mm/vmalloc.c +1 -3
@@ -546,10 +546,8 @@ static void __purge_vmap_area_lazy(unsig }rcu_read_unlock (); -if (nr) { -BUG_ON (nr >atomic_read (&vmap_lazy_nr)); +if (nr)atomic_sub (nr, &vmap_lazy_nr); - }if (nr || force_flush)flush_tlb_kernel_range (*start, *end);
PATCH 40/89 Input: ALPS - add interleaved protocol support (Dell E6x00 series)
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sebastian Kapfer <[email protected]>
commit 1d9f26262aef6d63ff65eba0fd5f1583f342b69b upstream
Properly handle version of the protocol where standard PS/2 packets from trackpoint are stuffed into middle (byte 3-6) of the standard ALPS packets when both the touchpad and trackpoint are used together.
The patch is based on work done by Matthew Chapman and additional research done by David Kubicek and Erik Osterholm:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/296610
Many thanks to David Kubicek for his efforts in researching fine points of this new version of the protocol, especially interaction between pad and stick in these models.
--- drivers/input/mouse/alps.c | 252 ++++++++++++++++++++++++++++++++++++++++----- drivers/input/mouse/alps.h | 1 2 files changed, 228 insertions(+), 25 deletions(-)
drivers/input/mouse/alps.c +227 -25
@@ -5,6 +5,7 @@* Copyright (c) 2003-2005 Peter Osterlund <[email protected]> * Copyright (c) 2004 Dmitry Torokhov <[email protected]> * Copyright (c) 2005 Vojtech Pavlik <[email protected]> +* Copyright (c) 2009 Sebastian Kapfer <[email protected]> * * ALPS detection, tap switching and status querying info is taken from * tpconfig utility (by C. Scott Ananian and Bruce Kall).
@@ -35,6 +36,8 @@#define ALPS_OLDPROTO 0x10#define ALPS_PASS 0x20#define ALPS_FW_BK_2 0x40 +#define ALPS_PS2_INTERLEAVED 0x80/* 3-byte PS/2 packet interleaved with +6-byte ALPS packet */ static const struct alps_model_info alps_model_data[] = { { {0x32 ,0x02 ,0x14 },0xf8 ,0xf8 ,ALPS_PASS |ALPS_DUALPOINT },/* Toshiba Salellite Pro M10 */
@@ -55,7 +58,9 @@ static const struct alps_model_info alps { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ - { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude E6500 */ + /* Dell Latitude E5500, E6400, E6500, Precision M4400 */ + { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, + ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 }, /* Dell Vostro 1400 */ };
@@ -66,20 +71,88 @@ static const struct alps_model_info alps*/ /* -* ALPS abolute Mode - new format +* PS/2 packet format +* +* byte 0: 0 0 YSGN XSGN 1 M R L +* byte 1: X7 X6 X5 X4 X3 X2 X1 X0 +* byte 2: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 +* +* Note that the device never signals overflow condition. +* +* ALPS absolute Mode - new format * * byte 0: 1 ? ? ? 1 ? ? ? * byte 1: 0 x6 x5 x4 x3 x2 x1 x0 -* byte 2: 0 x10 x9 x8 x7 ? fin ges +* byte 2: 0 x10 x9 x8 x7 ? fin ges * byte 3: 0 y9 y8 y7 1 M R L * byte 4: 0 y6 y5 y4 y3 y2 y1 y0 * byte 5: 0 z6 z5 z4 z3 z2 z1 z0 * +* Dualpoint device -- interleaved packet format +* +* byte 0: 1 1 0 0 1 1 1 1 +* byte 1: 0 x6 x5 x4 x3 x2 x1 x0 +* byte 2: 0 x10 x9 x8 x7 0 fin ges +* byte 3: 0 0 YSGN XSGN 1 1 1 1 +* byte 4: X7 X6 X5 X4 X3 X2 X1 X0 +* byte 5: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 +* byte 6: 0 y9 y8 y7 1 m r l +* byte 7: 0 y6 y5 y4 y3 y2 y1 y0 +* byte 8: 0 z6 z5 z4 z3 z2 z1 z0 +* +* CAPITALS = stick, miniscules = touchpad +* * ?'s can have different meanings on different models, * such as wheel rotation, extra buttons, stick buttons * on a dualpoint, etc. */ +static bool alps_is_valid_first_byte (const struct alps_model_info *model, +unsigned char data) +{ +return (data & model->mask0) == model->byte0; +} + +static void alps_report_buttons (struct psmouse *psmouse, +struct input_dev *dev1,struct input_dev *dev2, +int left,int right,int middle) +{ +struct alps_data *priv = psmouse->private; +const struct alps_model_info *model = priv->i; + +if (model->flags &ALPS_PS2_INTERLEAVED ) { +struct input_dev *dev; + +/* +* If shared button has already been reported on the +* other device (dev2) then this event should be also +* sent through that device. +*/ + dev =test_bit (BTN_LEFT , dev2->key) ? dev2 : dev1; +input_report_key (dev,BTN_LEFT , left); + + dev =test_bit (BTN_RIGHT , dev2->key) ? dev2 : dev1; +input_report_key (dev,BTN_RIGHT , right); + + dev =test_bit (BTN_MIDDLE , dev2->key) ? dev2 : dev1; +input_report_key (dev,BTN_MIDDLE , middle); + +/* +* Sync the _other_ device now, we'll do the first +* device later once we report the rest of the events. +*/ +input_sync (dev2); + }else { +/* +* For devices with non-interleaved packets we know what +* device buttons belong to so we can simply report them. +*/ +input_report_key (dev1,BTN_LEFT , left); +input_report_key (dev1,BTN_RIGHT , right); +input_report_key (dev1,BTN_MIDDLE , middle); + } +} +static void alps_process_packet (struct psmouse *psmouse) {struct alps_data *priv = psmouse->private;
@@ -89,18 +162,6 @@ static void alps_process_packet(struct pint x, y, z, ges, fin, left, right, middle;int back =0 , forward =0 ; -if ((packet[0 ] &0xc8 ) ==0x08 ) {/* 3-byte PS/2 packet */ -input_report_key (dev2,BTN_LEFT , packet[0 ] &1 ); -input_report_key (dev2,BTN_RIGHT , packet[0 ] &2 ); -input_report_key (dev2,BTN_MIDDLE , packet[0 ] &4 ); -input_report_rel (dev2,REL_X , - packet[1 ] ? packet[1 ] - ((packet[0 ] <<4 ) &0x100 ) :0 ); -input_report_rel (dev2,REL_Y , - packet[2 ] ? ((packet[0 ] <<3 ) &0x100 ) - packet[2 ] :0 ); -input_sync (dev2); -return ; - } -if (priv->i->flags &ALPS_OLDPROTO ) { left = packet[2 ] &0x10 ; right = packet[2 ] &0x08 ;
@@ -136,18 +197,13 @@ static void alps_process_packet(struct pinput_report_rel (dev2,REL_X , (x >383 ? (x -768 ) : x));input_report_rel (dev2,REL_Y , -(y >255 ? (y -512 ) : y)); -input_report_key (dev2,BTN_LEFT , left); -input_report_key (dev2,BTN_RIGHT , right); -input_report_key (dev2,BTN_MIDDLE , middle); +alps_report_buttons (psmouse, dev2, dev, left, right, middle); -input_sync (dev);input_sync (dev2);return ; } -input_report_key (dev,BTN_LEFT , left); -input_report_key (dev,BTN_RIGHT , right); -input_report_key (dev,BTN_MIDDLE , middle); +alps_report_buttons (psmouse, dev, dev2, left, right, middle);/* Convert hardware tap to a reasonable Z value */ if (ges && !fin) z =40 ;
@@ -188,25 +244,168 @@ static void alps_process_packet(struct pinput_sync (dev); } +static void alps_report_bare_ps2_packet (struct psmouse *psmouse, +unsigned char packet[], +bool report_buttons) +{ +struct alps_data *priv = psmouse->private; +struct input_dev *dev2 = priv->dev2; + +if (report_buttons) +alps_report_buttons (psmouse, dev2, psmouse->dev, + packet[0 ] &1 , packet[0 ] &2 , packet[0 ] &4 ); + +input_report_rel (dev2,REL_X , + packet[1 ] ? packet[1 ] - ((packet[0 ] <<4 ) &0x100 ) :0 ); +input_report_rel (dev2,REL_Y , + packet[2 ] ? ((packet[0 ] <<3 ) &0x100 ) - packet[2 ] :0 ); + +input_sync (dev2); +} + +static psmouse_ret_t alps_handle_interleaved_ps2 (struct psmouse *psmouse) +{ +struct alps_data *priv = psmouse->private; + +if (psmouse->pktcnt <6 ) +return PSMOUSE_GOOD_DATA ; + +if (psmouse->pktcnt ==6 ) { +/* +* Start a timer to flush the packet if it ends up last +* 6-byte packet in the stream. Timer needs to fire +* psmouse core times out itself. 20 ms should be enough +* to decide if we are getting more data or not. +*/ +mod_timer (&priv->timer, jiffies +msecs_to_jiffies (20 )); +return PSMOUSE_GOOD_DATA ; + } + +del_timer (&priv->timer); + +if (psmouse->packet[6 ] &0x80 ) { + +/* +* Highest bit is set - that means we either had +* complete ALPS packet and this is start of the +* next packet or we got garbage. +*/ + +if (((psmouse->packet[3 ] | + psmouse->packet[4 ] | + psmouse->packet[5 ]) &0x80 ) || + (!alps_is_valid_first_byte (priv->i, psmouse->packet[6 ]))) { +dbg ("refusing packet %x %x %x %x " +"(suspected interleaved ps/2)\n" , + psmouse->packet[3 ], psmouse->packet[4 ], + psmouse->packet[5 ], psmouse->packet[6 ]); +return PSMOUSE_BAD_DATA ; + } + +alps_process_packet (psmouse); + +/* Continue with the next packet */ + psmouse->packet[0 ] = psmouse->packet[6 ]; + psmouse->pktcnt =1 ; + + }else { + +/* +* High bit is 0 - that means that we indeed got a PS/2 +* packet in the middle of ALPS packet. +* +* There is also possibility that we got 6-byte ALPS +* packet followed by 3-byte packet from trackpoint. We +* can not distinguish between these 2 scenarios but +* becase the latter is unlikely to happen in course of +* normal operation (user would need to press all +* buttons on the pad and start moving trackpoint +* without touching the pad surface) we assume former. +* Even if we are wrong the wost thing that would happen +* the cursor would jump but we should not get protocol +* desynchronization. +*/ + +alps_report_bare_ps2_packet (psmouse, &psmouse->packet[3 ], + false); + +/* +* Continue with the standard ALPS protocol handling, +* but make sure we won't process it as an interleaved +* packet again, which may happen if all buttons are +* pressed. To avoid this let's reset the 4th bit which +* is normally 1. +*/ + psmouse->packet[3 ] = psmouse->packet[6 ] &0xf7 ; + psmouse->pktcnt =4 ; + } + +return PSMOUSE_GOOD_DATA ; +} + +static void alps_flush_packet (unsigned long data) +{ +struct psmouse *psmouse = (struct psmouse *)data; + +serio_pause_rx (psmouse->ps2dev.serio); + +if (psmouse->pktcnt ==6 ) { + +/* +* We did not any more data in reasonable amount of time. +* Validate the last 3 bytes and process as a standard +* ALPS packet. +*/ +if ((psmouse->packet[3 ] | + psmouse->packet[4 ] | + psmouse->packet[5 ]) &0x80 ) { +dbg ("refusing packet %x %x %x " +"(suspected interleaved ps/2)\n" , + psmouse->packet[3 ], psmouse->packet[4 ], + psmouse->packet[5 ]); + }else { +alps_process_packet (psmouse); + } + psmouse->pktcnt =0 ; + } + +serio_continue_rx (psmouse->ps2dev.serio); +} +static psmouse_ret_t alps_process_byte (struct psmouse *psmouse) {struct alps_data *priv = psmouse->private; +const struct alps_model_info *model = priv->i;if ((psmouse->packet[0 ] &0xc8 ) ==0x08 ) {/* PS/2 packet */ if (psmouse->pktcnt ==3 ) { -alps_process_packet (psmouse); +alps_report_bare_ps2_packet (psmouse, psmouse->packet, + true);return PSMOUSE_FULL_PACKET ; }return PSMOUSE_GOOD_DATA ; } -if ((psmouse->packet[0 ] & priv->i->mask0) != priv->i->byte0) +/* Check for PS/2 packet stuffed in the middle of ALPS packet. */ + +if ((model->flags &ALPS_PS2_INTERLEAVED ) && + psmouse->pktcnt >=4 && (psmouse->packet[3 ] &0x0f ) ==0x0f ) { +return alps_handle_interleaved_ps2 (psmouse); + } + +if (!alps_is_valid_first_byte (model, psmouse->packet[0 ])) { +dbg ("refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n" , + psmouse->packet[0 ], model->mask0, model->byte0);return PSMOUSE_BAD_DATA ; + }/* Bytes 2 - 6 should have 0 in the highest bit */ if (psmouse->pktcnt >=2 && psmouse->pktcnt <=6 && - (psmouse->packet[psmouse->pktcnt -1 ] &0x80 )) + (psmouse->packet[psmouse->pktcnt -1 ] &0x80 )) { +dbg ("refusing packet[%i] = %x\n" , + psmouse->pktcnt -1 , psmouse->packet[psmouse->pktcnt -1 ]);return PSMOUSE_BAD_DATA ; + }if (psmouse->pktcnt ==6 ) {alps_process_packet (psmouse);
@@ -441,6 +640,7 @@ static void alps_disconnect(struct psmoustruct alps_data *priv = psmouse->private;psmouse_reset (psmouse); +del_timer_sync (&priv->timer);input_unregister_device (priv->dev2);kfree (priv); }
@@ -457,6 +657,8 @@ int alps_init(struct psmouse *psmouse) goto init_fail; priv->dev2 = dev2; +setup_timer (&priv->timer, alps_flush_packet, (unsigned long )psmouse); + psmouse->private = priv;if (alps_hw_init (psmouse, &version))
drivers/input/mouse/alps.h +1 -0
@@ -23,6 +23,7 @@ struct alps_data {char phys[32 ];/* Phys */ const struct alps_model_info *i;/* Info */ int prev_fin;/* Finger bit from previous packet */ +struct timer_list timer; };#ifdef CONFIG_MOUSE_PS2_ALPS
PATCH 41/89 partitions: read whole sector with EFI GPT header
In reply to Greg KH2.6.31-stable review patch. If anyone has any objections, please let us know.
------------------
From: Karel Zak <[email protected]>
commit 87038c2d5bda2418fda8b1456a0ae81cc3ff5bd8 upstream.
The size of EFI GPT header is not static, but whole sector is allocated for the header. The HeaderSize field must be greater than 92 (= sizeof(struct gpt_header) and must be less than or equal to the logical block size.
It means we have to read whole sector with the header, because the header crc32 checksum is calculated according to HeaderSize.
For more details see UEFI standard (version 2.3, May 2009):
- 5.3.1 GUID Format overview, page 93
- Table 13. GUID Partition Table Header, page 96
--- fs/partitions/efi.c | 7 ++++--- fs/partitions/efi.h | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-)
fs/partitions/efi.c +4 -3
@@ -257,15 +257,16 @@ static gpt_header * alloc_read_gpt_header(struct block_device *bdev, u64 lba) {gpt_header *gpt; +unsigned ssz =bdev_logical_block_size (bdev); +if (!bdev)return NULL ; - gpt =kzalloc (sizeof (gpt_header),GFP_KERNEL ); + gpt =kzalloc (ssz,GFP_KERNEL );if (!gpt)return NULL ; -if (read_lba (bdev, lba, (u8 *) gpt, -sizeof (gpt_header)) <sizeof (gpt_header)) { +if (read_lba (bdev, lba, (u8 *) gpt, ssz) < ssz) {kfree (gpt); gpt=NULL ;return NULL ;
fs/partitions/efi.h +6 -2
@@ -37,7 +37,6 @@#define EFI_PMBR_OSTYPE_EFI 0xEF#define EFI_PMBR_OSTYPE_EFI_GPT 0xEE -#define GPT_BLOCK_SIZE 512#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL#define GPT_HEADER_REVISION_V1 0x00010000#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
@@ -79,7 +78,12 @@ typedef struct _gpt_header {__le32 num_partition_entries;__le32 sizeof_partition_entry;__le32 partition_entry_array_crc32; -u8 reserved2[GPT_BLOCK_SIZE -92 ]; + +/* The rest of the logical block is reserved by UEFI and must be zero. +* EFI standard handles this by: +* +* uint8_t reserved2[ BlockSize - 92 ]; +*/ } __attribute__ ((packed)) gpt_header; typedef struct _gpt_entry_attributes {