2.6.35.2 stable review
Subsystems (46)
PATCH 5/67 x86, kmmio/mmiotrace: Fix double free of kmmio_fault_pages
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marcin Slusarz <[email protected]>
commit 8b8f79b927b6b302bb65fb8c56e7a19be5fbdbef upstream.
After every iounmap mmiotrace has to free kmmio_fault_pages, but it can't do it directly, so it defers freeing by RCU.
It usually works, but when mmiotraced code calls ioremap-iounmap multiple times without sleeping between (so RCU won't kick in and start freeing) it can be given the same virtual address, so at every iounmap mmiotrace will schedule the same pages for release. Obviously it will explode on second free.
Fix it by marking kmmio_fault_pages which are scheduled for release and not adding them second time.
LKML-Reference: <[email protected]>
--- arch/x86/mm/kmmio.c | 16 +++++++++++++--- arch/x86/mm/testmmiotrace.c | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-)
arch/x86/mm/kmmio.c +13 -3
@@ -45,6 +45,8 @@ struct kmmio_fault_page {* Protected by kmmio_lock, when linked into kmmio_page_table. */ int count; + +bool scheduled_for_release; };struct kmmio_delayed_release {
@@ -398,8 +400,11 @@ static void release_kmmio_fault_page(unsBUG_ON (f->count <0 );if (!f->count) {disarm_kmmio_fault_page (f); - f->release_next = *release_list; - *release_list = f; +if (!f->scheduled_for_release) { + f->release_next = *release_list; + *release_list = f; + f->scheduled_for_release = true; + } } }
@@ -471,8 +476,10 @@ static void remove_kmmio_fault_pages(str prevp = &f->release_next; }else { *prevp = f->release_next; + f->release_next =NULL ; + f->scheduled_for_release = false; } - f = f->release_next; + f = *prevp; }spin_unlock_irqrestore (&kmmio_lock, flags);
@@ -510,6 +517,9 @@ void unregister_kmmio_probe(struct kmmio kmmio_count--;spin_unlock_irqrestore (&kmmio_lock, flags); +if (!release_list) +return ; + drelease =kmalloc (sizeof (*drelease),GFP_ATOMIC );if (!drelease) {pr_crit ("leaking kmmio_fault_page objects.\n" );
arch/x86/mm/testmmiotrace.c +22 -0
@@ -90,6 +90,27 @@ static void do_test(unsigned long size)iounmap (p); } +/* +* Tests how mmiotrace behaves in face of multiple ioremap / iounmaps in +* a short time. We had a bug in deferred freeing procedure which tried +* to free this region multiple times (ioremap can reuse the same address +* for many mappings). +*/ +static void do_test_bulk_ioremapping (void ) +{ +void __iomem *p; +int i; + +for (i =0 ; i <10 ; ++i) { + p =ioremap_nocache (mmio_address,PAGE_SIZE ); +if (p) +iounmap (p); + } + +/* Force freeing. If it will crash we will know why. */ +synchronize_rcu (); +} +static int __init init (void ) {unsigned long size = (read_far) ? (8 <<20 ) : (16 <<10 );
@@ -104,6 +125,7 @@ static int __init init(void)"and writing 16 kB of rubbish in there.\n" , size >> 10, mmio_address);do_test (size); +do_test_bulk_ioremapping ();pr_info ("All done.\n" );return 0 ; }
PATCH 64/67 irq: Add new IRQ flag IRQF_NO_SUSPEND
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ian Campbell <[email protected]>
commit 685fd0b4ea3f0f1d5385610b0d5b57775a8d5842 upstream.
A small number of users of IRQF_TIMER are using it for the implied no suspend behaviour on interrupts which are not timer interrupts.
Therefore add a new IRQF_NO_SUSPEND flag, rename IRQF_TIMER to __IRQF_TIMER and redefine IRQF_TIMER in terms of these new flags.
LKML-Reference: <[email protected]>
--- include/linux/interrupt.h | 7 ++++++- kernel/irq/manage.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-)
include/linux/interrupt.h +6 -1
@@ -53,16 +53,21 @@* IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. * Used by threaded interrupts which need to keep the * irq line disabled until the threaded handler has been run. +* IRQF_NO_SUSPEND - Do not disable this IRQ during suspend +* */ #define IRQF_DISABLED 0x00000020#define IRQF_SAMPLE_RANDOM 0x00000040#define IRQF_SHARED 0x00000080#define IRQF_PROBE_SHARED 0x00000100 -#define IRQF_TIMER 0x00000200 +#define __IRQF_TIMER 0x00000200#define IRQF_PERCPU 0x00000400#define IRQF_NOBALANCING 0x00000800#define IRQF_IRQPOLL 0x00001000#define IRQF_ONESHOT 0x00002000 +#define IRQF_NO_SUSPEND 0x00004000 + +#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)/* * Bits used by threaded handlers:
kernel/irq/manage.c +1 -1
@@ -216,7 +216,7 @@ static inline int setup_affinity(unsignevoid __disable_irq (struct irq_desc *desc,unsigned int irq,bool suspend) {if (suspend) { -if (!desc->action || (desc->action->flags &IRQF_TIMER )) +if (!desc->action || (desc->action->flags &IRQF_NO_SUSPEND ))return ; desc->status |=IRQ_SUSPENDED ; }
PATCH 65/67 xen: Do not suspend IPI IRQs.
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ian Campbell <[email protected]>
commit 4877c737283813bdb4bebfa3168c1585f6e3a8ca upstream.
In general the semantics of IPIs are that they are are expected to continue functioning after dpm_suspend_noirq().
Specifically I have seen a deadlock between the callfunc IPI and the stop machine used by xen's do_suspend() routine. If one CPU has already called dpm_suspend_noirq() then there is a window where it can be sent a callfunc IPI before all the other CPUs have entered stop_cpu().
If this happens then the first CPU ends up spinning in stop_cpu() waiting for the other to rendezvous in state STOPMACHINE_PREPARE while the other is spinning in csd_lock_wait().
LKML-Reference: <[email protected]>
--- drivers/xen/events.c | 1 + 1 file changed, 1 insertion(+)
drivers/xen/events.c +1 -0
@@ -536,6 +536,7 @@ int bind_ipi_to_irqhandler(enum ipi_vectif (irq <0 )return irq; + irqflags |=IRQF_NO_SUSPEND ; retval =request_irq (irq, handler, irqflags, devname, dev_id);if (retval !=0 ) {unbind_from_irq (irq);
cover 2.6.35.2 stable review
This is the start of the stable review cycle for the 2.6.35.2 release. There are 67 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 Friday, August 13, 2010, 20: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.35.2-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/Kconfig | 12 ++++ arch/arm/include/asm/tlbflush.h | 8 +++ arch/arm/mach-pxa/cm-x300.c | 3 +- arch/arm/plat-mxc/include/mach/gpio.h | 1 + arch/powerpc/Makefile | 16 ++++- arch/powerpc/kernel/perf_event_fsl_emb.c | 1 + arch/x86/include/asm/cmpxchg_32.h | 68 ++++++++++---------- arch/x86/include/asm/cmpxchg_64.h | 40 ++++++------ arch/x86/kernel/cpu/mtrr/main.c | 56 +++++++++++++---- arch/x86/kernel/cpu/vmware.c | 9 +++- arch/x86/kernel/smpboot.c | 7 ++ arch/x86/mm/kmmio.c | 16 ++++- arch/x86/mm/testmmiotrace.c | 22 +++++++ arch/x86/pci/acpi.c | 9 +++ crypto/Kconfig | 8 +++ crypto/algboss.c | 4 + crypto/testmgr.c | 14 ++++ drivers/ata/ata_piix.c | 8 +++ drivers/atm/solos-pci.c | 7 ++- drivers/block/drbd/drbd_main.c | 27 ++++++--- drivers/bluetooth/btusb.c | 3 + drivers/char/ipmi/ipmi_si_intf.c | 8 +++ drivers/char/nozomi.c | 4 +- drivers/dma/ioat/dma.h | 1 + drivers/dma/ioat/dma_v2.c | 24 +++++++- drivers/dma/ioat/dma_v3.c | 5 +- drivers/ide/ide-cd.c | 14 +++- drivers/md/md.c | 37 ++++++----- drivers/md/md.h | 4 + drivers/md/raid10.c | 18 +++++ drivers/mtd/nand/mxc_nand.c | 2 +- drivers/mtd/nand/plat_nand.c | 2 +- drivers/net/e100.c | 2 + drivers/net/e1000/e1000_main.c | 3 + drivers/net/e1000e/netdev.c | 4 + drivers/net/igb/igb_main.c | 2 + drivers/net/igbvf/netdev.c | 2 + drivers/net/ixgb/ixgb_main.c | 2 + drivers/net/ixgbe/ixgbe_main.c | 1 + drivers/net/ixgbevf/ixgbevf_main.c | 2 + drivers/net/smsc911x.c | 92 +++++++++++++++------------ drivers/net/wireless/iwlwifi/iwl-devtrace.h | 2 +- drivers/net/wireless/rtl818x/rtl8180_dev.c | 2 + drivers/pci/intel-iommu.c | 28 ++++++++ drivers/pci/quirks.c | 4 + drivers/pcmcia/pcmcia_resource.c | 5 +- drivers/serial/8250_pci.c | 13 ++++ drivers/staging/hv/Kconfig | 2 +- drivers/staging/line6/Kconfig | 1 + drivers/staging/panel/panel.c | 2 + drivers/staging/rt2860/usb_main_dev.c | 1 + drivers/usb/core/hub.c | 6 ++- drivers/usb/core/quirks.c | 3 + drivers/usb/core/urb.c | 50 ++++++--------- drivers/usb/host/ehci-pci.c | 1 + drivers/usb/host/ehci-sched.c | 10 +-- drivers/usb/host/ehci.h | 1 + drivers/usb/misc/usbtest.c | 6 ++- drivers/usb/mon/mon_bin.c | 2 +- drivers/usb/musb/musb_debugfs.c | 32 +++++----- drivers/usb/serial/cp210x.c | 4 + drivers/usb/serial/ftdi_sio.c | 4 + drivers/usb/serial/ftdi_sio_ids.h | 10 +++ drivers/usb/serial/generic.c | 15 +++-- drivers/usb/serial/option.c | 13 ++++ drivers/video/w100fb.c | 4 +- drivers/xen/events.c | 1 + fs/block_dev.c | 10 ++- fs/ecryptfs/file.c | 60 +++++++++++------- fs/ecryptfs/inode.c | 5 +- fs/ext4/super.c | 4 +- fs/jfs/xattr.c | 87 +++++++++++-------------- fs/namespace.c | 2 +- fs/signalfd.c | 2 + fs/super.c | 6 ++ include/linux/Kbuild | 1 + include/linux/fs.h | 7 +- include/linux/interrupt.h | 7 ++- include/linux/notifier.h | 2 +- include/linux/sched.h | 6 -- include/linux/usb/quirks.h | 4 + kernel/irq/manage.c | 2 +- kernel/sched.c | 10 --- kernel/time/tick-sched.c | 2 +- mm/swapfile.c | 6 +- sound/pci/hda/patch_realtek.c | 1 + 87 files changed, 695 insertions(+), 321 deletions(-)
PATCH 1/67 x86, vmware: Preset lpj values when on VMware.
2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alok Kataria <[email protected]>
commit 9f242dc10e0c3c1eb32d8c83c18650a35fd7f80d upstream.
When running on VMware's platform, we have seen situations where the AP's try to calibrate the lpj values and fail to get good calibration runs becasue of timing issues. As a result delays don't work correctly on all cpus.
The solutions is to set preset_lpj value based on the current tsc frequency value. This is similar to what KVM does as well.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/vmware.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/vmware.c +8 -1
@@ -51,7 +51,7 @@ static inline int __vmware_platform(voidstatic unsigned long vmware_get_tsc_khz (void ) { -uint64_t tsc_hz; +uint64_t tsc_hz, lpj;uint32_t eax, ebx, ecx, edx;VMWARE_PORT (GETHZ , eax, ebx, ecx, edx);
@@ -62,6 +62,13 @@ static unsigned long vmware_get_tsc_khz(printk (KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n" , (unsigned long ) tsc_hz /1000 , (unsigned long ) tsc_hz %1000 ); + +if (!preset_lpj) { + lpj = ((u64 )tsc_hz *1000 ); +do_div (lpj,HZ ); + preset_lpj = lpj; + } +return tsc_hz; }
PATCH 6/67 x86/PCI: use host bridge _CRS info on ASRock ALiveSATA2-GLAN
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bjorn Helgaas <[email protected]>
commit 2491762cfb475dbdfa3db11ebea6de49f58b7fac upstream.
This DMI quirk turns on "pci=use_crs" for the ALiveSATA2-GLAN because amd_bus.c doesn't handle this system correctly.
The system has a single HyperTransport I/O chain, but has two PCI host bridges to buses 00 and 80. amd_bus.c learns the MMIO range associated with buses 00-ff and that this range is routed to the HT chain hosted at node 0, link 0:
bus: [00, ff] on node 0 link 0
bus: 00 index 1 [mem 0x80000000-0xfcffffffff]This includes the address space for both bus 00 and bus 80, and amd_bus.c assumes it's all routed to bus 00.
We find device 80:01.0, which BIOS left in the middle of that space, but we don't find a bridge from bus 00 to bus 80, so we conclude that 80:01.0 is unreachable from bus 00, and we move it from the original, working, address to something outside the bus 00 aperture, which does not work:
pci 0000:80:01.0: reg 10: [mem 0xfebfc000-0xfebfffff 64bit]
pci 0000:80:01.0: BAR 0: assigned [mem 0xfd00000000-0xfd00003fff 64bit]The BIOS told us everything we need to know to handle this correctly, so we're better off if we just pay attention, which lets us leave the 80:01.0 device at the original, working, address:
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-7f])
pci_root PNP0A03:00: host bridge window [mem 0x80000000-0xff37ffff]
ACPI: PCI Root Bridge [PCI1] (domain 0000 [bus 80-ff])
pci_root PNP0A08:00: host bridge window [mem 0xfebfc000-0xfebfffff]This was a regression between 2.6.33 and 2.6.34. In 2.6.33, amd_bus.c was used only when we found multiple HT chains. 3e3da00c01d050, which enabled amd_bus.c even on systems with a single HT chain, caused this failure.
This quirk was written by Graham. If we ever enable "pci=use_crs" for machines from 2006 or earlir, this quirk should be removed.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16007
--- arch/x86/pci/acpi.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/x86/pci/acpi.c +9 -0
@@ -34,6 +34,15 @@ static const struct dmi_system_id pci_us DMI_MATCH(DMI_PRODUCT_NAME, "x3800"), }, }, +/* https://bugzilla.kernel.org/show_bug.cgi?id=16007 */ +/* 2006 AMD HT/VIA system with two host bridges */ + { + .callback = set_use_crs, + .ident = "ASRock ALiveSATA2-GLAN", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"), + }, + }, {} };
PATCH 7/67 pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dominik Brodowski <[email protected]>
commit 127c03cdbad9bd5af5d7f33bd31a1015a90cb77f upstream.
NR_IRQS may be as low as 16, causing a (harmless?) buffer overflow in pcmcia_setup_isa_irq():
static u8 pcmcia_used_irq[NR_IRQS];
...
if ((try < 32) && pcmcia_used_irq[irq]) continue;
This is read-only, so if this address would be non-zero, it would just mean we would not attempt an IRQ >= NR_IRQS -- which would fail anyway! And as request_irq() fails for an irq >= NR_IRQS, the setting code path:
pcmcia_used_irq[irq]++;
is never reached as well.
--- drivers/pcmcia/pcmcia_resource.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pcmcia/pcmcia_resource.c +4 -1
@@ -651,7 +651,7 @@ EXPORT_SYMBOL(__pcmcia_request_exclusive#ifdef CONFIG_PCMCIA_PROBE /* mask of IRQs already reserved by other cards, we should avoid using them */ -static u8 pcmcia_used_irq[NR_IRQS ]; +static u8 pcmcia_used_irq[32 ];static irqreturn_t test_action (int cpl,void *dev_id) {
@@ -674,6 +674,9 @@ static int pcmcia_setup_isa_irq(struct pfor (try =0 ; try <64 ; try++) { irq = try %32 ; +if (irq >NR_IRQS ) +continue ; +/* marked as available by driver, not blocked by userspace? */ if (!((mask >> irq) &1 ))continue ;
PATCH 8/67 x86: Add memory modify constraints to xchg() and cmpxchg()
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: H. Peter Anvin <[email protected]>
commit 113fc5a6e8c2288619ff7e8187a6f556b7e0d372 upstream.
xchg() and cmpxchg() modify their memory operands, not merely read them. For some versions of gcc the "memory" clobber has apparently dealt with the situation, but not for all.
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/cmpxchg_32.h | 68 +++++++++++++++++++------------------- arch/x86/include/asm/cmpxchg_64.h | 40 +++++++++++----------- 2 files changed, 54 insertions(+), 54 deletions(-)
arch/x86/include/asm/cmpxchg_32.h +34 -34
@@ -27,20 +27,20 @@ struct __xchg_dummy {switch (size) { \case 1 : \ asmvolatile ("xchgb %b0,%1" \ - :"=q" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=q" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \case 2 : \ asmvolatile ("xchgw %w0,%1" \ - :"=r" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=r" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \case 4 : \ asmvolatile ("xchgl %0,%1" \ - :"=r" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=r" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \default : \
@@ -70,14 +70,14 @@ static inline void __set_64bit(unsigned unsigned int low, unsigned int high) { asmvolatile ("\n1:\t" -"movl (%0), %%eax\n\t" -"movl 4(%0), %%edx\n\t" -LOCK_PREFIX "cmpxchg8b (%0)\n\t" +"movl (%1), %%eax\n\t" +"movl 4(%1), %%edx\n\t" +LOCK_PREFIX "cmpxchg8b (%1)\n\t" "jnz 1b" - :/* no outputs */ - :"D" (ptr), -"b" (low), -"c" (high) + :"=m" (*ptr) + :"D" (ptr), +"b" (low), +"c" (high) :"ax" ,"dx" ,"memory" ); }
@@ -121,21 +121,21 @@ extern void __cmpxchg_wrong_size(void); __typeof__(*(ptr)) __new = (new); \switch (size) { \case 1 : \ - asmvolatile (lock"cmpxchgb %b1,%2" \ - :"=a" (__ret) \ - :"q" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgb %b2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"q" (__new),"0" (__old) \ :"memory" ); \break ; \case 2 : \ - asmvolatile (lock"cmpxchgw %w1,%2" \ - :"=a" (__ret) \ - :"r" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgw %w2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"r" (__new),"0" (__old) \ :"memory" ); \break ; \case 4 : \ - asmvolatile (lock"cmpxchgl %1,%2" \ - :"=a" (__ret) \ - :"r" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgl %2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"r" (__new),"0" (__old) \ :"memory" ); \break ; \default : \
@@ -180,12 +180,12 @@ static inline unsigned long long __cmpxc unsigned long long new) {unsigned long long prev; - asmvolatile (LOCK_PREFIX "cmpxchg8b %3" - :"=A" (prev) - :"b" ((unsigned long )new), -"c" ((unsigned long )(new >>32 )), -"m" (*__xg (ptr)), -"0" (old) + asmvolatile (LOCK_PREFIX "cmpxchg8b %1" + :"=A" (prev), +"+m" (*__xg (ptr)) + :"b" ((unsigned long )new), +"c" ((unsigned long )(new >>32 )), +"0" (old) :"memory" );return prev; }
@@ -195,12 +195,12 @@ static inline unsigned long long __cmpxc unsigned long long new) {unsigned long long prev; - asmvolatile ("cmpxchg8b %3" - :"=A" (prev) - :"b" ((unsigned long )new), -"c" ((unsigned long )(new >>32 )), -"m" (*__xg (ptr)), -"0" (old) + asmvolatile ("cmpxchg8b %1" + :"=A" (prev), +"+m" (*__xg (ptr)) + :"b" ((unsigned long )new), +"c" ((unsigned long )(new >>32 )), +"0" (old) :"memory" );return prev; }
arch/x86/include/asm/cmpxchg_64.h +20 -20
@@ -26,26 +26,26 @@ extern void __cmpxchg_wrong_size(void);switch (size) { \case 1 : \ asmvolatile ("xchgb %b0,%1" \ - :"=q" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=q" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \case 2 : \ asmvolatile ("xchgw %w0,%1" \ - :"=r" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=r" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \case 4 : \ asmvolatile ("xchgl %k0,%1" \ - :"=r" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=r" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \case 8 : \ asmvolatile ("xchgq %0,%1" \ - :"=r" (__x) \ - :"m" (*__xg (ptr)),"0" (__x) \ + :"=r" (__x),"+m" (*__xg (ptr)) \ + :"0" (__x) \ :"memory" ); \break ; \default : \
@@ -71,27 +71,27 @@ extern void __cmpxchg_wrong_size(void); __typeof__(*(ptr)) __new = (new); \switch (size) { \case 1 : \ - asmvolatile (lock"cmpxchgb %b1,%2" \ - :"=a" (__ret) \ - :"q" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgb %b2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"q" (__new),"0" (__old) \ :"memory" ); \break ; \case 2 : \ - asmvolatile (lock"cmpxchgw %w1,%2" \ - :"=a" (__ret) \ - :"r" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgw %w2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"r" (__new),"0" (__old) \ :"memory" ); \break ; \case 4 : \ - asmvolatile (lock"cmpxchgl %k1,%2" \ - :"=a" (__ret) \ - :"r" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgl %k2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"r" (__new),"0" (__old) \ :"memory" ); \break ; \case 8 : \ - asmvolatile (lock"cmpxchgq %1,%2" \ - :"=a" (__ret) \ - :"r" (__new),"m" (*__xg (ptr)),"0" (__old) \ + asmvolatile (lock"cmpxchgq %2,%1" \ + :"=a" (__ret),"+m" (*__xg (ptr)) \ + :"r" (__new),"0" (__old) \ :"memory" ); \break ; \default : \
PATCH 10/67 Staging: line6: needs to select SND_PCM
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Randy Dunlap <[email protected]>
commit e928c077e5cdcd72ee762125b37232aec1ff49f3 upstream.
line6 uses snd_pcm*() functions, so it should select SND_PCM.
ERROR: "snd_pcm_period_elapsed" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_set_ops" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_lib_free_pages" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_lib_ioctl" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_lib_malloc_pages" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_hw_constraint_ratdens" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_format_physical_width" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_lib_preallocate_pages_for_all" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "snd_pcm_new" [drivers/staging/line6/line6usb.ko] undefined!
--- drivers/staging/line6/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/line6/Kconfig +1 -0
@@ -2,6 +2,7 @@ config LINE6_USB tristate "Line6 USB support" depends on USB && SND select SND_RAWMIDI + select SND_PCM help This is a driver for the guitar amp, cab, and effects modeller PODxt Pro by Line6 (and similar devices), supporting the
PATCH 12/67 staging: hv: Fix Kconfig dependency of hv_blkvsc
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Haiyang Zhang <[email protected]>
commit 54d2379c20d814ced657cbc2c4ead8d1f8389fa2 upstream.
LBDAF is not available nor necessary on 64BIT kernel. This patch fixed the dependency for hv_blkvsc module on 64BIT kernel. Thanks vrataj2 [[email protected]] for reporting this problem.
--- drivers/staging/hv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/hv/Kconfig +1 -1
@@ -17,7 +17,7 @@ config HYPERV_STORAGE config HYPERV_BLOCK tristate "Microsoft Hyper-V virtual block driver" - depends on BLOCK && SCSI && LBDAF + depends on BLOCK && SCSI && (LBDAF || 64BIT) default HYPERV help Select this option to enable the Hyper-V virtual block driver.
PATCH 13/67 serial: add support for OX16PCI958 card
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lytochkin Boris <[email protected]>
commit e847003f00d5eca3e3b3a6a1199f82b51293faf6 upstream.
--- drivers/serial/8250_pci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/serial/8250_pci.c +13 -0
@@ -994,6 +994,7 @@ static int skip_tx_en_setup(struct seria#define PCI_DEVICE_ID_TITAN_800E 0xA014#define PCI_DEVICE_ID_TITAN_200EI 0xA016#define PCI_DEVICE_ID_TITAN_200EISI 0xA017 +#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538/* Unknown vendors/cards - this should not be in linux/pci_ids.h */ #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
@@ -1542,6 +1543,8 @@ enum pci_board_num_t { pbn_b2_4_921600, pbn_b2_8_921600, + pbn_b2_8_1152000, + pbn_b2_bt_1_115200, pbn_b2_bt_2_115200, pbn_b2_bt_4_115200,
@@ -1960,6 +1963,13 @@ static struct pciserial_board pci_boards .uart_offset = 8, }, + [pbn_b2_8_1152000] = { + .flags = FL_BASE2, + .num_ports = 8, + .base_baud = 1152000, + .uart_offset = 8, + }, + [pbn_b2_bt_1_115200] = { .flags = FL_BASE2|FL_BASE_BARS, .num_ports = 1,
@@ -2875,6 +2885,9 @@ static struct pci_device_id serial_pci_t {PCI_VENDOR_ID_OXSEMI ,PCI_DEVICE_ID_OXSEMI_16PCI952 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , pbn_b0_bt_2_921600 }, + { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958, +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 , + pbn_b2_8_1152000 },/* * Oxford Semiconductor Inc. Tornado PCI express device range.
PATCH 14/67 PCI: Do not run NVidia quirks related to MSI with MSI disabled
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 3d2a531804d16cd8df6dbbb0429c6f143e756049 upstream.
There is no reason to run NVidia-specific quirks related to HT MSI mappings with MSI disabled via pci=nomsi, so make __nv_msi_ht_cap_quirk() return immediately in that case.
This allows at least one machine to boot 100% of the time with pci=nomsi (it still doesn't boot reliably without that).
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16443 .
--- drivers/pci/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pci/quirks.c +3 -0
@@ -2390,6 +2390,9 @@ static void __devinit __nv_msi_ht_cap_quint pos;int found; +if (!pci_msi_enabled ()) +return ; +/* check if there is HT MSI cap or enabled on this device */ found =ht_check_msi_mapping (dev);
PATCH 23/67 iwlwifi: fix TX tracer
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit e95b743536937a72e1560c85696b425c5d1a1c18 upstream.
The TX tracing code copies with the wrong length, which will typically copy too little data. Fix this by using the correct length variable.
--- drivers/net/wireless/iwlwifi/iwl-devtrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-devtrace.h +1 -1
@@ -193,7 +193,7 @@ TRACE_EVENT(iwlwifi_dev_tx, __entry->framelen = buf0_len + buf1_len;memcpy (__get_dynamic_array (tfd), tfd, tfdlen);memcpy (__get_dynamic_array (buf0), buf0, buf0_len); -memcpy (__get_dynamic_array (buf1), buf1, buf0_len); +memcpy (__get_dynamic_array (buf1), buf1, buf1_len); ), TP_printk("[%p] TX %.2x (%zu bytes)", __entry->priv,
PATCH 24/67 rtl8180: avoid potential NULL deref in rtl8180_beacon_work
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: John W. Linville <[email protected]>
commit 8f1d2d2be73a98c21e68fe2a26f633892d4abdd1 upstream.
ieee80211_beacon_get can return NULL...
--- drivers/net/wireless/rtl818x/rtl8180_dev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/rtl818x/rtl8180_dev.c +2 -0
@@ -688,6 +688,8 @@ void rtl8180_beacon_work(struct work_str/* grab a fresh beacon */ skb =ieee80211_beacon_get (dev, vif); +if (!skb) + goto resched;/* * update beacon timestamp w/ TSF value
PATCH 26/67 ide-cd: Do not access completed requests in the irq handler
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 110712828365ccafcc61a7f4db44c31ed4cf8793 upstream.
ide_cd_error_cmd() can complete an erroneous request with leftover buffers. Signal this with its return value so that the request is not accessed after its completion in the irq handler and we oops.
--- drivers/ide/ide-cd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/ide/ide-cd.c +11 -3
@@ -506,15 +506,22 @@ int ide_cd_queue_pc(ide_drive_t *drive,return (flags &REQ_FAILED ) ? -EIO :0 ; } -static void ide_cd_error_cmd (ide_drive_t *drive,struct ide_cmd *cmd) +/* +* returns true if rq has been completed +*/ +static bool ide_cd_error_cmd (ide_drive_t *drive,struct ide_cmd *cmd) {unsigned int nr_bytes = cmd->nbytes - cmd->nleft;if (cmd->tf_flags &IDE_TFLAG_WRITE ) nr_bytes -= cmd->last_xfer_len; -if (nr_bytes >0 ) +if (nr_bytes >0 ) {ide_complete_rq (drive,0 , nr_bytes); +return true; + } + +return false; }static ide_startstop_t cdrom_newpc_intr (ide_drive_t *drive)
@@ -679,7 +686,8 @@ out_end: }if (uptodate ==0 && rq->bio) -ide_cd_error_cmd (drive, cmd); +if (ide_cd_error_cmd (drive, cmd)) +return ide_stopped;/* make sure it's fully ended */ if (blk_fs_request (rq) ==0 ) {
PATCH 30/67 e100/e1000*/igb*/ixgb*: Add missing read memory barrier
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Kirsher <[email protected]>
commit 2d0bb1c1f4524befe9f0fcf0d0cd3081a451223f upstream.
Based on patches from Sonny Rao and Milton Miller...
Combined the patches to fix up clean_tx_irq and clean_rx_irq.
The PowerPC architecture does not require loads to independent bytes to be ordered without adding an explicit barrier.
In ixgbe_clean_rx_irq we load the status bit then load the packet data. With packet split disabled if these loads go out of order we get a stale packet, but we will notice the bad sequence numbers and drop it.
The problem occurs with packet split enabled where the TCP/IP header and data are in different descriptors. If the reads go out of order we may have data that doesn't match the TCP/IP header. Since we use hardware checksumming this bad data is never verified and it makes it all the way to the application.
This bug was found during stress testing and adding this barrier has been shown to fix it. The bug can manifest as a data integrity issue (bad payload data) or as a BUG in skb_pull().
This was a nasty bug to hunt down, if people agree with the fix I think it's a candidate for stable.
Previously Submitted to e1000-devel only for ixgbe
http://marc.info/?l=e1000-devel&m=126593062701537&w=3
We've now seen this problem hit with other device drivers (e1000e mostly) So I'm resubmitting with fixes for other Intel Device Drivers with similar issues.
--- drivers/net/e100.c | 2 ++ drivers/net/e1000/e1000_main.c | 3 +++ drivers/net/e1000e/netdev.c | 4 ++++ drivers/net/igb/igb_main.c | 2 ++ drivers/net/igbvf/netdev.c | 2 ++ drivers/net/ixgb/ixgb_main.c | 2 ++ drivers/net/ixgbe/ixgbe_main.c | 1 + drivers/net/ixgbevf/ixgbevf_main.c | 2 ++ 8 files changed, 18 insertions(+)
drivers/net/e100.c +2 -0
@@ -1779,6 +1779,7 @@ static int e100_tx_clean(struct nic *nicfor (cb = nic->cb_to_clean; cb->status &cpu_to_le16 (cb_complete); cb = nic->cb_to_clean = cb->next) { +rmb ();/* read skb after status */ netif_printk(nic, tx_done, KERN_DEBUG, nic->netdev, "cb[%d]->status = 0x%04X\n", (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)),
@@ -1927,6 +1928,7 @@ static int e100_rx_indicate(struct nic *netif_printk (nic, rx_status,KERN_DEBUG , nic->netdev,"status=0x%04X\n" , rfd_status); +rmb ();/* read size after status bit */ /* If data isn't ready, nothing to indicate */ if (unlikely (!(rfd_status & cb_complete))) {
drivers/net/e1000/e1000_main.c +3 -0
@@ -3448,6 +3448,7 @@ static bool e1000_clean_tx_irq(struct e1while ((eop_desc->upper.data &cpu_to_le32 (E1000_TXD_STAT_DD )) && (count < tx_ring->count)) {bool cleaned = false; +rmb ();/* read buffer_info after eop_desc */ for ( ; !cleaned; count++) { tx_desc =E1000_TX_DESC (*tx_ring, i); buffer_info = &tx_ring->buffer_info[i];
@@ -3637,6 +3638,7 @@ static bool e1000_clean_jumbo_rx_irq(strif (*work_done >= work_to_do)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ status = rx_desc->status; skb = buffer_info->skb;
@@ -3843,6 +3845,7 @@ static bool e1000_clean_rx_irq(struct e1if (*work_done >= work_to_do)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ status = rx_desc->status; skb = buffer_info->skb;
drivers/net/e1000e/netdev.c +4 -0
@@ -774,6 +774,7 @@ static bool e1000_clean_rx_irq(struct e1if (*work_done >= work_to_do)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ status = rx_desc->status; skb = buffer_info->skb;
@@ -984,6 +985,7 @@ static bool e1000_clean_tx_irq(struct e1while ((eop_desc->upper.data &cpu_to_le32 (E1000_TXD_STAT_DD )) && (count < tx_ring->count)) {bool cleaned = false; +rmb ();/* read buffer_info after eop_desc */ for (; !cleaned; count++) { tx_desc =E1000_TX_DESC (*tx_ring, i); buffer_info = &tx_ring->buffer_info[i];
@@ -1080,6 +1082,7 @@ static bool e1000_clean_rx_irq_ps(structbreak ; (*work_done)++; skb = buffer_info->skb; +rmb ();/* read descriptor and rx_buffer_info after status DD */ /* in the packet split case this is header only */ prefetch (skb->data -NET_IP_ALIGN );
@@ -1279,6 +1282,7 @@ static bool e1000_clean_jumbo_rx_irq(strif (*work_done >= work_to_do)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ status = rx_desc->status; skb = buffer_info->skb;
drivers/net/igb/igb_main.c +2 -0
@@ -5344,6 +5344,7 @@ static bool igb_clean_tx_irq(struct igb_while ((eop_desc->wb.status &cpu_to_le32 (E1000_TXD_STAT_DD )) && (count < tx_ring->count)) { +rmb ();/* read buffer_info after eop_desc status */ for (cleaned = false; !cleaned; count++) { tx_desc =E1000_TX_DESC_ADV (*tx_ring, i); buffer_info = &tx_ring->buffer_info[i];
@@ -5549,6 +5550,7 @@ static bool igb_clean_rx_irq_adv(structif (*work_done >= budget)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ skb = buffer_info->skb;prefetch (skb->data -NET_IP_ALIGN );
drivers/net/igbvf/netdev.c +2 -0
@@ -248,6 +248,7 @@ static bool igbvf_clean_rx_irq(struct igif (*work_done >= work_to_do)break ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ buffer_info = &rx_ring->buffer_info[i];
@@ -780,6 +781,7 @@ static bool igbvf_clean_tx_irq(struct igwhile ((eop_desc->wb.status &cpu_to_le32 (E1000_TXD_STAT_DD )) && (count < tx_ring->count)) { +rmb ();/* read buffer_info after eop_desc status */ for (cleaned = false; !cleaned; count++) { tx_desc =IGBVF_TX_DESC_ADV (*tx_ring, i); buffer_info = &tx_ring->buffer_info[i];
drivers/net/ixgb/ixgb_main.c +2 -0
@@ -1816,6 +1816,7 @@ ixgb_clean_tx_irq(struct ixgb_adapter *awhile (eop_desc->status &IXGB_TX_DESC_STATUS_DD ) { +rmb ();/* read buffer_info after eop_desc */ for (cleaned = false; !cleaned; ) { tx_desc =IXGB_TX_DESC (*tx_ring, i); buffer_info = &tx_ring->buffer_info[i];
@@ -1976,6 +1977,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *abreak ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ status = rx_desc->status; skb = buffer_info->skb; buffer_info->skb =NULL ;
drivers/net/ixgbe/ixgbe_main.c +1 -0
@@ -748,6 +748,7 @@ static bool ixgbe_clean_tx_irq(struct ixwhile ((eop_desc->wb.status &cpu_to_le32 (IXGBE_TXD_STAT_DD )) && (count < tx_ring->work_limit)) {bool cleaned = false; +rmb ();/* read buffer_info after eop_desc */ for ( ; !cleaned; count++) {struct sk_buff *skb; tx_desc =IXGBE_TX_DESC_ADV (*tx_ring, i);
drivers/net/ixgbevf/ixgbevf_main.c +2 -0
@@ -231,6 +231,7 @@ static bool ixgbevf_clean_tx_irq(structwhile ((eop_desc->wb.status &cpu_to_le32 (IXGBE_TXD_STAT_DD )) && (count < tx_ring->work_limit)) {bool cleaned = false; +rmb ();/* read buffer_info after eop_desc */ for ( ; !cleaned; count++) {struct sk_buff *skb; tx_desc =IXGBE_TX_DESC_ADV (*tx_ring, i);
@@ -518,6 +519,7 @@ static bool ixgbevf_clean_rx_irq(structbreak ; (*work_done)++; +rmb ();/* read descriptor and rx_buffer_info after status DD */ if (adapter->flags &IXGBE_FLAG_RX_PS_ENABLED ) { hdr_info =le16_to_cpu (ixgbevf_get_hdr_info (rx_desc)); len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >>
PATCH 32/67 Fix sget() race with failing mount
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Al Viro <[email protected]>
commit 7a4dec53897ecd3367efb1e12fe8a4edc47dc0e9 upstream.
If sget() finds a matching superblock being set up, it'll grab an active reference to it and grab s_umount. That's fine - we'll wait for completion of foofs_get_sb() that way. However, if said foofs_get_sb() fails we'll end up holding the halfway-created superblock. deactivate_locked_super() called by foofs_get_sb() will just unlock the sucker since we are holding another active reference to it.
What we need is a way to tell if superblock has been successfully set up. Unfortunately, neither ->s_root nor the check for MS_ACTIVE quite fit. Cheap and easy way, suitable for backport:
new flag set by the (only) caller of ->get_sb(). If that flag isn't present by the time sget() grabbed s_umount on preexisting superblock it has found, it's seeing a stillborn and should just bury it with deactivate_locked_super() (and repeat the search).
Longer term we want to set that flag in ->get_sb() instances (and check for it to distinguish between "sget() found us a live sb" and "sget() has allocated an sb, we need to set it up" in there, instead of checking ->s_root as we do now).
--- fs/namespace.c | 2 +- fs/super.c | 6 ++++++ include/linux/fs.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-)
fs/namespace.c +1 -1
@@ -1984,7 +1984,7 @@ long do_mount(char *dev_name, char *dir_if (flags &MS_RDONLY ) mnt_flags |=MNT_READONLY ; - flags &= ~(MS_NOSUID |MS_NOEXEC |MS_NODEV |MS_ACTIVE | + flags &= ~(MS_NOSUID |MS_NOEXEC |MS_NODEV |MS_ACTIVE |MS_BORN |MS_NOATIME |MS_NODIRATIME |MS_RELATIME |MS_KERNMOUNT |MS_STRICTATIME );
fs/super.c +6 -0
@@ -305,8 +305,13 @@ retry:if (s) {up_write (&s->s_umount);destroy_super (s); + s =NULL ; }down_write (&old->s_umount); +if (unlikely (!(old->s_flags &MS_BORN ))) { +deactivate_locked_super (old); + goto retry; + }return old; } }
@@ -909,6 +914,7 @@ vfs_kern_mount(struct file_system_type * goto out_free_secdata;BUG_ON (!mnt->mnt_sb);WARN_ON (!mnt->mnt_sb->s_bdi); + mnt->mnt_sb->s_flags |=MS_BORN ; error =security_sb_kern_mount (mnt->mnt_sb, flags, secdata);if (error)
include/linux/fs.h +1 -0
@@ -209,6 +209,7 @@ struct inodes_stat_t {#define MS_KERNMOUNT (1<<22)/* this is a kern_mount call */ #define MS_I_VERSION (1<<23)/* Update inode I_version field */ #define MS_STRICTATIME (1<<24)/* Always perform atime updates */ +#define MS_BORN (1<<29)#define MS_ACTIVE (1<<30)#define MS_NOUSER (1<<31)
PATCH 36/67 fs/ecryptfs/file.c: introduce missing free
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Julia Lawall <[email protected]>
commit ceeab92971e8af05c1e81a4ff2c271124b55bb9b upstream.
The comments in the code indicate that file_info should be released if the function fails. This releasing is done at the label out_free, not out.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = kmem_cache_zalloc(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...x...+> }(x->f1 = E
|
(x->f1 == NULL || ...)
|
f(...,x->f1,...)
)
...>
(
return <+...x...+>;
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmem_cache_zalloc %s" % (p1[0].file,p1[0].line) // </smpl>
--- fs/ecryptfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ecryptfs/file.c +2 -2
@@ -199,7 +199,7 @@ static int ecryptfs_open(struct inode *i"the persistent file for the dentry with name " "[%s]; rc = [%d]\n" , __func__, ecryptfs_dentry->d_name.name, rc); - goto out; + goto out_free; } } if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_RDONLY)
@@ -207,7 +207,7 @@ static int ecryptfs_open(struct inode *i rc = -EPERM ;printk (KERN_WARNING "%s: Lower persistent file is RO; eCryptfs " "file must hence be opened RO\n" , __func__); - goto out; + goto out_free; }ecryptfs_set_file_lower ( file,ecryptfs_inode_to_private (inode)->lower_file);
PATCH 39/67 bio, fs: update RWA_MASK, READA and SWRITE to match the corresponding BIO_RW_* bits
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit aca27ba9618276dd2f777bcd5a1419589ccf1ca8 upstream.
Commit a82afdf (block: use the same failfast bits for bio and request) moved BIO_RW_* bits around such that they match up with REQ_* bits. Unfortunately, fs.h hard coded RW_MASK, RWA_MASK, READ, WRITE, READA and SWRITE as 0, 1, 2 and 3, and expected them to match with BIO_RW_* bits. READ/WRITE didn't change but BIO_RW_AHEAD was moved to bit 4 instead of bit 1, breaking RWA_MASK, READA and SWRITE.
This patch updates RWA_MASK, READA and SWRITE such that they match the BIO_RW_* bits again. A follow up patch will update the definitions to directly use BIO_RW_* bits so that this kind of breakage won't happen again.
Neil also spotted missing RWA_MASK conversion.
Stable: The offending commit a82afdf was released with v2.6.32, so this patch should be applied to all kernels since then but it must _NOT_ be applied to kernels earlier than that.
--- include/linux/fs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/fs.h +3 -3
@@ -145,11 +145,11 @@ struct inodes_stat_t {* */ #define RW_MASK 1 -#define RWA_MASK 2 +#define RWA_MASK 16#define READ 0#define WRITE 1 -#define READA 2/* read-ahead - don't block if no resources */ -#define SWRITE 3/* for ll_rw_block() - wait for buffer lock */ +#define READA 16/* readahead - don't block if no resources */ +#define SWRITE 17/* for ll_rw_block(), wait for buffer lock */ #define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))#define READ_META (READ | (1 << BIO_RW_META))#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
PATCH 40/67 signalfd: fill in ssi_int for posix timers and message queues
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nathan Lynch <[email protected]>
commit a2a20c412c86e0bb46a9ab0dd31bcfe6d201b913 upstream.
If signalfd is used to consume a signal generated by a POSIX interval timer or POSIX message queue, the ssi_int field does not reflect the data (sigevent->sigev_value) supplied to timer_create(2) or mq_notify(3). (The ssi_ptr field, however, is filled in.)
This behavior differs from signalfd's treatment of sigqueue-generated signals -- see the default case in signalfd_copyinfo. It also gives results that differ from the case when a signal is handled conventionally via a sigaction-registered handler.
So, set signalfd_siginfo->ssi_int in the remaining cases (__SI_TIMER, __SI_MESGQ) where ssi_ptr is set.
akpm: a non-back-compatible change. Merge into -stable to minimise the number of kernels which are in the field and which miss this feature.
--- fs/signalfd.c | 2 ++ 1 file changed, 2 insertions(+)
fs/signalfd.c +2 -0
@@ -88,6 +88,7 @@ static int signalfd_copyinfo(struct sign err |=__put_user (kinfo->si_tid, &uinfo->ssi_tid); err |=__put_user (kinfo->si_overrun, &uinfo->ssi_overrun); err |=__put_user ((long ) kinfo->si_ptr, &uinfo->ssi_ptr); + err |=__put_user (kinfo->si_int, &uinfo->ssi_int);break ;case __SI_POLL: err |=__put_user (kinfo->si_band, &uinfo->ssi_band);
@@ -111,6 +112,7 @@ static int signalfd_copyinfo(struct sign err |=__put_user (kinfo->si_pid, &uinfo->ssi_pid); err |=__put_user (kinfo->si_uid, &uinfo->ssi_uid); err |=__put_user ((long ) kinfo->si_ptr, &uinfo->ssi_ptr); + err |=__put_user (kinfo->si_int, &uinfo->ssi_int);break ;default :/*
PATCH 48/67 USB delay init quirk for logitech Harmony 700-series devices
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Phil Dibowitz <[email protected]>
commit 93362a875fc69881ae69299efaf19a55a1f57db0 upstream.
The Logitech Harmony 700 series needs an extra delay during initialization. This patch adds a USB quirk which enables such a delay and adds the device to the quirks list.
--- drivers/usb/core/hub.c | 6 +++++- drivers/usb/core/quirks.c | 3 +++ include/linux/usb/quirks.h | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/usb/core/hub.c +5 -1
@@ -20,6 +20,7 @@#include <linux/usb.h> #include <linux/usbdevice_fs.h> #include <linux/usb/hcd.h> +#include <linux/usb/quirks.h> #include <linux/kthread.h> #include <linux/mutex.h> #include <linux/freezer.h>
@@ -1801,7 +1802,6 @@ int usb_new_device(struct usb_device *udpm_runtime_set_active (&udev->dev);pm_runtime_enable (&udev->dev); -usb_detect_quirks (udev); err =usb_enumerate_device (udev);/* Read descriptors */ if (err <0 ) goto fail;
@@ -3111,6 +3111,10 @@ static void hub_port_connect_change(struif (status <0 ) goto loop; +usb_detect_quirks (udev); +if (udev->quirks &USB_QUIRK_DELAY_INIT ) +msleep (1000 ); +/* consecutive bus-powered hubs aren't reliable; they can * violate the voltage drop budget. if the new child has * a "powered" LED, users should notice we didn't enable it
drivers/usb/core/quirks.c +3 -0
@@ -38,6 +38,9 @@ static const struct usb_device_id usb_qu/* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Logitech Harmony 700-series */ + { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
include/linux/usb/quirks.h +4 -0
@@ -26,4 +26,8 @@and can't handle talking to these interfaces */ #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 +/* device needs a pause during initialization, after we read the device +descriptor */ +#define USB_QUIRK_DELAY_INIT 0x00000040 +#endif /* __LINUX_USB_QUIRKS_H */
PATCH 47/67 USB: resizing usbmon binary interface buffer causes protection faults
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven Robertson <[email protected]>
commit 33d973ad88ceb83ed1449592b7574b5b5bb33ac6 upstream.
Enlarging the buffer size via the MON_IOCT_RING_SIZE ioctl causes
general protection faults. It appears the culprit is an incorrect
argument to mon_free_buff: instead of passing the size of the current buffer being freed, the size of the new buffer is passed.
Use the correct size argument to mon_free_buff when changing the size of the buffer.
--- drivers/usb/mon/mon_bin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/mon/mon_bin.c +1 -1
@@ -1009,7 +1009,7 @@ static int mon_bin_ioctl(struct file *fimutex_lock (&rp->fetch_lock);spin_lock_irqsave (&rp->b_lock, flags); -mon_free_buff (rp->b_vec, size/CHUNK_SIZE ); +mon_free_buff (rp->b_vec, rp->b_size/CHUNK_SIZE );kfree (rp->b_vec); rp->b_vec = vec; rp->b_size = size;
PATCH 46/67 USB: EHCI: remove PCI assumption
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit ae68a83bdc1971cb02fefc7a686ba6d077065e71 upstream.
This patch (as1405) fixes a small bug in ehci-hcd's isochronous scheduler. Not all EHCI controllers are PCI, and the code shouldn't assume that they are. Instead, introduce a special flag for controllers which need to delay iso scheduling for full-speed devices beyond the scheduling threshold.
--- drivers/usb/host/ehci-pci.c | 1 + drivers/usb/host/ehci-sched.c | 10 ++++------ drivers/usb/host/ehci.h | 1 + 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/usb/host/ehci-pci.c +1 -0
@@ -114,6 +114,7 @@ static int ehci_pci_setup(struct usb_hcdbreak ;case PCI_VENDOR_ID_INTEL : ehci->need_io_watchdog =0 ; + ehci->fs_i_thresh =1 ;if (pdev->device ==0x27cc ) { ehci->broken_periodic =1 ;ehci_info (ehci,"using broken periodic workaround\n" );
drivers/usb/host/ehci-sched.c +4 -6
@@ -1400,7 +1400,6 @@ iso_stream_schedule (int status;unsigned mod = ehci->periodic_size <<3 ;struct ehci_iso_sched *sched = urb->hcpriv; -struct pci_dev *pdev;if (sched->span > (mod -SCHEDULE_SLOP )) {ehci_dbg (ehci,"iso request %p too long\n" , urb);
@@ -1427,15 +1426,14 @@ iso_stream_schedule (* slot in the schedule, implicitly assuming URB_ISO_ASAP. */ if (likely (!list_empty (&stream->td_list))) { - pdev =to_pci_dev (ehci_to_hcd (ehci)->self.controller); start = stream->next_uframe;/* For high speed devices, allow scheduling within the -* isochronous scheduling threshold. For full speed devices, -* don't. (Work around for Intel ICH9 bug.) +* isochronous scheduling threshold. For full speed devices +* and Intel PCI-based controllers, don't (work around for +* Intel ICH9 bug). */ -if (!stream->highspeed && - pdev->vendor ==PCI_VENDOR_ID_INTEL ) +if (!stream->highspeed && ehci->fs_i_thresh) next = now + ehci->i_thresh;else next = now;
drivers/usb/host/ehci.h +1 -0
@@ -130,6 +130,7 @@ struct ehci_hcd { /* one per controlle unsigned has_amcc_usb23:1; unsigned need_io_watchdog:1; unsigned broken_periodic:1; + unsigned fs_i_thresh:1; /* Intel iso scheduling *//* required for usb32 quirk */ #define OHCI_CTRL_HCFS (3 << 6)
PATCH 53/67 USB: cp210x: Add four new device IDs
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alessio Igor Bogani <[email protected]>
commit 356c5a4834a74c621715f7a7f16ded914eecbd3c upstream.
--- drivers/usb/serial/cp210x.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/cp210x.c +4 -0
@@ -126,6 +126,10 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ + { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ + { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ + { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ + { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ { } /* Terminating Entry */ };
PATCH 54/67 USB: usbtest: avoid to free coherent buffer in atomic context
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ming Lei <[email protected]>
commit e10e1bec8e6654de4591ef45ddd6a6d1e5b2591c upstream.
This patch fixes the warning below:
[30753.755998] ------------[ cut here ]------------ [30753.755998] WARNING: at /home/tom/git/linux-2.6/linux-2.6-next/arch/x86/include/asm/dma-mapping.h:155 hcd_buffer_free+0xb1/0xd4 [usbcore]() [30753.755998] Hardware name: 6475EK2 [30753.755998] Modules linked in: uvcvideo ehci_hcd usbtest cdc_ether usbnet vfat fat usb_storage nfsd lockd nfs_acl auth_rpcgss exportfs mii tun videodev v4l1_compat v4l2_compat_ioctl32 fuse bridge stp llc sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf kvm_intel kvm arc4 ecb ath5k usbhid mac80211 snd_hda_codec_conexant ch341 usbserial ath cfg80211 thinkpad_acpi snd_hda_intel pcspkr wmi hwmon yenta_socket iTCO_wdt iTCO_vendor_support i2c_i801 e1000e snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc pata_acpi uhci_hcd ohci_hcd usbcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: uvcvideo] [30753.755998] Pid: 0, comm: swapper Tainted: G W 2.6.35-rc6-gkh-wl+ #49 [30753.755998] Call Trace: [30753.755998] <IRQ> [<ffffffff8104478a>] warn_slowpath_common+0x80/0x98 [30753.755998] [<ffffffff810447b7>] warn_slowpath_null+0x15/0x17 [30753.755998] [<ffffffffa00ce02d>] hcd_buffer_free+0xb1/0xd4 [usbcore] [30753.755998] [<ffffffffa00c1345>] usb_free_coherent+0x1c/0x1e [usbcore] [30753.755998] [<ffffffffa00b13e4>] simple_free_urb+0x23/0x2f [usbtest] [30753.755998] [<ffffffffa00b210b>] iso_callback+0xbb/0x10f [usbtest] [30753.755998] [<ffffffffa00c7390>] usb_hcd_giveback_urb+0x8c/0xc0 [usbcore] [30753.755998] [<ffffffffa0449b35>] ehci_urb_done+0x84/0x95 [ehci_hcd] [30753.755998] [<ffffffffa044b5a5>] ehci_work+0x41a/0x7dd [ehci_hcd] [30753.755998] [<ffffffffa044e298>] ehci_irq+0x33b/0x370 [ehci_hcd] [30753.755998] [<ffffffff8100fb05>] ? sched_clock+0x9/0xd [30753.755998] [<ffffffff8105e641>] ? sched_clock_local+0x1c/0x82 [30753.755998] [<ffffffff8105e76a>] ? sched_clock_cpu+0xc3/0xce [30753.755998] [<ffffffff81067c7e>] ? trace_hardirqs_off+0xd/0xf [30753.755998] [<ffffffff8105e7b8>] ? cpu_clock+0x43/0x5e [30753.755998] [<ffffffffa00c6999>] usb_hcd_irq+0x45/0xa1 [usbcore] [30753.755998] [<ffffffff81092e02>] handle_IRQ_event+0x20/0xa5 [30753.755998] [<ffffffff81094cea>] handle_fasteoi_irq+0x92/0xd2 [30753.755998] [<ffffffff8100c0ed>] handle_irq+0x1f/0x2a [30753.755998] [<ffffffff8100b75d>] do_IRQ+0x57/0xbe [30753.755998] [<ffffffff8136a693>] ret_from_intr+0x0/0x16 [30753.755998] <EOI> [<ffffffff81223baa>] ? acpi_idle_enter_bm+0x231/0x269 [30753.755998] [<ffffffff81223ba3>] ? acpi_idle_enter_bm+0x22a/0x269 [30753.755998] [<ffffffff812c4b6b>] cpuidle_idle_call+0x99/0xce [30753.755998] [<ffffffff81008dd5>] cpu_idle+0x61/0xaa [30753.755998] [<ffffffff8136374b>] start_secondary+0x1c2/0x1c6 [30753.755998] ---[ end trace 904cfaf7ab4cb1a2 ]---
--- drivers/usb/misc/usbtest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/usb/misc/usbtest.c +5 -1
@@ -1378,7 +1378,6 @@ static void iso_callback (struct urb *urbreak ; } } -simple_free_urb (urb); ctx->pending--;if (ctx->pending ==0 ) {
@@ -1495,6 +1494,7 @@ test_iso_queue (struct usbtest_dev *dev, }simple_free_urb (urbs [i]); + urbs[i] =NULL ; context.pending--; context.submit_error =1 ;break ;
@@ -1504,6 +1504,10 @@ test_iso_queue (struct usbtest_dev *dev,wait_for_completion (&context.done); +for (i =0 ; i < param->sglen; i++) { +if (urbs[i]) +simple_free_urb (urbs[i]); + }/* * Isochronous transfers are expected to fail sometimes. As an * arbitrary limit, we will report an error if any submissions
PATCH 56/67 USB: serial: fix stalled writes
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johan Hovold <[email protected]>
commit b58af4066d240b18b43f202e07b9ec7461d90b17 upstream.
As David VomLehn points out, it was possible to receive an interrupt before clearing the free-urb flag which could lead to the urb being incorrectly marked as busy.
For the same reason, move tx_bytes accounting so that it will never be negative.
Note that the free-flags set and clear operations do not need any additional locking as they are manipulated while USB_SERIAL_WRITE_BUSY is set.
--- drivers/usb/serial/generic.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/usb/serial/generic.c +10 -5
@@ -208,18 +208,23 @@ retry: urb->transfer_buffer_length = count;usb_serial_debug_data (debug, &port->dev, __func__, count, urb->transfer_buffer); +spin_lock_irqsave (&port->lock, flags); + port->tx_bytes += count; +spin_unlock_irqrestore (&port->lock, flags); + +clear_bit (i, &port->write_urbs_free); result =usb_submit_urb (urb,GFP_ATOMIC );if (result) {dev_err (&port->dev,"%s - error submitting urb: %d\n" , __func__, result); +set_bit (i, &port->write_urbs_free); +spin_lock_irqsave (&port->lock, flags); + port->tx_bytes -= count; +spin_unlock_irqrestore (&port->lock, flags); +clear_bit_unlock (USB_SERIAL_WRITE_BUSY , &port->flags);return result; } -clear_bit (i, &port->write_urbs_free); - -spin_lock_irqsave (&port->lock, flags); - port->tx_bytes += count; -spin_unlock_irqrestore (&port->lock, flags);/* Try sending off another urb, unless in irq context (in which case * there will be no free urb). */
PATCH 60/67 mtd: gen_nand: fix support for multiple chips
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Marek Vasut <[email protected]>
commit 81cbb0b17796d81cbd92defe113cf2a7c7a21fbb upstream.
This patch corrects a problem where gen_nand driver assumed there can be only one chip and ignored the pdata->chip.nr_chips value.
--- drivers/mtd/nand/plat_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/plat_nand.c +1 -1
@@ -91,7 +91,7 @@ static int __devinit plat_nand_probe(str }/* Scan to find existance of the device */ -if (nand_scan (&data->mtd,1 )) { +if (nand_scan (&data->mtd, pdata->chip.nr_chips)) { err = -ENXIO ; goto out; }
PATCH 63/67 net: Fix NETDEV_NOTIFY_PEERS to not conflict with NETDEV_BONDING_DESLAVE.
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
commit 38117d1495e587fbb10d6e55733139a27893cef5 upstream.
--- include/linux/notifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/notifier.h +1 -1
@@ -210,7 +210,7 @@ static inline int notifier_to_errno(int#define NETDEV_POST_INIT 0x0010#define NETDEV_UNREGISTER_BATCH 0x0011#define NETDEV_BONDING_DESLAVE 0x0012 -#define NETDEV_NOTIFY_PEERS 0x0012 +#define NETDEV_NOTIFY_PEERS 0x0013#define SYS_DOWN 0x0001/* Notify of system down */ #define SYS_RESTART SYS_DOWN
PATCH 66/67 crypto: testmgr - add an option to disable cryptoalgos self-tests
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexander Shishkin <[email protected]>
commit 0b767f96164b2b27488e3daa722ff16e89d49314 upstream.
By default, CONFIG_CRYPTO_MANAGER_TESTS will be enabled and thus self-tests will still run, but it is now possible to disable them to gain some time during bootup.
--- crypto/Kconfig | 8 ++++++++ crypto/algboss.c | 4 ++++ crypto/testmgr.c | 14 ++++++++++++++ 3 files changed, 26 insertions(+)
crypto/Kconfig +8 -0
@@ -96,6 +96,14 @@ config CRYPTO_MANAGER2 select CRYPTO_BLKCIPHER2 select CRYPTO_PCOMP +config CRYPTO_MANAGER_TESTS + bool "Run algolithms' self-tests" + default y + depends on CRYPTO_MANAGER2 + help + Run cryptomanager's tests for the new crypto algorithms being + registered. + config CRYPTO_GF128MUL tristate "GF(2^128) multiplication functions (EXPERIMENTAL)" depends on EXPERIMENTAL
crypto/algboss.c +4 -0
@@ -206,6 +206,7 @@ err:return NOTIFY_OK ; } +#ifdef CONFIG_CRYPTO_MANAGER_TESTS static int cryptomgr_test (void *data) {struct crypto_test_param *param = data;
@@ -266,6 +267,7 @@ err_put_module: err: return NOTIFY_OK; } +#endif /* CONFIG_CRYPTO_MANAGER_TESTS */ static int cryptomgr_notify (struct notifier_block *this,unsigned long msg,void *data)
@@ -273,8 +275,10 @@ static int cryptomgr_notify(struct notifswitch (msg) {case CRYPTO_MSG_ALG_REQUEST :return cryptomgr_schedule_probe (data); +#ifdef CONFIG_CRYPTO_MANAGER_TESTS case CRYPTO_MSG_ALG_REGISTER :return cryptomgr_schedule_test (data); +#endif }return NOTIFY_DONE ;
crypto/testmgr.c +14 -0
@@ -22,6 +22,17 @@#include <crypto/rng.h> #include "internal.h" + +#ifndef CONFIG_CRYPTO_MANAGER_TESTS + +/* a perfect nop */ +int alg_test (const char *driver,const char *alg,u32 type,u32 mask) +{ +return 0 ; +} + +#else +#include "testmgr.h" /*
@@ -2530,4 +2541,7 @@ notest: non_fips_alg: return -EINVAL; } + +#endif /* CONFIG_CRYPTO_MANAGER_TESTS */ +EXPORT_SYMBOL_GPL (alg_test);
PATCH 67/67 ext4: fix freeze deadlock under IO
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Sandeen <[email protected]>
commit 437f88cc031ffe7f37f3e705367f4fe1f4be8b0f upstream.
Commit 6b0310fbf087ad6 caused a regression resulting in deadlocks when freezing a filesystem which had active IO; the vfs_check_frozen level (SB_FREEZE_WRITE) did not let the freeze-related IO syncing through. Duh.
Changing the test to FREEZE_TRANS should let the normal freeze syncing get through the fs, but still block any transactions from starting once the fs is completely frozen.
I tested this by running fsstress in the background while periodically snapshotting the fs and running fsck on the result. I ran into occasional deadlocks, but different ones. I think this is a fine fix for the problem at hand, and the other deadlocky things will need more investigation.
--- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/super.c +2 -2
@@ -241,7 +241,7 @@ handle_t *ext4_journal_start_sb(struct sif (sb->s_flags &MS_RDONLY )return ERR_PTR (-EROFS ); -vfs_check_frozen (sb,SB_FREEZE_WRITE ); +vfs_check_frozen (sb,SB_FREEZE_TRANS );/* Special case here: if the journal has aborted behind our * backs (eg. EIO in the commit thread), then we still need to * take the FS itself readonly cleanly. */
@@ -3491,7 +3491,7 @@ int ext4_force_commit(struct super_block journal =EXT4_SB (sb)->s_journal;if (journal) { -vfs_check_frozen (sb,SB_FREEZE_WRITE ); +vfs_check_frozen (sb,SB_FREEZE_TRANS ); ret =ext4_journal_force_commit (journal); }
PATCH 62/67 jfs: dont allow os2 xattr namespace overlap with others
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Kleikamp <[email protected]>
commit aca0fa34bdaba39bfddddba8ca70dba4782e8fe6 upstream.
It's currently possible to bypass xattr namespace access rules by prefixing valid xattr names with "os2.", since the os2 namespace stores extended attributes in a legacy format with no prefix.
This patch adds checking to deny access to any valid namespace prefix following "os2.".
--- fs/jfs/xattr.c | 87 ++++++++++++++++++++++++--------------------------------- 1 file changed, 38 insertions(+), 49 deletions(-)
fs/jfs/xattr.c +38 -49
@@ -86,46 +86,25 @@ struct ea_buffer {#define EA_MALLOC 0x0008 +static int is_known_namespace (const char *name) +{ +if (strncmp (name,XATTR_SYSTEM_PREFIX ,XATTR_SYSTEM_PREFIX_LEN ) && +strncmp (name,XATTR_USER_PREFIX ,XATTR_USER_PREFIX_LEN ) && +strncmp (name,XATTR_SECURITY_PREFIX ,XATTR_SECURITY_PREFIX_LEN ) && +strncmp (name,XATTR_TRUSTED_PREFIX ,XATTR_TRUSTED_PREFIX_LEN )) +return false; + +return true; +} +/* * These three routines are used to recognize on-disk extended attributes * that are in a recognized namespace. If the attribute is not recognized, * "os2." is prepended to the name */ -static inline int is_os2_xattr (struct jfs_ea *ea) +static int is_os2_xattr (struct jfs_ea *ea) { -/* -* Check for "system." -*/ -if ((ea->namelen >=XATTR_SYSTEM_PREFIX_LEN ) && - !strncmp (ea->name,XATTR_SYSTEM_PREFIX ,XATTR_SYSTEM_PREFIX_LEN )) -return false; -/* -* Check for "user." -*/ -if ((ea->namelen >=XATTR_USER_PREFIX_LEN ) && - !strncmp (ea->name,XATTR_USER_PREFIX ,XATTR_USER_PREFIX_LEN )) -return false; -/* -* Check for "security." -*/ -if ((ea->namelen >=XATTR_SECURITY_PREFIX_LEN ) && - !strncmp (ea->name,XATTR_SECURITY_PREFIX , -XATTR_SECURITY_PREFIX_LEN )) -return false; -/* -* Check for "trusted." -*/ -if ((ea->namelen >=XATTR_TRUSTED_PREFIX_LEN ) && - !strncmp (ea->name,XATTR_TRUSTED_PREFIX ,XATTR_TRUSTED_PREFIX_LEN )) -return false; -/* -* Add any other valid namespace prefixes here -*/ - -/* -* We assume it's OS/2's flat namespace -*/ -return true; +return !is_known_namespace (ea->name); }static inline int name_size (struct jfs_ea *ea)
@@ -764,13 +743,23 @@ static int can_set_xattr(struct inode *iif (!strncmp (name,XATTR_SYSTEM_PREFIX ,XATTR_SYSTEM_PREFIX_LEN ))return can_set_system_xattr (inode, name, value, value_len); +if (!strncmp (name,XATTR_OS2_PREFIX ,XATTR_OS2_PREFIX_LEN )) { +/* +* This makes sure that we aren't trying to set an +* attribute in a different namespace by prefixing it +* with "os2." +*/ +if (is_known_namespace (name +XATTR_OS2_PREFIX_LEN )) +return -EOPNOTSUPP ; +return 0 ; + } +/* * Don't allow setting an attribute in an unknown namespace. */ if (strncmp (name,XATTR_TRUSTED_PREFIX ,XATTR_TRUSTED_PREFIX_LEN ) &&strncmp (name,XATTR_SECURITY_PREFIX ,XATTR_SECURITY_PREFIX_LEN ) && -strncmp (name,XATTR_USER_PREFIX ,XATTR_USER_PREFIX_LEN ) && -strncmp (name,XATTR_OS2_PREFIX ,XATTR_OS2_PREFIX_LEN )) +strncmp (name,XATTR_USER_PREFIX ,XATTR_USER_PREFIX_LEN ))return -EOPNOTSUPP ;return 0 ;
@@ -952,19 +941,8 @@ ssize_t __jfs_getxattr(struct inode *inoint xattr_size;ssize_t size;int namelen =strlen (name); -char *os2name =NULL ;char *value; -if (strncmp (name,XATTR_OS2_PREFIX ,XATTR_OS2_PREFIX_LEN ) ==0 ) { - os2name =kmalloc (namelen -XATTR_OS2_PREFIX_LEN +1 , -GFP_KERNEL ); -if (!os2name) -return -ENOMEM ; -strcpy (os2name, name +XATTR_OS2_PREFIX_LEN ); - name = os2name; - namelen -=XATTR_OS2_PREFIX_LEN ; - } -down_read (&JFS_IP (inode)->xattr_sem); xattr_size =ea_get (inode, &ea_buf,0 );
@@ -1002,8 +980,6 @@ ssize_t __jfs_getxattr(struct inode *ino out:up_read (&JFS_IP (inode)->xattr_sem); -kfree (os2name); -return size; }
@@ -1012,6 +988,19 @@ ssize_t jfs_getxattr(struct dentry *dent {int err; +if (strncmp (name,XATTR_OS2_PREFIX ,XATTR_OS2_PREFIX_LEN ) ==0 ) { +/* +* skip past "os2." prefix +*/ + name +=XATTR_OS2_PREFIX_LEN ; +/* +* Don't allow retrieving properly prefixed attributes +* by prepending them with "os2." +*/ +if (is_known_namespace (name)) +return -EOPNOTSUPP ; + } + err =__jfs_getxattr (dentry->d_inode, name, data, buf_size);return err;
PATCH 61/67 l2tp: fix export of header file for userspace
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Chapman <[email protected]>
commit 4565956dc0847985c0403c9ebbf274b6a122e1e2 upstream.
The header file l2tp.h should be exported to the installed include/linux/ tree for userspace programs.
This patch fixes compilation errors in L2TP userspace apps which want to use the new L2TP support introduced in 2.6.35.
--- include/linux/Kbuild | 1 + 1 file changed, 1 insertion(+)
include/linux/Kbuild +1 -0
@@ -276,6 +276,7 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCA $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) unifdef-y += kvm_para.h endif +unifdef-y += l2tp.h unifdef-y += llc.h unifdef-y += loop.h unifdef-y += lp.h
PATCH 59/67 mtd: mxc_nand: fix unbalanced enable for IRQ
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Bénard <[email protected]>
commit 6a8cfcfb0de881735df4031eb5cc99be3d0971e9 upstream.
* preset should be done before sending the reset command
* without this, I get the following error on an i.MX35 :
[ 0.900000] ------------[ cut here ]------------ [ 0.900000] WARNING: at kernel/irq/manage.c:290 __enable_irq+0x4c/0x88() [ 0.900000] Unbalanced enable for IRQ 33 [ 0.900000] Modules linked in: [ 0.900000] [<c002ffb8>] (unwind_backtrace+0x0/0xf0) from [<c02f7d0c>] (dump_stack+0x18/0x1c) [ 0.900000] [<c02f7d0c>] (dump_stack+0x18/0x1c) from [<c0049a44>] (warn_slowpath_common+0x54/0x6c) [ 0.900000] [<c0049a44>] (warn_slowpath_common+0x54/0x6c) from [<c0049b00>] (warn_slowpath_fmt+0x38/0x40) [ 0.900000] [<c0049b00>] (warn_slowpath_fmt+0x38/0x40) from [<c008f65c>] (__enable_irq+0x4c/0x88) [ 0.900000] [<c008f65c>] (__enable_irq+0x4c/0x88) from [<c008fca0>] (enable_irq+0x54/0x98) [ 0.900000] [<c008fca0>] (enable_irq+0x54/0x98) from [<c021e618>] (wait_op_done+0x40/0x134) [ 0.900000] [<c021e618>] (wait_op_done+0x40/0x134) from [<c021e808>] (send_cmd+0x30/0x38) [ 0.900000] [<c021e808>] (send_cmd+0x30/0x38) from [<c021eb8c>] (mxc_nand_command+0x26c/0x328) [ 0.900000] [<c021eb8c>] (mxc_nand_command+0x26c/0x328) from [<c021aa60>] (nand_scan_ident+0x188/0x6c0) [ 0.900000] [<c021aa60>] (nand_scan_ident+0x188/0x6c0) from [<c001a9cc>] (mxcnd_probe+0x2b8/0x3d0) [ 0.900000] [<c001a9cc>] (mxcnd_probe+0x2b8/0x3d0) from [<c01f9e88>] (platform_drv_probe+0x20/0x24) [ 0.900000] [<c01f9e88>] (platform_drv_probe+0x20/0x24) from [<c01f8c38>] (driver_probe_device+0xb0/0x164) [ 0.900000] [<c01f8c38>] (driver_probe_device+0xb0/0x164) from [<c01f8d54>] (__driver_attach+0x68/0x8c) [ 0.900000] [<c01f8d54>] (__driver_attach+0x68/0x8c) from [<c01f8348>] (bus_for_each_dev+0x50/0x84) [ 0.900000] [<c01f8348>] (bus_for_each_dev+0x50/0x84) from [<c01f8a9c>] (driver_attach+0x20/0x28) [ 0.900000] [<c01f8a9c>] (driver_attach+0x20/0x28) from [<c01f7c00>] (bus_add_driver+0x144/0x2dc) [ 0.900000] [<c01f7c00>] (bus_add_driver+0x144/0x2dc) from [<c01f906c>] (driver_register+0xb0/0x13c) [ 0.900000] [<c01f906c>] (driver_register+0xb0/0x13c) from [<c01fa13c>] (platform_driver_register+0x4c/0x60) [ 0.900000] [<c01fa13c>] (platform_driver_register+0x4c/0x60) from [<c01fa170>] (platform_driver_probe+0x20/0xa0) [ 0.900000] [<c01fa170>] (platform_driver_probe+0x20/0xa0) from [<c001a708>] (mxc_nd_init+0x18/0x24) [ 0.900000] [<c001a708>] (mxc_nd_init+0x18/0x24) from [<c002938c>] (do_one_initcall+0x64/0x1bc) [ 0.900000] [<c002938c>] (do_one_initcall+0x64/0x1bc) from [<c00084c4>] (kernel_init+0xe8/0x1ac) [ 0.900000] [<c00084c4>] (kernel_init+0xe8/0x1ac) from [<c002aee8>] (kernel_thread_exit+0x0/0x8) [ 0.900000] ---[ end trace 8bf72ac6ba089a19 ]--- [ 1.140000] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
--- drivers/mtd/nand/mxc_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/mxc_nand.c +1 -1
@@ -604,8 +604,8 @@ static void mxc_nand_command(struct mtd_/* Command pre-processing step */ switch (command) {case NAND_CMD_RESET : -send_cmd (host, command, false);preset (mtd); +send_cmd (host, command, false);break ;case NAND_CMD_STATUS :
PATCH 58/67 sched: Revert nohz_ratelimit() for now
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <[email protected]>
commit 396e894d289d69bacf5acd983c97cd6e21a14c08 upstream.
Norbert reported that nohz_ratelimit() causes his laptop to burn about 4W (40%) extra. For now back out the change and see if we can adjust the power management code to make better decisions.
LKML-Reference: <new-submission>
--- include/linux/sched.h | 6 ------ kernel/sched.c | 10 ---------- kernel/time/tick-sched.c | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-)
include/linux/sched.h +0 -6
@@ -274,17 +274,11 @@ extern cpumask_var_t nohz_cpu_mask;#if defined(CONFIG_SMP ) && defined(CONFIG_NO_HZ )extern int select_nohz_load_balancer (int cpu);extern int get_nohz_load_balancer (void ); -extern int nohz_ratelimit (int cpu);#else static inline int select_nohz_load_balancer (int cpu) {return 0 ; } - -static inline int nohz_ratelimit (int cpu) -{ -return 0 ; -}#endif /*
kernel/sched.c +0 -10
@@ -1232,16 +1232,6 @@ void wake_up_idle_cpu(int cpu) smp_send_reschedule(cpu); } -int nohz_ratelimit (int cpu) -{ -struct rq *rq =cpu_rq (cpu); -u64 diff = rq->clock - rq->nohz_stamp; - - rq->nohz_stamp = rq->clock; - -return diff < (NSEC_PER_SEC /HZ ) >>1 ; -} -#endif /* CONFIG_NO_HZ */ static u64 sched_avg_period (void )
kernel/time/tick-sched.c +1 -1
@@ -325,7 +325,7 @@ void tick_nohz_stop_sched_tick(int inidl }while (read_seqretry (&xtime_lock, seq));if (rcu_needs_cpu (cpu) ||printk_needs_cpu (cpu) || -arch_needs_cpu (cpu) ||nohz_ratelimit (cpu)) { +arch_needs_cpu (cpu)) { next_jiffies = last_jiffies +1 ; delta_jiffies =1 ; }else {
PATCH 57/67 Bluetooth: Added support for controller shipped with iMac i5
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Cyril Lacoux <[email protected]>
commit 0a79f67445de50ca0a8dc1d34f3cc406d89c28b2 upstream.
Device class is ff(vend.) instead of e0(wlcon).
Output from command usb-devices:
T: Bus=01 Lev=03 Prnt=03 Port=00 Cnt=01 Dev#= 6 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=05ac ProdID=8215 Rev=01.82 S: Manufacturer=Apple Inc. S: Product=Bluetooth USB Host Controller S: SerialNumber=7C6D62936607 C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
--- drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btusb.c +3 -0
@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[/* Generic Bluetooth USB device */ { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, +/* Apple iMac11,1 */ + { USB_DEVICE(0x05ac, 0x8215) }, +/* AVM BlueFRITZ! USB v2.0 */ { USB_DEVICE(0x057c, 0x3800) },
PATCH 55/67 USB: fix thread-unsafe anchor utiliy routines
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit b3e670443b7fb8a2d29831b62b44a039c283e351 upstream.
This patch fixes a race condition in two utility routines related to the removal/unlinking of urbs from an anchor.
If two threads are concurrently accessing the same anchor, both could end up with the same urb - thinking they are the exclusive owner.
Alan Stern pointed out a related issue inusb_unlink_anchored_urbs:
"The URB isn't removed from the anchor until it completes
(as a by-product of completion, in fact), which might not be for quite some time after the unlink call returns. In the meantime, the subroutine will keep trying to unlink it, over and over again."
--- drivers/usb/core/urb.c | 50 ++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-)
drivers/usb/core/urb.c +21 -29
@@ -137,6 +137,16 @@ void usb_anchor_urb(struct urb *urb, str }EXPORT_SYMBOL_GPL (usb_anchor_urb); +/* Callers must hold anchor->lock */ +static void __usb_unanchor_urb (struct urb *urb,struct usb_anchor *anchor) +{ + urb->anchor =NULL ; +list_del (&urb->anchor_list); +usb_put_urb (urb); +if (list_empty (&anchor->urb_list)) +wake_up (&anchor->wait); +} +/** * usb_unanchor_urb - unanchors an URB * @urb: pointer to the urb to anchor
@@ -156,17 +166,14 @@ void usb_unanchor_urb(struct urb *urb)return ;spin_lock_irqsave (&anchor->lock, flags); -if (unlikely (anchor != urb->anchor)) { -/* we've lost the race to another thread */ -spin_unlock_irqrestore (&anchor->lock, flags); -return ; - } - urb->anchor =NULL ; -list_del (&urb->anchor_list); +/* +* At this point, we could be competing with another thread which +* has the same intention. To protect the urb from being unanchored +* twice, only the winner of the race gets the job. +*/ +if (likely (anchor == urb->anchor)) +__usb_unanchor_urb (urb, anchor);spin_unlock_irqrestore (&anchor->lock, flags); -usb_put_urb (urb); -if (list_empty (&anchor->urb_list)) -wake_up (&anchor->wait); }EXPORT_SYMBOL_GPL (usb_unanchor_urb);
@@ -749,20 +756,11 @@ EXPORT_SYMBOL_GPL(usb_unpoison_anchored_void usb_unlink_anchored_urbs (struct usb_anchor *anchor) {struct urb *victim; -unsigned long flags; -spin_lock_irqsave (&anchor->lock, flags); -while (!list_empty (&anchor->urb_list)) { - victim = list_entry(anchor->urb_list.prev, struct urb, - anchor_list); -usb_get_urb (victim); -spin_unlock_irqrestore (&anchor->lock, flags); -/* this will unanchor the URB */ +while ((victim =usb_get_from_anchor (anchor)) !=NULL ) {usb_unlink_urb (victim);usb_put_urb (victim); -spin_lock_irqsave (&anchor->lock, flags); } -spin_unlock_irqrestore (&anchor->lock, flags); }EXPORT_SYMBOL_GPL (usb_unlink_anchored_urbs);
@@ -799,12 +797,11 @@ struct urb *usb_get_from_anchor(struct u victim = list_entry(anchor->urb_list.next, struct urb, anchor_list);usb_get_urb (victim); -spin_unlock_irqrestore (&anchor->lock, flags); -usb_unanchor_urb (victim); +__usb_unanchor_urb (victim, anchor); }else { -spin_unlock_irqrestore (&anchor->lock, flags); victim =NULL ; } +spin_unlock_irqrestore (&anchor->lock, flags);return victim; }
@@ -826,12 +823,7 @@ void usb_scuttle_anchored_urbs(struct uswhile (!list_empty (&anchor->urb_list)) { victim = list_entry(anchor->urb_list.prev, struct urb, anchor_list); -usb_get_urb (victim); -spin_unlock_irqrestore (&anchor->lock, flags); -/* this may free the URB */ -usb_unanchor_urb (victim); -usb_put_urb (victim); -spin_lock_irqsave (&anchor->lock, flags); +__usb_unanchor_urb (victim, anchor); }spin_unlock_irqrestore (&anchor->lock, flags); }
PATCH 52/67 USB: ftdi_sio: device id for Navitator
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: [email protected] <[email protected]>
commit b6180ef7c99574c3350bbffa2a3a9d675321543d upstream.
This patch is to add a US Interface, Inc. "Navigator" USB device. Specifically, it's a HAM Radio USB sound modem that also incorporates three pairs of unique FTDI serial ports. The standard Linux FTDI serial driver will only recognize the first two serial ports of an unknown FDTI derived device and this patch adds in recognition to these specific new IDs.
--- drivers/usb/serial/ftdi_sio.c | 3 +++ drivers/usb/serial/ftdi_sio_ids.h | 5 +++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +3 -0
@@ -157,6 +157,9 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
drivers/usb/serial/ftdi_sio_ids.h +5 -0
@@ -40,6 +40,11 @@#define FTDI_NXTCAM_PID 0xABB8/* NXTCam for Mindstorms NXT */ +/* US Interface Navigator (http://www.usinterface.com/) */ +#define FTDI_USINT_CAT_PID 0xb810/* Navigator CAT and 2nd PTT lines */ +#define FTDI_USINT_WKEY_PID 0xb811/* Navigator WKEY and FSK lines */ +#define FTDI_USINT_RS232_PID 0xb812/* Navigator RS232 and CONFIG lines */ +/* OOCDlink by Joern Kaipf <[email protected]> * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */ #define FTDI_OOCDLINK_PID 0xbaf8/* Amontec JTAGkey */
PATCH 51/67 USB: option: add huawei k3765 k4505 devices to work properly
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Bird <[email protected]>
commit 0372a754be9aa43e19fd86c9bc04796d43b55e38 upstream.
This patch adds the product IDs of Huawei's K3765 and K4505 mobile broadband usb modems to option.c. It also adds a quirk to the option probe function so that binding to the device's network interface(class 0xff) is avoided. This is necessary to allow another driver to bind to that, and to avoid programs like wvdial opening a nonfunctioning tty during modem discovery.
--- drivers/usb/serial/option.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/usb/serial/option.c +11 -0
@@ -145,6 +145,8 @@ static void option_instat_callback(struc#define HUAWEI_PRODUCT_E143D 0x143D#define HUAWEI_PRODUCT_E143E 0x143E#define HUAWEI_PRODUCT_E143F 0x143F +#define HUAWEI_PRODUCT_K4505 0x1464 +#define HUAWEI_PRODUCT_K3765 0x1465#define HUAWEI_PRODUCT_E14AC 0x14AC#define HUAWEI_PRODUCT_ETS1220 0x1803
@@ -483,6 +485,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) }, { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
@@ -1019,6 +1023,13 @@ static int option_probe(struct usb_seria serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)return -ENODEV ; +/* Don't bind network interfaces on Huawei K3765 & K4505 */ +if (serial->dev->descriptor.idVendor ==HUAWEI_VENDOR_ID && + (serial->dev->descriptor.idProduct ==HUAWEI_PRODUCT_K3765 || + serial->dev->descriptor.idProduct ==HUAWEI_PRODUCT_K4505 ) && + serial->interface->cur_altsetting->desc.bInterfaceNumber ==1 ) +return -ENODEV ; + data = serial->private =kzalloc (sizeof (struct usb_wwan_intf_private ),GFP_KERNEL );if (!data)
PATCH 50/67 USB: option: Huawei ETS 1220 support added
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Kazlou <[email protected]>
commit b972302b0a13aaddc9e90da2b4b52722e5d0e776 upstream.
The patch adds Huawei ETS 1220 product id into the list of supported devices in 'option' usb serial driver.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -146,6 +146,7 @@ static void option_instat_callback(struc#define HUAWEI_PRODUCT_E143E 0x143E#define HUAWEI_PRODUCT_E143F 0x143F#define HUAWEI_PRODUCT_E14AC 0x14AC +#define HUAWEI_PRODUCT_ETS1220 0x1803#define QUANTA_VENDOR_ID 0x0408#define QUANTA_PRODUCT_Q101 0xEA02
@@ -482,6 +483,7 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) }, { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
PATCH 49/67 USB: serial: enabling support for Segway RMP in ftdi_sio
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: John G. Rogers <[email protected]>
commit afad19648f70c6493193e0a774bd754b7790b4a0 upstream.
I have added the ProductID=0xe729 VendorID=FTDI_VID=0x0403 which will enable support for the Segway Robotic Mobility Platform (RMP200) in the ftdi_sio kernel module. Currently, users of the Segway RMP200 must use a RUN+="/sbin/modprobe -q ftdi-sio product=0xe729 vendor=0x0403 in a udev rule to get the ftdi_sio module to handle the usb interface and mount it on /dev/ttyXXX. This is not a good solution because some users will have multiple USB to Serial converters which will use the ftdi_sio module.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 5 +++++ 2 files changed, 6 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -746,6 +746,7 @@ static struct usb_device_id id_table_com .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, { }, /* Optional parameter entry */ { }/* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +5 -0
@@ -1032,3 +1032,8 @@#define XVERVE_SIGNALYZER_SH2_PID 0xBCA2#define XVERVE_SIGNALYZER_SH4_PID 0xBCA4 +/* +* Segway Robotic Mobility Platform USB interface (using VID 0x0403) +* Submitted by John G. Rogers +*/ +#define SEGWAY_RMP200_PID 0xe729
PATCH 45/67 USB: musb: use correct register widths in register dumps
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Anand Gadiyar <[email protected]>
commit 0936fb5e92a90476959447ad8ae5d780afbbd930 upstream.
DMA_ADDR and DMA_COUNT are 32-bit registers, not 16-bit.
Marking them as 16-bit in the table causes only the lower 16-bits to be dumped and this is misleading.
--- drivers/usb/musb/musb_debugfs.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/usb/musb/musb_debugfs.c +16 -16
@@ -92,29 +92,29 @@ static const struct musb_register_map mu { "LS_EOF1", 0x7E, 8 }, { "SOFT_RST", 0x7F, 8 }, { "DMA_CNTLch0", 0x204, 16 }, - { "DMA_ADDRch0", 0x208, 16 }, - { "DMA_COUNTch0", 0x20C, 16 }, + { "DMA_ADDRch0", 0x208, 32 }, + { "DMA_COUNTch0", 0x20C, 32 }, { "DMA_CNTLch1", 0x214, 16 }, - { "DMA_ADDRch1", 0x218, 16 }, - { "DMA_COUNTch1", 0x21C, 16 }, + { "DMA_ADDRch1", 0x218, 32 }, + { "DMA_COUNTch1", 0x21C, 32 }, { "DMA_CNTLch2", 0x224, 16 }, - { "DMA_ADDRch2", 0x228, 16 }, - { "DMA_COUNTch2", 0x22C, 16 }, + { "DMA_ADDRch2", 0x228, 32 }, + { "DMA_COUNTch2", 0x22C, 32 }, { "DMA_CNTLch3", 0x234, 16 }, - { "DMA_ADDRch3", 0x238, 16 }, - { "DMA_COUNTch3", 0x23C, 16 }, + { "DMA_ADDRch3", 0x238, 32 }, + { "DMA_COUNTch3", 0x23C, 32 }, { "DMA_CNTLch4", 0x244, 16 }, - { "DMA_ADDRch4", 0x248, 16 }, - { "DMA_COUNTch4", 0x24C, 16 }, + { "DMA_ADDRch4", 0x248, 32 }, + { "DMA_COUNTch4", 0x24C, 32 }, { "DMA_CNTLch5", 0x254, 16 }, - { "DMA_ADDRch5", 0x258, 16 }, - { "DMA_COUNTch5", 0x25C, 16 }, + { "DMA_ADDRch5", 0x258, 32 }, + { "DMA_COUNTch5", 0x25C, 32 }, { "DMA_CNTLch6", 0x264, 16 }, - { "DMA_ADDRch6", 0x268, 16 }, - { "DMA_COUNTch6", 0x26C, 16 }, + { "DMA_ADDRch6", 0x268, 32 }, + { "DMA_COUNTch6", 0x26C, 32 }, { "DMA_CNTLch7", 0x274, 16 }, - { "DMA_ADDRch7", 0x278, 16 }, - { "DMA_COUNTch7", 0x27C, 16 }, + { "DMA_ADDRch7", 0x278, 32 }, + { "DMA_COUNTch7", 0x27C, 32 }, { } /* Terminating Entry */ };
PATCH 44/67 ARM: 6280/1: imx: Fix build failure when including <mach/gpio.h> without <linux/spinlock.h>
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Uwe Kleine-König <[email protected]>
commit 868003ca7ad17ac6c1606dc36101f10a7825b399 upstream.
This is a follow up to
14cb0de (arm/imx/gpio: add spinlock protection)
and fixes the following build failure:
CC arch/arm/mach-imx/pcm970-baseboard.o
In file included from arch/arm/include/asm/gpio.h:6,
from include/linux/gpio.h:8,
from arch/arm/mach-imx/pcm970-baseboard.c:20:
arch/arm/plat-mxc/include/mach/gpio.h:40: error: expected specifier-qualifier-list before 'spinlock_t'
--- arch/arm/plat-mxc/include/mach/gpio.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/plat-mxc/include/mach/gpio.h +1 -0
@@ -19,6 +19,7 @@#ifndef __ASM_ARCH_MXC_GPIO_H__#define __ASM_ARCH_MXC_GPIO_H__ +#include <linux/spinlock.h> #include <mach/hardware.h> #include <asm-generic/gpio.h>
PATCH 43/67 ARM: 6299/1: errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Will Deacon <[email protected]>
commit cdf357f1e13a08a11261edacb3083746f65c1ed9 upstream.
On versions of the Cortex-A9 prior to r2p0, performing TLB invalidations by ASID match can result in the incorrect ASID being broadcast to other CPUs. As a consequence of this, the targetted TLB entries are not invalidated across the system.
This workaround changes the TLB flushing routines to invalidate entries regardless of the ASID.
--- arch/arm/Kconfig | 12 ++++++++++++ arch/arm/include/asm/tlbflush.h | 8 ++++++++ 2 files changed, 20 insertions(+)
arch/arm/Kconfig +12 -0
@@ -1027,6 +1027,18 @@ config PL310_ERRATA_588369 is not correctly implemented in PL310 as clean lines are not invalidated as a result of these operations. Note that this errata uses Texas Instrument's secure monitor api. + +config ARM_ERRATA_720789 + bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID" + depends on CPU_V7 && SMP + help + This option enables the workaround for the 720789 Cortex-A9 (prior to + r2p0) erratum. A faulty ASID can be sent to the other CPUs for the + broadcasted CP15 TLB maintenance operations TLBIASIDIS and TLBIMVAIS. + As a consequence of this erratum, some TLB entries which should be + invalidated are not, resulting in an incoherency in the system page + tables. The workaround changes the TLB flushing routines to invalidate + entries regardless of the ASID. endmenu source "arch/arm/common/Kconfig"
arch/arm/include/asm/tlbflush.h +8 -0
@@ -378,7 +378,11 @@ static inline void local_flush_tlb_mm(stif (tlb_flag (TLB_V6_I_ASID )) asm("mcr p15, 0, %0, c8, c5, 2" : :"r" (asid) :"cc" ); if (tlb_flag(TLB_V7_UIS_ASID)) +#ifdef CONFIG_ARM_ERRATA_720789 + asm("mcr p15, 0, %0, c8, c3, 0" : :"r" (zero) :"cc" ); +#else asm("mcr p15, 0, %0, c8, c3, 2" : :"r" (asid) :"cc" ); +#endif if (tlb_flag (TLB_BTB )) {/* flush the branch target cache */
@@ -424,7 +428,11 @@ local_flush_tlb_page(struct vm_area_struif (tlb_flag (TLB_V6_I_PAGE )) asm("mcr p15, 0, %0, c8, c5, 1" : :"r" (uaddr) :"cc" ); if (tlb_flag(TLB_V7_UIS_PAGE)) +#ifdef CONFIG_ARM_ERRATA_720789 + asm("mcr p15, 0, %0, c8, c3, 3" : :"r" (uaddr &PAGE_MASK ) :"cc" ); +#else asm("mcr p15, 0, %0, c8, c3, 1" : :"r" (uaddr) :"cc" ); +#endif if (tlb_flag (TLB_BTB )) {/* flush the branch target cache */
PATCH 42/67 smsc911x: Add spinlocks around registers access
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Catalin Marinas <[email protected]>
commit 492c5d943d6a04b124ba3a719dc746dc36b14cfb upstream.
On SMP systems, the SMSC911x registers may be accessed by multiple CPUs and this seems to put the chip in an inconsistent state. The patch adds spinlocks to the smsc911x_reg_read, smsc911x_reg_write, smsc911x_rx_readfifo and smsc911x_tx_writefifo functions.
--- drivers/net/smsc911x.c | 92 +++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 40 deletions(-)
drivers/net/smsc911x.c +52 -40
@@ -84,8 +84,7 @@ struct smsc911x_data {*/ spinlock_t mac_lock; -/* spinlock to ensure 16-bit accesses are serialised. -* unused with a 32-bit bus */ +/* spinlock to ensure register accesses are serialised */ spinlock_t dev_lock;struct phy_device *phy_dev;
@@ -118,37 +117,33 @@ struct smsc911x_data {unsigned int hashlo; }; -/* The 16-bit access functions are significantly slower, due to the locking -* necessary. If your bus hardware can be configured to do this for you -* (in response to a single 32-bit operation from software), you should use -* the 32-bit access functions instead. */ - -static inline u32 smsc911x_reg_read (struct smsc911x_data *pdata,u32 reg) +static inline u32 __smsc911x_reg_read (struct smsc911x_data *pdata,u32 reg) {if (pdata->config.flags &SMSC911X_USE_32BIT )return readl (pdata->ioaddr + reg); -if (pdata->config.flags &SMSC911X_USE_16BIT ) { -u32 data; -unsigned long flags; - -/* these two 16-bit reads must be performed consecutively, so -* must not be interrupted by our own ISR (which would start -* another read operation) */ -spin_lock_irqsave (&pdata->dev_lock, flags); - data = ((readw (pdata->ioaddr + reg) &0xFFFF ) | +if (pdata->config.flags &SMSC911X_USE_16BIT ) +return ((readw (pdata->ioaddr + reg) &0xFFFF ) | ((readw (pdata->ioaddr + reg +2 ) &0xFFFF ) <<16 )); -spin_unlock_irqrestore (&pdata->dev_lock, flags); - -return data; - }BUG ();return 0 ; } -static inline void smsc911x_reg_write (struct smsc911x_data *pdata,u32 reg, -u32 val) +static inline u32 smsc911x_reg_read (struct smsc911x_data *pdata,u32 reg) +{ +u32 data; +unsigned long flags; + +spin_lock_irqsave (&pdata->dev_lock, flags); + data =__smsc911x_reg_read (pdata, reg); +spin_unlock_irqrestore (&pdata->dev_lock, flags); + +return data; +} + +static inline void __smsc911x_reg_write (struct smsc911x_data *pdata,u32 reg, +u32 val) {if (pdata->config.flags &SMSC911X_USE_32BIT ) {writel (val, pdata->ioaddr + reg);
@@ -156,44 +151,54 @@ static inline void smsc911x_reg_write(st }if (pdata->config.flags &SMSC911X_USE_16BIT ) { -unsigned long flags; - -/* these two 16-bit writes must be performed consecutively, so -* must not be interrupted by our own ISR (which would start -* another read operation) */ -spin_lock_irqsave (&pdata->dev_lock, flags);writew (val &0xFFFF , pdata->ioaddr + reg);writew ((val >>16 ) &0xFFFF , pdata->ioaddr + reg +2 ); -spin_unlock_irqrestore (&pdata->dev_lock, flags);return ; }BUG (); } +static inline void smsc911x_reg_write (struct smsc911x_data *pdata,u32 reg, +u32 val) +{ +unsigned long flags; + +spin_lock_irqsave (&pdata->dev_lock, flags); +__smsc911x_reg_write (pdata, reg, val); +spin_unlock_irqrestore (&pdata->dev_lock, flags); +} +/* Writes a packet to the TX_DATA_FIFO */ static inline void smsc911x_tx_writefifo (struct smsc911x_data *pdata,unsigned int *buf,unsigned int wordcount) { +unsigned long flags; + +spin_lock_irqsave (&pdata->dev_lock, flags); +if (pdata->config.flags &SMSC911X_SWAP_FIFO ) {while (wordcount--) -smsc911x_reg_write (pdata,TX_DATA_FIFO ,swab32 (*buf++)); -return ; +__smsc911x_reg_write (pdata,TX_DATA_FIFO , +swab32 (*buf++)); + goto out; }if (pdata->config.flags &SMSC911X_USE_32BIT ) {writesl (pdata->ioaddr +TX_DATA_FIFO , buf, wordcount); -return ; + goto out; }if (pdata->config.flags &SMSC911X_USE_16BIT ) {while (wordcount--) -smsc911x_reg_write (pdata,TX_DATA_FIFO , *buf++); -return ; +__smsc911x_reg_write (pdata,TX_DATA_FIFO , *buf++); + goto out; }BUG (); +out: +spin_unlock_irqrestore (&pdata->dev_lock, flags); }/* Reads a packet out of the RX_DATA_FIFO */
@@ -201,24 +206,31 @@ static inline void smsc911x_rx_readfifo(struct smsc911x_data *pdata, unsigned int *buf, unsigned int wordcount) { + unsigned long flags; + +spin_lock_irqsave (&pdata->dev_lock, flags); +if (pdata->config.flags &SMSC911X_SWAP_FIFO ) {while (wordcount--) - *buf++ =swab32 (smsc911x_reg_read (pdata,RX_DATA_FIFO )); -return ; + *buf++ =swab32 (__smsc911x_reg_read (pdata, +RX_DATA_FIFO )); + goto out; }if (pdata->config.flags &SMSC911X_USE_32BIT ) {readsl (pdata->ioaddr +RX_DATA_FIFO , buf, wordcount); -return ; + goto out; }if (pdata->config.flags &SMSC911X_USE_16BIT ) {while (wordcount--) - *buf++ =smsc911x_reg_read (pdata,RX_DATA_FIFO ); -return ; + *buf++ =__smsc911x_reg_read (pdata,RX_DATA_FIFO ); + goto out; }BUG (); +out: +spin_unlock_irqrestore (&pdata->dev_lock, flags); }/* waits for MAC not busy, with timeout. Only called by smsc911x_mac_read
PATCH 41/67 pxa/cm-x300: fix ffuart registration
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Igor Grinberg <[email protected]>
commit a6cd7eb374647b572ae9e7dbfe49871e6996e8e0 upstream.
ffuart is available on cm-x300 only with pxa300.
--- arch/arm/mach-pxa/cm-x300.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-pxa/cm-x300.c +2 -1
@@ -745,9 +745,10 @@ static void __init cm_x300_init(void) {cm_x300_init_mfp (); -pxa_set_ffuart_info (NULL );pxa_set_btuart_info (NULL );pxa_set_stuart_info (NULL ); +if (cpu_is_pxa300 ()) +pxa_set_ffuart_info (NULL );cm_x300_init_da9030 ();cm_x300_init_dm9000 ();
PATCH 38/67 drbd: Disable delay probes for the upcomming release
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Philipp Reisner <[email protected]>
commit 6710a5760355be8f2e51682f41b0d3fc76550309 upstream.
--- drivers/block/drbd/drbd_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/block/drbd/drbd_main.c +1 -5
@@ -2371,11 +2371,7 @@ static int _drbd_send_zc_ee(struct drbd_static void consider_delay_probes (struct drbd_conf *mdev) { -if (mdev->state.conn !=C_SYNC_SOURCE || mdev->agreed_pro_version <93 ) -return ; - -if (mdev->dp_volume_last + mdev->sync_conf.dp_volume *2 < mdev->send_cnt) -drbd_send_delay_probes (mdev); +return ; }static int w_delay_probes (struct drbd_conf *mdev,struct drbd_work *w,int cancel)
PATCH 37/67 drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Philipp Reisner <[email protected]>
commit 85f4cc17a62c3ac9edeaf120cdae7261df458053 upstream.
--- drivers/block/drbd/drbd_main.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/block/drbd/drbd_main.c +18 -3
@@ -2660,9 +2660,24 @@ static void drbd_unplug_fn(struct requesstatic void drbd_set_defaults (struct drbd_conf *mdev) { - mdev->sync_conf.after =DRBD_AFTER_DEF ; - mdev->sync_conf.rate =DRBD_RATE_DEF ; - mdev->sync_conf.al_extents =DRBD_AL_EXTENTS_DEF ; +/* This way we get a compile error when sync_conf grows, +and we forgot to initialize it here */ + mdev->sync_conf = (struct syncer_conf ) { +/* .rate = */ DRBD_RATE_DEF , +/* .after = */ DRBD_AFTER_DEF , +/* .al_extents = */ DRBD_AL_EXTENTS_DEF , +/* .dp_volume = */ DRBD_DP_VOLUME_DEF , +/* .dp_interval = */ DRBD_DP_INTERVAL_DEF , +/* .throttle_th = */ DRBD_RS_THROTTLE_TH_DEF , +/* .hold_off_th = */ DRBD_RS_HOLD_OFF_TH_DEF , +/* .verify_alg = */ {},0 , +/* .cpu_mask = */ {},0 , +/* .csums_alg = */ {},0 , +/* .use_rle = */ 0 + }; + +/* Have to use that way, because the layout differs between +big endian and little endian */ mdev->state = (union drbd_state ) { { .role =R_SECONDARY , .peer =R_UNKNOWN ,
PATCH 35/67 ecryptfs: release reference to lower mount if interpose fails
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Lino Sanfilippo <[email protected]>
commit 31f73bee3e170b7cabb35db9e2f4bf7919b9d036 upstream.
In ecryptfs_lookup_and_interpose_lower() the lower mount is not decremented if allocation of a dentry info struct failed. As a result the lower filesystem cant be unmounted any more (since it is considered busy). This patch corrects the reference counting.
--- fs/ecryptfs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ecryptfs/inode.c +3 -2
@@ -264,7 +264,7 @@ int ecryptfs_lookup_and_interpose_lower(printk (KERN_ERR "%s: Out of memory whilst attempting " "to allocate ecryptfs_dentry_info struct\n" , __func__); - goto out_dput; + goto out_put; }ecryptfs_set_dentry_lower (ecryptfs_dentry, lower_dentry);ecryptfs_set_dentry_lower_mnt (ecryptfs_dentry, lower_mnt);
@@ -339,8 +339,9 @@ int ecryptfs_lookup_and_interpose_lower( out_free_kmem:kmem_cache_free (ecryptfs_header_cache_2, page_virt); goto out; -out_dput: +out_put:dput (lower_dentry); +mntput (lower_mnt);d_drop (ecryptfs_dentry); out:return rc;
PATCH 34/67 eCryptfs: Handle ioctl calls with unlocked and compat functions
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tyler Hicks <[email protected]>
commit c43f7b8fb03be8bcc579bfc4e6ab70eac887ab55 upstream.
Lower filesystems that only implemented unlocked_ioctl weren't being passed ioctl calls because eCryptfs only checked for lower_file->f_op->ioctl and returned -ENOTTY if it was NULL.
eCryptfs shouldn't implement ioctl(), since it doesn't require the BKL. This patch introduces ecryptfs_unlocked_ioctl() and ecryptfs_compat_ioctl(), which passes the calls on to the lower file system.
https://bugs.launchpad.net/ecryptfs/+bug/469664
--- fs/ecryptfs/file.c | 56 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 21 deletions(-)
fs/ecryptfs/file.c +35 -21
@@ -292,12 +292,40 @@ static int ecryptfs_fasync(int fd, strucreturn rc; } -static int ecryptfs_ioctl (struct inode *inode,struct file *file, -unsigned int cmd,unsigned long arg); +static long +ecryptfs_unlocked_ioctl (struct file *file,unsigned int cmd,unsigned long arg) +{ +struct file *lower_file =NULL ; +long rc = -ENOTTY ; + +if (ecryptfs_file_to_private (file)) + lower_file =ecryptfs_file_to_lower (file); +if (lower_file && lower_file->f_op && lower_file->f_op->unlocked_ioctl) + rc = lower_file->f_op->unlocked_ioctl (lower_file, cmd, arg); +return rc; +} + +#ifdef CONFIG_COMPAT +static long +ecryptfs_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg) +{ +struct file *lower_file =NULL ; +long rc = -ENOIOCTLCMD ; + +if (ecryptfs_file_to_private (file)) + lower_file =ecryptfs_file_to_lower (file); +if (lower_file && lower_file->f_op && lower_file->f_op->compat_ioctl) + rc = lower_file->f_op->compat_ioctl (lower_file, cmd, arg); +return rc; +} +#endif const struct file_operations ecryptfs_dir_fops = { .readdir = ecryptfs_readdir, - .ioctl = ecryptfs_ioctl, + .unlocked_ioctl = ecryptfs_unlocked_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = ecryptfs_compat_ioctl, +#endif .open = ecryptfs_open, .flush = ecryptfs_flush, .release = ecryptfs_release,
@@ -313,7 +341,10 @@ const struct file_operations ecryptfs_ma .write = do_sync_write, .aio_write = generic_file_aio_write, .readdir = ecryptfs_readdir, - .ioctl = ecryptfs_ioctl, + .unlocked_ioctl = ecryptfs_unlocked_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = ecryptfs_compat_ioctl, +#endif .mmap = generic_file_mmap, .open = ecryptfs_open, .flush = ecryptfs_flush,
@@ -322,20 +353,3 @@ const struct file_operations ecryptfs_ma .fasync = ecryptfs_fasync, .splice_read = generic_file_splice_read, }; - -static int -ecryptfs_ioctl (struct inode *inode,struct file *file,unsigned int cmd, -unsigned long arg) -{ -int rc =0 ; -struct file *lower_file =NULL ; - -if (ecryptfs_file_to_private (file)) - lower_file =ecryptfs_file_to_lower (file); -if (lower_file && lower_file->f_op && lower_file->f_op->ioctl) - rc = lower_file->f_op->ioctl (ecryptfs_inode_to_lower (inode), - lower_file, cmd, arg); -else - rc = -ENOTTY ; -return rc; -}
PATCH 33/67 blkdev: cgroup whitelist permission fix
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Wright <[email protected]>
commit b7300b78d1a87625975a799a109a2f98d77757c8 upstream.
The cgroup device whitelist code gets confused when trying to grant permission to a disk partition that is not currently open. Part of blkdev_open() includes __blkdev_get() on the whole disk.
Basically, the only ways to reliably allow a cgroup access to a partition on a block device when using the whitelist are to 1) also give it access to the whole block device or 2) make sure the partition is already open in a different context.
The patch avoids the cgroup check for the whole disk case when opening a partition.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=589662
--- fs/block_dev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/block_dev.c +6 -4
@@ -1339,10 +1339,12 @@ static int __blkdev_get(struct block_dev/* * hooks: /n/, see "layering violations". */ - ret =devcgroup_inode_permission (bdev->bd_inode, perm); -if (ret !=0 ) { -bdput (bdev); -return ret; +if (!for_part) { + ret =devcgroup_inode_permission (bdev->bd_inode, perm); +if (ret !=0 ) { +bdput (bdev); +return ret; + } }lock_kernel ();
PATCH 31/67 ioat2: catch and recover from broken vtd configurations v6
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
commit 556ab45f9a775bfa4762bacc0a4afb5b44b067bc upstream.
On some platforms (MacPro3,1) the BIOS assigns the ioatdma device to the incorrect iommu causing faults when the driver initializes. Add a quirk to catch this misconfiguration and try falling back to untranslated operation (which works in the MacPro3,1 case).
Assuming there are other platforms with misconfigured iommus teach the ioatdma driver to treat initialization failures as non-fatal (just fail the driver load and emit a warning instead of triggering a BUG_ON).
This can be classified as a boot regression since 2.6.32 on affected platforms since the ioatdma module did not autoload prior to that kernel.
--- drivers/dma/ioat/dma.h | 1 + drivers/dma/ioat/dma_v2.c | 24 ++++++++++++++++++++++-- drivers/dma/ioat/dma_v3.c | 5 ++++- drivers/pci/intel-iommu.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-)
drivers/dma/ioat/dma.h +1 -0
@@ -97,6 +97,7 @@ struct ioat_chan_common {#define IOAT_RESET_PENDING 2#define IOAT_KOBJ_INIT_FAIL 3#define IOAT_RESHAPE_PENDING 4 +#define IOAT_RUN 5struct timer_list timer;#define COMPLETION_TIMEOUT msecs_to_jiffies(100)#define IDLE_TIMEOUT msecs_to_jiffies(2000)
drivers/dma/ioat/dma_v2.c +22 -2
@@ -287,7 +287,10 @@ void ioat2_timer_event(unsigned long dat chanerr =readl (chan->reg_base +IOAT_CHANERR_OFFSET );dev_err (to_dev (chan),"%s: Channel halted (%x)\n" , __func__, chanerr); -BUG_ON (is_ioat_bug (chanerr)); +if (test_bit (IOAT_RUN , &chan->state)) +BUG_ON (is_ioat_bug (chanerr)); +else /* we never got off the ground */ +return ; }/* if we haven't made progress and we have already
@@ -492,6 +495,8 @@ static struct ioat_ring_ent **ioat2_alloreturn ring; } +void ioat2_free_chan_resources (struct dma_chan *c); +/* ioat2_alloc_chan_resources - allocate/initialize ioat2 descriptor ring * @chan: channel to be initialized */
@@ -500,6 +505,7 @@ int ioat2_alloc_chan_resources(struct dmstruct ioat2_dma_chan *ioat =to_ioat2_chan (c);struct ioat_chan_common *chan = &ioat->base;struct ioat_ring_ent **ring; +u64 status;int order;/* have we already been set up? */
@@ -540,7 +546,20 @@ int ioat2_alloc_chan_resources(struct dmtasklet_enable (&chan->cleanup_task);ioat2_start_null_desc (ioat); -return 1 << ioat->alloc_order; +/* check that we got off the ground */ +udelay (5 ); + status =ioat_chansts (chan); +if (is_ioat_active (status) ||is_ioat_idle (status)) { +set_bit (IOAT_RUN , &chan->state); +return 1 << ioat->alloc_order; + }else { +u32 chanerr =readl (chan->reg_base +IOAT_CHANERR_OFFSET ); + +dev_WARN (to_dev (chan), +"failed to start channel chanerr: %#x\n" , chanerr); +ioat2_free_chan_resources (c); +return -EFAULT ; + } }bool reshape_ring (struct ioat2_dma_chan *ioat,int order)
@@ -778,6 +797,7 @@ void ioat2_free_chan_resources(struct dmdel_timer_sync (&chan->timer); device->cleanup_fn ((unsigned long ) c); device->reset_hw (chan); +clear_bit (IOAT_RUN , &chan->state);spin_lock_bh (&chan->cleanup_lock);spin_lock_bh (&ioat->prep_lock);
drivers/dma/ioat/dma_v3.c +4 -1
@@ -361,7 +361,10 @@ static void ioat3_timer_event(unsigned l chanerr =readl (chan->reg_base +IOAT_CHANERR_OFFSET );dev_err (to_dev (chan),"%s: Channel halted (%x)\n" , __func__, chanerr); -BUG_ON (is_ioat_bug (chanerr)); +if (test_bit (IOAT_RUN , &chan->state)) +BUG_ON (is_ioat_bug (chanerr)); +else /* we never got off the ground */ +return ; }/* if we haven't made progress and we have already
drivers/pci/intel-iommu.c +28 -0
@@ -3030,6 +3030,34 @@ static void __init iommu_exit_mempool(vo } +static void quirk_ioat_snb_local_iommu (struct pci_dev *pdev) +{ +struct dmar_drhd_unit *drhd; +u32 vtbar; +int rc; + +/* We know that this device on this chipset has its own IOMMU. +* If we find it under a different IOMMU, then the BIOS is lying +* to us. Hope that the IOMMU for this device is actually +* disabled, and it needs no translation... +*/ + rc =pci_bus_read_config_dword (pdev->bus,PCI_DEVFN (0 ,0 ),0xb0 , &vtbar); +if (rc) { +/* "can't" happen */ +dev_info (&pdev->dev,"failed to run vt-d quirk\n" ); +return ; + } + vtbar &=0xffff0000 ; + +/* we know that the this iommu should be at offset 0xa000 from vtbar */ + drhd =dmar_find_matched_drhd_unit (pdev); +if (WARN_TAINT_ONCE (!drhd || drhd->reg_base_addr - vtbar !=0xa000 , +TAINT_FIRMWARE_WORKAROUND , +"BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n" )) + pdev->dev.archdata.iommu =DUMMY_DEVICE_DOMAIN_INFO ; +} +DECLARE_PCI_FIXUP_ENABLE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_IOAT_SNB , quirk_ioat_snb_local_iommu); +static void __init init_no_remapping_devices (void ) {struct dmar_drhd_unit *drhd;
PATCH 29/67 md/raid10: fix deadlock with unaligned read during resync
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 51e9ac77035a3dfcb6fc0a88a0d80b6f99b5edb1 upstream.
If the 'bio_split' path in raid10-read is used while resync/recovery is happening it is possible to deadlock. Fix this be elevating ->nr_waiting for the duration of both parts of the split request.
This fixes a bug that has been present since 2.6.22 but has only started manifesting recently for unknown reasons. It is suitable for and -stable since then.
--- drivers/md/raid10.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/md/raid10.c +18 -0
@@ -825,11 +825,29 @@ static int make_request(mddev_t *mddev,*/ bp =bio_split (bio, chunk_sects - (bio->bi_sector & (chunk_sects -1 )) ); + +/* Each of these 'make_request' calls will call 'wait_barrier'. +* If the first succeeds but the second blocks due to the resync +* thread raising the barrier, we will deadlock because the +* IO to the underlying device will be queued in generic_make_request +* and will never complete, so will never reduce nr_pending. +* So increment nr_waiting here so no new raise_barriers will +* succeed, and so the second wait_barrier cannot block. +*/ +spin_lock_irq (&conf->resync_lock); + conf->nr_waiting++; +spin_unlock_irq (&conf->resync_lock); +if (make_request (mddev, &bp->bio1))generic_make_request (&bp->bio1);if (make_request (mddev, &bp->bio2))generic_make_request (&bp->bio2); +spin_lock_irq (&conf->resync_lock); + conf->nr_waiting--; +wake_up (&conf->wait_barrier); +spin_unlock_irq (&conf->resync_lock); +bio_pair_release (bp);return 0 ; bad_map:
PATCH 28/67 md: fix another deadlock with removing sysfs attributes.
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit bb4f1e9d0e2ef93de8e36ca0f5f26625fcd70b7d upstream.
Move the deletion of sysfs attributes from reconfig_mutex to open_mutex didn't really help as a process can try to take open_mutex while holding reconfig_mutex, so the same deadlock can happen, just requiring one more process to be involved in the chain.
I looks like I cannot easily use locking to wait for the sysfs deletion to complete, so don't.
The only things that we cannot do while the deletions are still pending is other things which can change the sysfs namespace: run, takeover, stop. Each of these can fail with -EBUSY.
So set a flag while doing a sysfs deletion, and fail run, takeover, stop if that flag is set.
This is suitable for 2.6.35.x
--- drivers/md/md.c | 31 +++++++++++++++++-------------- drivers/md/md.h | 4 ++++ 2 files changed, 21 insertions(+), 14 deletions(-)
drivers/md/md.c +17 -14
@@ -532,13 +532,17 @@ static void mddev_unlock(mddev_t * mddev* an access to the files will try to take reconfig_mutex * while holding the file unremovable, which leads to * a deadlock. -* So hold open_mutex instead - we are allowed to take -* it while holding reconfig_mutex, and md_run can -* use it to wait for the remove to complete. +* So hold set sysfs_active while the remove in happeing, +* and anything else which might set ->to_remove or my +* otherwise change the sysfs namespace will fail with +* -EBUSY if sysfs_active is still set. +* We set sysfs_active under reconfig_mutex and elsewhere +* test it under the same mutex to ensure its correct value +* is seen. */ struct attribute_group *to_remove = mddev->to_remove; mddev->to_remove =NULL ; -mutex_lock (&mddev->open_mutex); + mddev->sysfs_active =1 ;mutex_unlock (&mddev->reconfig_mutex);if (to_remove != &md_redundancy_group)
@@ -550,7 +554,7 @@ static void mddev_unlock(mddev_t * mddevsysfs_put (mddev->sysfs_action); mddev->sysfs_action =NULL ; } -mutex_unlock (&mddev->open_mutex); + mddev->sysfs_active =0 ; }else mutex_unlock (&mddev->reconfig_mutex);
@@ -2960,7 +2964,9 @@ level_store(mddev_t *mddev, const char ** - new personality will access other array. */ -if (mddev->sync_thread || mddev->reshape_position != MaxSector) +if (mddev->sync_thread || + mddev->reshape_position != MaxSector || + mddev->sysfs_active)return -EBUSY ;if (!mddev->pers->quiesce) {
@@ -4344,13 +4350,9 @@ static int md_run(mddev_t *mddev)if (mddev->pers)return -EBUSY ; - -/* These two calls synchronise us with the -* sysfs_remove_group calls in mddev_unlock, -* so they must have completed. -*/ -mutex_lock (&mddev->open_mutex); -mutex_unlock (&mddev->open_mutex); +/* Cannot run until previous stop completes properly */ +if (mddev->sysfs_active) +return -EBUSY ;/* * Analyze all RAID superblock(s)
@@ -4716,7 +4718,8 @@ static int do_md_stop(mddev_t * mddev, imdk_rdev_t *rdev;mutex_lock (&mddev->open_mutex); -if (atomic_read (&mddev->openers) > is_open) { +if (atomic_read (&mddev->openers) > is_open || + mddev->sysfs_active) {printk ("md: %s still in use.\n" ,mdname (mddev)); err = -EBUSY ; }else if (mddev->pers) {
drivers/md/md.h +4 -0
@@ -125,6 +125,10 @@ struct mddev_sint suspended;atomic_t active_io;int ro; +int sysfs_active;/* set when sysfs deletes +* are happening, so run/ +* takeover/stop are not safe +*/ struct gendisk *gendisk;
PATCH 27/67 md: move revalidate_disk() back outside open_mutex
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
commit 147e0b6a639ac581ca3bf627bedc3f4a6d3eca66 upstream.
Commit b821eaa5 "md: remove ->changed and related code" moved revalidate_disk() under open_mutex, and lockdep noticed.
[ INFO: possible circular locking dependency detected ] 2.6.32-mdadm-locking #1
-------------------------------------------------------
mdadm/3640 is trying to acquire lock:
(&bdev->bd_mutex){+.+.+.}, at: [<ffffffff811acecb>] revalidate_disk+0x5b/0x90
but task is already holding lock:
(&mddev->open_mutex){+.+...}, at: [<ffffffffa055e07a>] do_md_stop+0x4a/0x4d0 [md_mod]
which lock already depends on the new lock.
It is suitable for 2.6.35.x
--- drivers/md/md.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/md/md.c +4 -2
@@ -4711,7 +4711,7 @@ out:*/ static int do_md_stop (mddev_t * mddev,int mode,int is_open) { -int err =0 ; +int err =0 , revalidate =0 ;struct gendisk *disk = mddev->gendisk;mdk_rdev_t *rdev;
@@ -4740,7 +4740,7 @@ static int do_md_stop(mddev_t * mddev, i }set_capacity (disk,0 ); -revalidate_disk (disk); + revalidate =1 ;if (mddev->ro) mddev->ro =0 ;
@@ -4748,6 +4748,8 @@ static int do_md_stop(mddev_t * mddev, i err =0 ; }mutex_unlock (&mddev->open_mutex); +if (revalidate) +revalidate_disk (disk);if (err)return err;/*
PATCH 25/67 ipmi: fix ACPI detection with regspacing
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yinghai Lu <[email protected]>
commit d9e1b6c45059ccfff647a120769ae86da78dfdc4 upstream.
After the commit that changed ipmi_si detecting sequence from SMBIOS/ACPI to ACPI/SMBIOS,
| commit 754d453185275951d39792865927ec494fa1ebd8 | Author: Matthew Garrett <[email protected]> | Date: Wed May 26 14:43:47 2010 -0700 | | ipmi: change device discovery order | | The ipmi spec provides an ordering for si discovery. Change the driver to | match, with the exception of preferring smbios to SPMI as HPs (at least) | contain accurate information in the former but not the latter.
ipmi_si can not be initialized.
[ 138.799739] calling init_ipmi_devintf+0x0/0x109 @ 1 [ 138.805050] ipmi device interface [ 138.818131] initcall init_ipmi_devintf+0x0/0x109 returned 0 after 12797 usecs [ 138.822998] calling init_ipmi_si+0x0/0xa90 @ 1 [ 138.840276] IPMI System Interface driver. [ 138.846137] ipmi_si: probing via ACPI [ 138.849225] ipmi_si 00:09: [io 0x0ca2] regsize 1 spacing 1 irq 0 [ 138.864438] ipmi_si: Adding ACPI-specified kcs state machine [ 138.870893] ipmi_si: probing via SMBIOS [ 138.880945] ipmi_si: Adding SMBIOS-specified kcs state machineipmi_si: duplicate interface [ 138.896511] ipmi_si: probing via SPMI [ 138.899861] ipmi_si: Adding SPMI-specified kcs state machineipmi_si: duplicate interface [ 138.917095] ipmi_si: Trying ACPI-specified kcs state machine at i/o address 0xca2, slave address 0x0, irq 0 [ 138.928658] ipmi_si: Interface detection failed [ 138.953411] initcall init_ipmi_si+0x0/0xa90 returned 0 after 110847 usecs
in smbios has
DMI/SMBIOS
Handle 0x00C5, DMI type 38, 18 bytes
IPMI Device Information
Interface Type: KCS (Keyboard Control Style) Specification Version: 2.0
I2C Slave Address: 0x00
NV Storage Device: Not Present
Base Address: 0x0000000000000CA2 (I/O) Register Spacing: 32-bit Boundaries
in DSDT has
Device (BMC)
{
Name (_HID, EisaId ("IPI0001"))
Method (_STA, 0, NotSerialized)
{
If (LEqual (OSN, Zero))
{
Return (Zero)
}
Return (0x0F)
}
Name (_STR, Unicode ("IPMI_KCS"))
Name (_UID, Zero)
Name (_CRS, ResourceTemplate ()
{
IO (Decode16,
0x0CA2, // Range Minimum
0x0CA2, // Range Maximum
0x00, // Alignment
0x01, // Length
)
IO (Decode16,
0x0CA6, // Range Minimum
0x0CA6, // Range Maximum
0x00, // Alignment
0x01, // Length
)
})
Method (_IFT, 0, NotSerialized)
{
Return (One)
}
Method (_SRV, 0, NotSerialized)
{
Return (0x0200)
}
}so the reg spacing should be 4 instead of 1.
Try to calculate regspacing for this kind of system.
Observed on a Sun Fire X4800. Other OSes work and pass certification.
--- drivers/char/ipmi/ipmi_si_intf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/char/ipmi/ipmi_si_intf.c +8 -0
@@ -2176,6 +2176,14 @@ static int __devinit ipmi_pnp_probe(stru info->io.addr_data = res->start; info->io.regspacing =DEFAULT_REGSPACING ; + res =pnp_get_resource (dev, + (info->io.addr_type ==IPMI_IO_ADDR_SPACE ) ? +IORESOURCE_IO :IORESOURCE_MEM , +1 ); +if (res) { +if (res->start > info->io.addr_data) + info->io.regspacing = res->start - info->io.addr_data; + } info->io.regsize =DEFAULT_REGSPACING ; info->io.regshift =0 ;
PATCH 22/67 drivers/video/w100fb.c: ignore void return value / fix build failure
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Huewe <[email protected]>
commit fa260c00c1aa5c657793a7221e40d2400df5afd8 upstream.
Fix a build failure "error: void value not ignored as it ought to be" by removing an assignment of a void return value. The functionality of the code is not changed.
--- drivers/video/w100fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/w100fb.c +2 -2
@@ -858,9 +858,9 @@ unsigned long w100fb_gpio_read(int port)void w100fb_gpio_write (int port,unsigned long value) {if (port==W100_GPIO_PORT_A ) - value =writel (value, remapped_regs + mmGPIO_DATA); +writel (value, remapped_regs + mmGPIO_DATA);else - value =writel (value, remapped_regs + mmGPIO_DATA2); +writel (value, remapped_regs + mmGPIO_DATA2); }EXPORT_SYMBOL (w100fb_gpio_read);EXPORT_SYMBOL (w100fb_gpio_write);
PATCH 21/67 mm: fix corruption of hibernation caused by reusing swap during image saving
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: KAMEZAWA Hiroyuki <[email protected]>
commit 966cca029f739716fbcc8068b8c6dfe381f86fc3 upstream.
Since 2.6.31, swap_map[]'s refcounting was changed to show that a used swap entry is just for swap-cache, can be reused. Then, while scanning free entry in swap_map[], a swap entry may be able to be reclaimed and reused. It was caused by commit c9e444103b5e7a5 ("mm: reuse unused swap entry if necessary").
But this caused deta corruption at resume. The scenario is
- Assume a clean-swap cache, but mapped.
- at hibernation_snapshot[], clean-swap-cache is saved as clean-swap-cache and swap_map[] is marked as SWAP_HAS_CACHE.
- then, save_image() is called. And reuse SWAP_HAS_CACHE entry to save image, and break the contents.
After resume:
- the memory reclaim runs and finds clean-not-referenced-swap-cache and discards it because it's marked as clean. But here, the contents on disk and swap-cache is inconsistent.
Hance memory is corrupted.
This patch avoids the bug by not reclaiming swap-entry during hibernation. This is a quick fix for backporting.
--- mm/swapfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
mm/swapfile.c +4 -2
@@ -318,8 +318,10 @@ checks:if (offset > si->highest_bit) scan_base = offset = si->lowest_bit; -/* reuse swap entry of cache-only swap if not busy. */ -if (vm_swap_full () && si->swap_map[offset] ==SWAP_HAS_CACHE ) { +/* reuse swap entry of cache-only swap if not hibernation. */ +if (vm_swap_full () + && usage ==SWAP_HAS_CACHE + && si->swap_map[offset] ==SWAP_HAS_CACHE ) {int swap_was_freed;spin_unlock (&swap_lock); swap_was_freed =__try_to_reclaim_swap (si, offset);
PATCH 20/67 Char: nozomi, set tty->driver_data appropriately
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit bf9c1fca9ae9a79ed209e7ab2c10b3862f3f6f72 upstream.
Sorry, one more fix, this one depends on the other, so this is rather 2/2. --
tty->driver_data is used all over the code, but never set. This results in oopses like:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000130 IP: [<ffffffff814a0040>] mutex_lock+0x10/0x40 ... Pid: 2157, comm: modem-manager Not tainted 2.6.34.1-0.1-desktop #1 2768DR7/2768DR7 RIP: 0010:[<ffffffff814a0040>] [<ffffffff814a0040>] mutex_lock+0x10/0x40 RSP: 0018:ffff88007b16fa50 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000130 RCX: 0000000000000003 RDX: 0000000000000003 RSI: 0000000000000286 RDI: 0000000000000130 RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000130 R13: 0000000000000001 R14: 0000000000000000 R15: ffff88007b16feb4 ... Call Trace: [<ffffffffa077690d>] ntty_write_room+0x4d/0x90 [nozomi]
...
Set tty->driver_data to the computed port in .install to not recompute it in every place where needed. Switch .open to use driver_data too.
--- drivers/char/nozomi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/nozomi.c +2 -1
@@ -1612,6 +1612,7 @@ static int ntty_install(struct tty_driveif (ret ==0 ) {tty_driver_kref_get (driver); tty->count++; + tty->driver_data = port; driver->ttys[tty->index] = tty; }return ret;
@@ -1640,7 +1641,7 @@ static int ntty_activate(struct tty_portstatic int ntty_open (struct tty_struct *tty,struct file *filp) { -struct port *port =get_port_by_tty (tty); +struct port *port = tty->driver_data;return tty_port_open (&port->port, tty, filp); }
PATCH 19/67 Char: nozomi, fix tty->count counting
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit ee78bb95b7bea08b7774a02073ea2bb45611a9e1 upstream.
Currently ntty_install omits to increment tty count and we get the following warnings:
Warning: dev (noz2) tty->count(0) != #fd's(1) in tty_open
So to fix that, add one tty->count++ there.
--- drivers/char/nozomi.c | 1 + 1 file changed, 1 insertion(+)
drivers/char/nozomi.c +1 -0
@@ -1611,6 +1611,7 @@ static int ntty_install(struct tty_drive ret =tty_init_termios (tty);if (ret ==0 ) {tty_driver_kref_get (driver); + tty->count++; driver->ttys[tty->index] = tty; }return ret;
PATCH 18/67 ALSA: hda - Add PC-beep whitelist for an Intel board
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit e096c8e6d5ed965f346d94befbbec2275dde3621 upstream.
An Intel board needs a white-list entry to enable PC-beep. Otherwise the driver misdetects (due to bogus BIOS info) and ignores the PC-beep on 2.6.35.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -5183,6 +5183,7 @@ static void fillup_priv_adc_nids(structstatic struct snd_pci_quirk beep_white_list[] = {SND_PCI_QUIRK (0x1043 ,0x829f ,"ASUS" ,1 ), +SND_PCI_QUIRK (0x8086 ,0xd613 ,"Intel" ,1 ), {} };
PATCH 17/67 x86, mtrr: Use stop machine context to rendezvous all the cpus
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Suresh Siddha <[email protected]>
commit 68f202e4e87cfab4439568bf397fcc5c7cf8d729 upstream.
Use the stop machine context rather than IPI's to rendezvous all the cpus for MTRR initialization that happens during cpu bringup or for MTRR modifications during runtime.
This avoids deadlock scenario (reported by Prarit) like:
cpu A holds a read_lock (tasklist_lock for example) with irqs enabled cpu B waits for the same lock with irqs disabled using write_lock_irq cpu C doing set_mtrr() (during AP bringup for example), which will try to rendezvous all the cpus using IPI's
This will result in C and A come to the rendezvous point and waiting for B. B is stuck forever waiting for the lock and thus not reaching the rendezvous point.
Using stop cpu (run in the process context of per cpu based keventd) to do this rendezvous, avoids this deadlock scenario.
Also make sure all the cpu's are in the rendezvous handler before we proceed with the local_irq_save() on each cpu. This lock step disabling irqs on all the cpus will avoid other deadlock scenarios (for example involving with the blocking smp_call_function's etc).
[ This problem is very old. Marking -stable only for 2.6.35 as the
stop_one_cpu_nowait() API is present only in 2.6.35. Any older kernel interested in this fix need to do some more work in backporting this patch. ]
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/mtrr/main.c | 56 ++++++++++++++++++++++++++++++---------- arch/x86/kernel/smpboot.c | 7 +++++ 2 files changed, 50 insertions(+), 13 deletions(-)
arch/x86/kernel/cpu/mtrr/main.c +43 -13
@@ -35,6 +35,7 @@#include <linux/types.h> /* FIXME: kvm_para.h needs this */ +#include <linux/stop_machine.h> #include <linux/kvm_para.h> #include <linux/uaccess.h> #include <linux/module.h>
@@ -143,22 +144,28 @@ struct set_mtrr_data {mtrr_type smp_type; }; +static DEFINE_PER_CPU(struct cpu_stop_work, mtrr_work); +/** -* ipi_handler - Synchronisation handler. Executed by "other" CPUs. +* mtrr_work_handler - Synchronisation handler. Executed by "other" CPUs. * @info: pointer to mtrr configuration data * * Returns nothing. */ -static void ipi_handler (void *info) +static int mtrr_work_handler (void *info) {#ifdef CONFIG_SMP struct set_mtrr_data *data = info;unsigned long flags; +atomic_dec (&data->count); +while (!atomic_read (&data->gate)) +cpu_relax (); +local_irq_save (flags);atomic_dec (&data->count); -while (!atomic_read (&data->gate)) +while (atomic_read (&data->gate))cpu_relax ();/* The master has cleared me to execute */
@@ -173,12 +180,13 @@ static void ipi_handler(void *info) }atomic_dec (&data->count); -while (atomic_read (&data->gate)) +while (!atomic_read (&data->gate))cpu_relax ();atomic_dec (&data->count);local_irq_restore (flags);#endif +return 0 ; }static inline int types_compatible (mtrr_type type1,mtrr_type type2)
@@ -198,7 +206,7 @@ static inline int types_compatible(mtrr_* * This is kinda tricky, but fortunately, Intel spelled it out for us cleanly: * -* 1. Send IPI to do the following: +* 1. Queue work to do the following on all processors: * 2. Disable Interrupts * 3. Wait for all procs to do so * 4. Enter no-fill cache mode
@@ -215,14 +223,17 @@ static inline int types_compatible(mtrr_* 15. Enable interrupts. * * What does that mean for us? Well, first we set data.count to the number -* of CPUs. As each CPU disables interrupts, it'll decrement it once. We wait -* until it hits 0 and proceed. We set the data.gate flag and reset data.count. -* Meanwhile, they are waiting for that flag to be set. Once it's set, each +* of CPUs. As each CPU announces that it started the rendezvous handler by +* decrementing the count, We reset data.count and set the data.gate flag +* allowing all the cpu's to proceed with the work. As each cpu disables +* interrupts, it'll decrement data.count once. We wait until it hits 0 and +* proceed. We clear the data.gate flag and reset data.count. Meanwhile, they +* are waiting for that flag to be cleared. Once it's cleared, each * CPU goes through the transition of updating MTRRs. * The CPU vendors may each do it differently, * so we call mtrr_if->set() callback and let them take care of it. * When they're done, they again decrement data->count and wait for data.gate -* to be reset. +* to be set. * When we finish, we wait for data.count to hit 0 and toggle the data.gate flag * Everyone then enables interrupts and we all continue on. *
@@ -234,6 +245,9 @@ set_mtrr(unsigned int reg, unsigned long {struct set_mtrr_data data;unsigned long flags; +int cpu; + +preempt_disable (); data.smp_reg = reg; data.smp_base = base;
@@ -246,10 +260,15 @@ set_mtrr(unsigned int reg, unsigned longatomic_set (&data.gate,0 );/* Start the ball rolling on other CPUs */ -if (smp_call_function (ipi_handler, &data,0 ) !=0 ) -panic ("mtrr: timed out waiting for other CPUs\n" ); +for_each_online_cpu (cpu) { +struct cpu_stop_work *work = &per_cpu (mtrr_work, cpu); + +if (cpu ==smp_processor_id ()) +continue ; + +stop_one_cpu_nowait (cpu, mtrr_work_handler, &data, work); + } -local_irq_save (flags);while (atomic_read (&data.count))cpu_relax ();
@@ -259,6 +278,16 @@ set_mtrr(unsigned int reg, unsigned longsmp_wmb ();atomic_set (&data.gate,1 ); +local_irq_save (flags); + +while (atomic_read (&data.count)) +cpu_relax (); + +/* Ok, reset count and toggle gate */ +atomic_set (&data.count,num_booting_cpus () -1 ); +smp_wmb (); +atomic_set (&data.gate,0 ); +/* Do our MTRR business */ /*
@@ -279,7 +308,7 @@ set_mtrr(unsigned int reg, unsigned longatomic_set (&data.count,num_booting_cpus () -1 );smp_wmb (); -atomic_set (&data.gate,0 ); +atomic_set (&data.gate,1 );/* * Wait here for everyone to have seen the gate change
@@ -289,6 +318,7 @@ set_mtrr(unsigned int reg, unsigned longcpu_relax ();local_irq_restore (flags); +preempt_enable (); }/**
arch/x86/kernel/smpboot.c +7 -0
@@ -816,6 +816,13 @@ do_rest:if (cpumask_test_cpu (cpu, cpu_callin_mask))break ;/* It has booted */ udelay (100 ); +/* +* Allow other tasks to run while we wait for the +* AP to come online. This also gives a chance +* for the MTRR work(triggered by the AP coming online) +* to be completed in the stop machine context. +*/ +schedule (); }if (cpumask_test_cpu (cpu, cpu_callin_mask))
PATCH 16/67 solos-pci: Fix race condition in tasklet RX handling
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Woodhouse <[email protected]>
commit 1f6ea6e511e5ec730d8e88651da1b7b6e8fd1333 upstream.
We were seeing faults in the solos-pci receive tasklet when packets arrived for a VCC which was currently being closed:
[18842.727906] EIP: [<e082f490>] br2684_push+0x19/0x234 [br2684] SS:ESP 0068:dfb89d14
[18845.090712] [<c13ecff3>] ? do_page_fault+0x0/0x2e1 [18845.120042] [<e082f490>] ? br2684_push+0x19/0x234 [br2684] [18845.153530] [<e084fa13>] solos_bh+0x28b/0x7c8 [solos_pci] [18845.186488] [<e084f711>] ? solos_irq+0x2d/0x51 [solos_pci] [18845.219960] [<c100387b>] ? handle_irq+0x3b/0x48 [18845.247732] [<c10265cb>] ? irq_exit+0x34/0x57 [18845.274437] [<c1025720>] tasklet_action+0x42/0x69 [18845.303247] [<c102643f>] __do_softirq+0x8e/0x129 [18845.331540] [<c10264ff>] do_softirq+0x25/0x2a [18845.358274] [<c102664c>] _local_bh_enable_ip+0x5e/0x6a [18845.389677] [<c102666d>] local_bh_enable+0xb/0xe [18845.417944] [<e08490a8>] ppp_unregister_channel+0x32/0xbb [ppp_generic] [18845.458193] [<e08731ad>] pppox_unbind_sock+0x18/0x1f [pppox]
This patch uses an RCU-inspired approach to fix it. In the RX tasklet's find_vcc() function we first refuse to use a VCC which already has the ATM_VF_READY bit cleared. And in the VCC close function, we synchronise with the tasklet to ensure that it can't still be using the VCC before we continue and allow the VCC to be destroyed.
--- drivers/atm/solos-pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/atm/solos-pci.c +6 -1
@@ -781,7 +781,8 @@ static struct atm_vcc *find_vcc(struct ask_for_each (s, node, head) { vcc =atm_sk (s);if (vcc->dev == dev && vcc->vci == vci && - vcc->vpi == vpi && vcc->qos.rxtp.traffic_class !=ATM_NONE ) + vcc->vpi == vpi && vcc->qos.rxtp.traffic_class !=ATM_NONE && +test_bit (ATM_VF_READY , &vcc->flags)) goto out; } vcc =NULL ;
@@ -907,6 +908,10 @@ static void pclose(struct atm_vcc *vcc)clear_bit (ATM_VF_ADDR , &vcc->flags);clear_bit (ATM_VF_READY , &vcc->flags); +/* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the +tasklet has finished processing any incoming packets (and, more to +the point, using the vcc pointer). */ +tasklet_unlock_wait (&card->tlet);return ; }
PATCH 15/67 PCI: disable MSI on VIA K8M800
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 549e15611b4ac1de51ef0e0a79c2704f50a638a2 upstream.
MSI delivery from on-board ahci controller doesn't work on K8M800. At this point, it's unclear whether the culprit is with the ahci controller or the host bridge. Given the track record and considering the rather minimal impact of MSI, disabling it seems reasonable.
--- drivers/pci/quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/quirks.c +1 -0
@@ -2115,6 +2115,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATDECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_VT3336 , quirk_disable_all_msi);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_VT3351 , quirk_disable_all_msi);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_VT3364 , quirk_disable_all_msi); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_VIA ,PCI_DEVICE_ID_VIA_8380_0 , quirk_disable_all_msi);/* Disable MSI on chipsets that are known to not support it */ static void __devinit quirk_disable_msi (struct pci_dev *dev)
PATCH 11/67 Staging: panel: Prevent double-calling of parport_release - fix oops.
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Huewe <[email protected]>
commit 060132ae42cce3f9d2fd34d9a17b98362b44b9f9 upstream.
This patch prevents the code from calling parport_release and parport_unregister_device twice with the same arguments - and thus fixes an oops.
Rationale:
After the first call the parport is already released and the handle isn't valid anymore and calling parport_release and parport_unregister_device twice isn't a good idea.
--- drivers/staging/panel/panel.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/panel/panel.c +2 -0
@@ -2179,6 +2179,7 @@ int panel_init(void)if (pprt) {parport_release (pprt);parport_unregister_device (pprt); + pprt =NULL ; }parport_unregister_driver (&panel_driver); printk(KERN_ERR "Panel driver version " PANEL_VERSION
@@ -2228,6 +2229,7 @@ static void __exit panel_cleanup_module(/* TODO: free all input signals */ parport_release (pprt);parport_unregister_device (pprt); + pprt =NULL ; }parport_unregister_driver (&panel_driver); }
PATCH 9/67 staging: rt2870: Add USB ID for Belkin F6D4050 v2
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Larry Finger <[email protected]>
commit 5d92fe3387d086fc2f10426fbdb6b86d6cce5a47 upstream.
Device missing from current tables.
--- drivers/staging/rt2860/usb_main_dev.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rt2860/usb_main_dev.c +1 -0
@@ -64,6 +64,7 @@ struct usb_device_id rtusb_usb_id[] = { {USB_DEVICE(0x14B2, 0x3C07)}, /* AL */ {USB_DEVICE(0x050D, 0x8053)}, /* Belkin */ {USB_DEVICE(0x050D, 0x825B)}, /* Belkin */ + {USB_DEVICE(0x050D, 0x935B)}, /* Belkin F6D4050 v2 */ {USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */ {USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */ {USB_DEVICE(0x07AA, 0x002F)}, /* Corega */
PATCH 4/67 powerpc: fix build with make 3.82
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sam Ravnborg <[email protected]>
commit e32e78c5ee8aadef020fbaecbe6fb741ed9029fd upstream.
Thomas Backlund reported that the powerpc build broke with make 3.82. It failed with the following message:
arch/powerpc/Makefile:183: *** mixed implicit and normal rules. Stop.
The fix is to avoid mixing non-wildcard and wildcard targets.
--- arch/powerpc/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
arch/powerpc/Makefile +12 -4
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE) += arch/power # Default to zImage, override when needed all: zImage -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.% +# With make 3.82 we cannot mix normal and wildcard targets +BOOT_TARGETS1 := zImage zImage.initrd uImaged +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% -PHONY += $(BOOT_TARGETS) +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) boot := arch/$(ARCH)/boot
@@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check. zImage: relocs_check endif -$(BOOT_TARGETS): vmlinux +$(BOOT_TARGETS1): vmlinux + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) +$(BOOT_TARGETS2): vmlinux + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) + + +bootwrapper_install: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) -bootwrapper_install %.dtb: +%.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) define archhelp
PATCH 3/67 perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Scott Wood <[email protected]>
commit 69e77a8b0426ded5d924eea7dbe4eca51e09f530 upstream.
Commit 6b95ed345b9faa4ab3598a82991968f2e9f851bb changed from a struct initializer to perf_sample_data_init(), but the setting of the .period member was left out.
--- arch/powerpc/kernel/perf_event_fsl_emb.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/perf_event_fsl_emb.c +1 -0
@@ -569,6 +569,7 @@ static void record_and_restart(struct pestruct perf_sample_data data;perf_sample_data_init (&data,0 ); + data.period = event->hw.last_period;if (perf_event_overflow (event, nmi, &data, regs)) {/*
PATCH 2/67 ata_piix: fix locking around SIDPR access
In reply to Greg KH2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 213373cf974fe69e78ec894b07f45ae2f5a3a078 upstream.
SIDPR window registers are shared across ports and as each access is done in two steps, accesses to different ports under EH may race. This primarily is caused by incorrect host locking in EH context and should be fixed by defining locking requirements for each EH operation which can be used during EH and enforcing them but for now work around the problem by adding a dedicated SIDPR lock and grabbing it for each SIDPR access.
--- drivers/ata/ata_piix.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/ata/ata_piix.c +8 -0
@@ -158,6 +158,7 @@ struct piix_map_db {struct piix_host_priv {const int *map;u32 saved_iocfg; +spinlock_t sidpr_lock;/* FIXME: remove once locking in EH is fixed */ void __iomem *sidpr; };
@@ -951,12 +952,15 @@ static int piix_sidpr_scr_read(struct at unsigned int reg, u32 *val) { struct piix_host_priv *hpriv = link->ap->host->private_data; +unsigned long flags;if (reg >=ARRAY_SIZE (piix_sidx_map))return -EINVAL ; +spin_lock_irqsave (&hpriv->sidpr_lock, flags);piix_sidpr_sel (link, reg); *val =ioread32 (hpriv->sidpr +PIIX_SIDPR_DATA ); +spin_unlock_irqrestore (&hpriv->sidpr_lock, flags);return 0 ; }
@@ -964,12 +968,15 @@ static int piix_sidpr_scr_write(struct a unsigned int reg, u32 val) {struct piix_host_priv *hpriv = link->ap->host->private_data; +unsigned long flags;if (reg >=ARRAY_SIZE (piix_sidx_map))return -EINVAL ; +spin_lock_irqsave (&hpriv->sidpr_lock, flags);piix_sidpr_sel (link, reg);iowrite32 (val, hpriv->sidpr +PIIX_SIDPR_DATA ); +spin_unlock_irqrestore (&hpriv->sidpr_lock, flags);return 0 ; }
@@ -1566,6 +1573,7 @@ static int __devinit piix_init_one(struc hpriv =devm_kzalloc (dev,sizeof (*hpriv),GFP_KERNEL );if (!hpriv)return -ENOMEM ; +spin_lock_init (&hpriv->sidpr_lock);/* Save IOCFG, this will be used for cable detection, quirk * detection and restoration on detach. This is necessary
Re: [60/67] mtd: gen_nand: fix support for multiple chips
In reply to Greg KHDne Čt 12. srpna 2010 02:06:15 Greg KH napsal(a):
Quoted 2 lines
2.6.35-stable review patch. If anyone has any objections, please let us know.
It's going to break plat-qong, apparently the code there is incorrect and depends on this bug, I'll send a patch for it in a bit.
Quoted 30 lines
------------------
From: Marek Vasut <[email protected]>
commit
81cbb0b17796d81cbd92defe113cf2a7c7a21fbbupstream.This patch corrects a problem where
gen_nanddriver assumed there can be only one chip and ignored thepdata->chip.nr_chipsvalue.Signed-off-by Marek Vasut <[email protected]>Signed-off-by Artem Bityutskiy <[email protected]>Signed-off-by David Woodhouse <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/mtd/nand/plat_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/plat_nand.c +1
-1@@ -91,7 +91,7 @@ static int __devinit plat_nand_probe(str }/* Scan to find existance of the device */ -if (nand_scan (&data->mtd,1 )) { +if (nand_scan (&data->mtd, pdata->chip.nr_chips)) { err = -ENXIO ; goto out; }
Re: [Stable-review] [38/67] drbd: Disable delay probes for the upcomming release
In reply to Greg KHQuoted 4 lines · Greg KH
2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 8 lines
From: Philipp Reisner <[email protected]>
commit
6710a5760355be8f2e51682f41b0d3fc76550309upstream.Signed-off-by Philipp Reisner <[email protected]>Signed-off-by Lars Ellenberg <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
[...]
Anyone want to explain why this is important?
Similarly "drbd: Initialize all members of sync_conf to their defaults [Bugz 315]"; I assume that some Bugzilla entry would tell me, only I have no idea where it is.
These commit messages *suck*.
Ben
Signature · 2 lines
Ben Hutchings Once a job is fouled up, anything done to improve it makes it worse.
Lars Ellenberg
maintainerRe: [Stable-review] [38/67] drbd: Disable delay probes for the upcomming release
Quoted 9 lines · Ben Hutchings
Quoted 8 lines · Greg KH
2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Philipp Reisner <[email protected]>
commit
6710a5760355be8f2e51682f41b0d3fc76550309upstream.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Philipp Reisner <[email protected]>Signed-off-by Lars Ellenberg <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>[...]
Anyone want to explain why this is important?
The receiving side implementation of this "delay probe" feature has potential to stall the DRBD resync process under certain ill circumstances. Thus we rather not send the delay probes in the first place. The feature has been reverted upstream, and is being replaced.
Quoted 3 lines
Similarly "drbd: Initialize all members of
sync_confto their defaults [Bugz 315]"; I assume that some Bugzilla entry would tell me, only I have no idea where it is.
If it so happened that these defaults have not been set, and no explicit value assigned either, and then later a delay probe is received (which, if no one sends one, can no longer be the case), it could lead to a division by zero in kernel space :(
You'd have to misuse drbd userland to get there, but you could.
Quoted 1 line
These commit messages *suck*.
We'll try to make them suck less.
Lars