From: Greg Kroah-Hartman Date: Mon, 30 Jan 2012 17:12:53 +0000 (-0800) Subject: 3.2-stable patches X-Git-Tag: v3.0.19~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de117f0e1e080acd5001a293edcec0ff2144b2c6;p=thirdparty%2Fkernel%2Fstable-queue.git 3.2-stable patches added patches: arm-7296-1-proc-v7.s-remove-harvard_cache-preprocessor-guards.patch arm-at91-fix-at91rm9200-soc-subtype-handling.patch mach-ux500-enable-arm-errata-764369.patch mpt2sas-removed-redundant-calling-of-_scsih_probe_devices-from-_scsih_probe.patch sysfs-complain-bitterly-about-attempts-to-remove-files-from-nonexistent-directories.patch x86-xen-size-struct-xen_spinlock-to-always-fit-in-arch_spinlock_t.patch --- diff --git a/queue-3.2/arm-7296-1-proc-v7.s-remove-harvard_cache-preprocessor-guards.patch b/queue-3.2/arm-7296-1-proc-v7.s-remove-harvard_cache-preprocessor-guards.patch new file mode 100644 index 00000000000..ac28dc8a342 --- /dev/null +++ b/queue-3.2/arm-7296-1-proc-v7.s-remove-harvard_cache-preprocessor-guards.patch @@ -0,0 +1,50 @@ +From 612539e81f655f6ac73c7af1da8701c1ee618aee Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 20 Jan 2012 12:10:18 +0100 +Subject: ARM: 7296/1: proc-v7.S: remove HARVARD_CACHE preprocessor guards + +From: Will Deacon + +commit 612539e81f655f6ac73c7af1da8701c1ee618aee upstream. + +On v7, we use the same cache maintenance instructions for data lines +as for unified lines. This was not the case for v6, where HARVARD_CACHE +was defined to indicate the L1 cache topology. + +This patch removes the erroneous compile-time check for HARVARD_CACHE in +proc-v7.S, ensuring that we perform I-side invalidation at boot. + +Reported-and-Acked-by: Shawn Guo + +Acked-by: Catalin Marinas +Signed-off-by: Will Deacon +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mm/proc-v7.S | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/arch/arm/mm/proc-v7.S ++++ b/arch/arm/mm/proc-v7.S +@@ -271,10 +271,6 @@ ENDPROC(cpu_v7_do_resume) + * Initialise TLB, Caches, and MMU state ready to switch the MMU + * on. Return in r0 the new CP15 C1 control register setting. + * +- * We automatically detect if we have a Harvard cache, and use the +- * Harvard cache control instructions insead of the unified cache +- * control instructions. +- * + * This should be able to cover all ARMv7 cores. + * + * It is assumed that: +@@ -373,9 +369,7 @@ __v7_setup: + #endif + + 3: mov r10, #0 +-#ifdef HARVARD_CACHE + mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate +-#endif + dsb + #ifdef CONFIG_MMU + mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs diff --git a/queue-3.2/arm-at91-fix-at91rm9200-soc-subtype-handling.patch b/queue-3.2/arm-at91-fix-at91rm9200-soc-subtype-handling.patch new file mode 100644 index 00000000000..4d62d18e777 --- /dev/null +++ b/queue-3.2/arm-at91-fix-at91rm9200-soc-subtype-handling.patch @@ -0,0 +1,44 @@ +From 3e90772f76010c315474bde59eaca7cc4c94d645 Mon Sep 17 00:00:00 2001 +From: Nicolas Ferre +Date: Wed, 28 Dec 2011 13:10:04 +0200 +Subject: ARM: at91: fix at91rm9200 soc subtype handling + +From: Nicolas Ferre + +commit 3e90772f76010c315474bde59eaca7cc4c94d645 upstream. + +Currently setting it to PQFP changes subtype to BGA as subtypes are +swapped in at91rm9200_set_type(). + +Wrong subtype causes GPIO bank D not to work at all. + +After this fix, subtype is still set as unknown. But board code should +fill it in with proper value. Another information is thus printed. + +Bug discovery and first implementation made by Veli-Pekka Peltola. + +Signed-off-by: Nicolas Ferre +Acked-by: Jean-Christophe PLAGNIOL-VILLARD +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-at91/setup.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/arch/arm/mach-at91/setup.c ++++ b/arch/arm/mach-at91/setup.c +@@ -27,9 +27,12 @@ EXPORT_SYMBOL(at91_soc_initdata); + void __init at91rm9200_set_type(int type) + { + if (type == ARCH_REVISON_9200_PQFP) +- at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; +- else + at91_soc_initdata.subtype = AT91_SOC_RM9200_PQFP; ++ else ++ at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; ++ ++ pr_info("AT91: filled in soc subtype: %s\n", ++ at91_get_soc_subtype(&at91_soc_initdata)); + } + + void __init at91_init_irq_default(void) diff --git a/queue-3.2/mach-ux500-enable-arm-errata-764369.patch b/queue-3.2/mach-ux500-enable-arm-errata-764369.patch new file mode 100644 index 00000000000..78be05126c6 --- /dev/null +++ b/queue-3.2/mach-ux500-enable-arm-errata-764369.patch @@ -0,0 +1,29 @@ +From d65015f7c5c5be9fd3f5e567889c844ba81bdc9c Mon Sep 17 00:00:00 2001 +From: Srinidhi KASAGAR +Date: Thu, 12 Jan 2012 11:07:43 +0530 +Subject: mach-ux500: enable ARM errata 764369 + +From: Srinidhi KASAGAR + +commit d65015f7c5c5be9fd3f5e567889c844ba81bdc9c upstream. + +This applies ARM errata 764369 for all ux500 platforms. + +Signed-off-by: Srinidhi Kasagar +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-ux500/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-ux500/Kconfig ++++ b/arch/arm/mach-ux500/Kconfig +@@ -7,6 +7,7 @@ config UX500_SOC_COMMON + select HAS_MTU + select ARM_ERRATA_753970 + select ARM_ERRATA_754322 ++ select ARM_ERRATA_764369 + + menu "Ux500 SoC" + diff --git a/queue-3.2/mpt2sas-removed-redundant-calling-of-_scsih_probe_devices-from-_scsih_probe.patch b/queue-3.2/mpt2sas-removed-redundant-calling-of-_scsih_probe_devices-from-_scsih_probe.patch new file mode 100644 index 00000000000..667dcc0bd50 --- /dev/null +++ b/queue-3.2/mpt2sas-removed-redundant-calling-of-_scsih_probe_devices-from-_scsih_probe.patch @@ -0,0 +1,91 @@ +From 2cb6fc8c014b9b00c4487a79b8f6ed0da4121f45 Mon Sep 17 00:00:00 2001 +From: "nagalakshmi.nandigama@lsi.com" +Date: Tue, 13 Dec 2011 09:29:15 +0530 +Subject: [SCSI] mpt2sas: Removed redundant calling of _scsih_probe_devices() from _scsih_probe + +From: "nagalakshmi.nandigama@lsi.com" + +commit 2cb6fc8c014b9b00c4487a79b8f6ed0da4121f45 upstream. + +Removed redundant calling of _scsih_probe_devices() from _scsih_probe as +it is getting called from _scsih_scan_finished. + +Also moved the function scsi_scan_host(shost) to get called after the +volumes on warp drive are reported to the OS. Otherwise by the time +the (ioc->hide_drives) flags is set, the volumes on warp drive +are reported to the OS already. + +Also modified the initialization of reply queues only in case of driver load +time in the function _base_make_ioc_operational(). + +Signed-off-by: Nagalakshmi Nandigama +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/mpt2sas/mpt2sas_base.c | 20 +++++++------------- + drivers/scsi/mpt2sas/mpt2sas_scsih.c | 3 +-- + 2 files changed, 8 insertions(+), 15 deletions(-) + +--- a/drivers/scsi/mpt2sas/mpt2sas_base.c ++++ b/drivers/scsi/mpt2sas/mpt2sas_base.c +@@ -4033,7 +4033,8 @@ _base_make_ioc_operational(struct MPT2SA + ioc->reply_free[i] = cpu_to_le32(reply_address); + + /* initialize reply queues */ +- _base_assign_reply_queues(ioc); ++ if (ioc->is_driver_loading) ++ _base_assign_reply_queues(ioc); + + /* initialize Reply Post Free Queue */ + reply_post_free = (long)ioc->reply_post_free; +@@ -4081,24 +4082,17 @@ _base_make_ioc_operational(struct MPT2SA + + + if (ioc->is_driver_loading) { +- +- +- +- ioc->wait_for_discovery_to_complete = +- _base_determine_wait_on_discovery(ioc); +- return r; /* scan_start and scan_finished support */ +- } +- +- +- if (ioc->wait_for_discovery_to_complete && ioc->is_warpdrive) { +- if (ioc->manu_pg10.OEMIdentifier == 0x80) { ++ if (ioc->is_warpdrive && ioc->manu_pg10.OEMIdentifier ++ == 0x80) { + hide_flag = (u8) (ioc->manu_pg10.OEMSpecificFlags0 & + MFG_PAGE10_HIDE_SSDS_MASK); + if (hide_flag != MFG_PAGE10_HIDE_SSDS_MASK) + ioc->mfg_pg10_hide_flag = hide_flag; + } ++ ioc->wait_for_discovery_to_complete = ++ _base_determine_wait_on_discovery(ioc); ++ return r; /* scan_start and scan_finished support */ + } +- + r = _base_send_port_enable(ioc, sleep_flag); + if (r) + return r; +--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c ++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c +@@ -8001,7 +8001,6 @@ _scsih_probe(struct pci_dev *pdev, const + goto out_attach_fail; + } + +- scsi_scan_host(shost); + if (ioc->is_warpdrive) { + if (ioc->mfg_pg10_hide_flag == MFG_PAGE10_EXPOSE_ALL_DISKS) + ioc->hide_drives = 0; +@@ -8015,8 +8014,8 @@ _scsih_probe(struct pci_dev *pdev, const + } + } else + ioc->hide_drives = 0; ++ scsi_scan_host(shost); + +- _scsih_probe_devices(ioc); + return 0; + + out_attach_fail: diff --git a/queue-3.2/series b/queue-3.2/series index 542c6dd6e57..68857b0a846 100644 --- a/queue-3.2/series +++ b/queue-3.2/series @@ -30,3 +30,9 @@ alsa-hda-fix-silent-output-on-haier-w18-laptop.patch drm-i915-paper-over-missed-irq-issues-with-force-wake-voodoo.patch drm-i915-sdvo-always-set-positive-sync-polarity.patch drm-i915-re-enable-gen7-rc6-and-gpu-turbo-after-resume.patch +arm-at91-fix-at91rm9200-soc-subtype-handling.patch +mach-ux500-enable-arm-errata-764369.patch +arm-7296-1-proc-v7.s-remove-harvard_cache-preprocessor-guards.patch +sysfs-complain-bitterly-about-attempts-to-remove-files-from-nonexistent-directories.patch +x86-xen-size-struct-xen_spinlock-to-always-fit-in-arch_spinlock_t.patch +mpt2sas-removed-redundant-calling-of-_scsih_probe_devices-from-_scsih_probe.patch diff --git a/queue-3.2/sysfs-complain-bitterly-about-attempts-to-remove-files-from-nonexistent-directories.patch b/queue-3.2/sysfs-complain-bitterly-about-attempts-to-remove-files-from-nonexistent-directories.patch new file mode 100644 index 00000000000..7addf6f7853 --- /dev/null +++ b/queue-3.2/sysfs-complain-bitterly-about-attempts-to-remove-files-from-nonexistent-directories.patch @@ -0,0 +1,63 @@ +From ce597919361dcec97341151690e780eade2a9cf4 Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Fri, 13 Jan 2012 21:32:59 -0800 +Subject: sysfs: Complain bitterly about attempts to remove files from nonexistent directories. + +From: "Eric W. Biederman" + +commit ce597919361dcec97341151690e780eade2a9cf4 upstream. + +Recently an OOPS was observed from the usb serial io_ti driver when it tried to remove +sysfs directories. Upon investigation it turns out this driver was always buggy +and that a recent sysfs change had stopped guarding itself against removing attributes +from sysfs directories that had already been removed. :( + +Historically we have been silent about attempting to files from nonexistent sysfs +directories and have politely returned error codes. That has resulted in people writing +broken code that ignores the error codes. + +Issue a kernel WARNING and a stack backtrace to make it clear in no uncertain +terms that abusing sysfs is not ok, and the callers need to fix their code. + +This change transforms the io_ti OOPS into a more comprehensible error message +and stack backtrace. + +Signed-off-by: Eric W. Biederman +Reported-by: Wolfgang Frisch +Signed-off-by: Greg Kroah-Hartman + +--- + fs/sysfs/file.c | 6 ++++++ + fs/sysfs/inode.c | 5 ++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -493,6 +493,12 @@ int sysfs_attr_ns(struct kobject *kobj, + const void *ns = NULL; + int err; + ++ if (!dir_sd) { ++ WARN(1, KERN_ERR "sysfs: kobject %s without dirent\n", ++ kobject_name(kobj)); ++ return -ENOENT; ++ } ++ + err = 0; + if (!sysfs_ns_type(dir_sd)) + goto out; +--- a/fs/sysfs/inode.c ++++ b/fs/sysfs/inode.c +@@ -318,8 +318,11 @@ int sysfs_hash_and_remove(struct sysfs_d + struct sysfs_addrm_cxt acxt; + struct sysfs_dirent *sd; + +- if (!dir_sd) ++ if (!dir_sd) { ++ WARN(1, KERN_WARNING "sysfs: can not remove '%s', no directory\n", ++ name); + return -ENOENT; ++ } + + sysfs_addrm_start(&acxt, dir_sd); + diff --git a/queue-3.2/x86-xen-size-struct-xen_spinlock-to-always-fit-in-arch_spinlock_t.patch b/queue-3.2/x86-xen-size-struct-xen_spinlock-to-always-fit-in-arch_spinlock_t.patch new file mode 100644 index 00000000000..8bd7f1e6f14 --- /dev/null +++ b/queue-3.2/x86-xen-size-struct-xen_spinlock-to-always-fit-in-arch_spinlock_t.patch @@ -0,0 +1,100 @@ +From 7a7546b377bdaa25ac77f33d9433c59f259b9688 Mon Sep 17 00:00:00 2001 +From: David Vrabel +Date: Mon, 23 Jan 2012 19:32:25 +0000 +Subject: x86: xen: size struct xen_spinlock to always fit in arch_spinlock_t + +From: David Vrabel + +commit 7a7546b377bdaa25ac77f33d9433c59f259b9688 upstream. + +If NR_CPUS < 256 then arch_spinlock_t is only 16 bits wide but struct +xen_spinlock is 32 bits. When a spin lock is contended and +xl->spinners is modified the two bytes immediately after the spin lock +would be corrupted. + +This is a regression caused by 84eb950db13ca40a0572ce9957e14723500943d6 +(x86, ticketlock: Clean up types and accessors) which reduced the size +of arch_spinlock_t. + +Fix this by making xl->spinners a u8 if NR_CPUS < 256. A +BUILD_BUG_ON() is also added to check the sizes of the two structures +are compatible. + +In many cases this was not noticable as there would often be padding +bytes after the lock (e.g., if any of CONFIG_GENERIC_LOCKBREAK, +CONFIG_DEBUG_SPINLOCK, or CONFIG_DEBUG_LOCK_ALLOC were enabled). + +The bnx2 driver is affected. In struct bnx2, phy_lock and +indirect_lock may have no padding after them. Contention on phy_lock +would corrupt indirect_lock making it appear locked and the driver +would deadlock. + +Signed-off-by: David Vrabel +Signed-off-by: Jeremy Fitzhardinge +Acked-by: Ian Campbell +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/spinlock.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +--- a/arch/x86/xen/spinlock.c ++++ b/arch/x86/xen/spinlock.c +@@ -116,9 +116,26 @@ static inline void spin_time_accum_block + } + #endif /* CONFIG_XEN_DEBUG_FS */ + ++/* ++ * Size struct xen_spinlock so it's the same as arch_spinlock_t. ++ */ ++#if NR_CPUS < 256 ++typedef u8 xen_spinners_t; ++# define inc_spinners(xl) \ ++ asm(LOCK_PREFIX " incb %0" : "+m" ((xl)->spinners) : : "memory"); ++# define dec_spinners(xl) \ ++ asm(LOCK_PREFIX " decb %0" : "+m" ((xl)->spinners) : : "memory"); ++#else ++typedef u16 xen_spinners_t; ++# define inc_spinners(xl) \ ++ asm(LOCK_PREFIX " incw %0" : "+m" ((xl)->spinners) : : "memory"); ++# define dec_spinners(xl) \ ++ asm(LOCK_PREFIX " decw %0" : "+m" ((xl)->spinners) : : "memory"); ++#endif ++ + struct xen_spinlock { + unsigned char lock; /* 0 -> free; 1 -> locked */ +- unsigned short spinners; /* count of waiting cpus */ ++ xen_spinners_t spinners; /* count of waiting cpus */ + }; + + static int xen_spin_is_locked(struct arch_spinlock *lock) +@@ -164,8 +181,7 @@ static inline struct xen_spinlock *spinn + + wmb(); /* set lock of interest before count */ + +- asm(LOCK_PREFIX " incw %0" +- : "+m" (xl->spinners) : : "memory"); ++ inc_spinners(xl); + + return prev; + } +@@ -176,8 +192,7 @@ static inline struct xen_spinlock *spinn + */ + static inline void unspinning_lock(struct xen_spinlock *xl, struct xen_spinlock *prev) + { +- asm(LOCK_PREFIX " decw %0" +- : "+m" (xl->spinners) : : "memory"); ++ dec_spinners(xl); + wmb(); /* decrement count before restoring lock */ + __this_cpu_write(lock_spinners, prev); + } +@@ -373,6 +388,8 @@ void xen_uninit_lock_cpu(int cpu) + + void __init xen_init_spinlocks(void) + { ++ BUILD_BUG_ON(sizeof(struct xen_spinlock) > sizeof(arch_spinlock_t)); ++ + pv_lock_ops.spin_is_locked = xen_spin_is_locked; + pv_lock_ops.spin_is_contended = xen_spin_is_contended; + pv_lock_ops.spin_lock = xen_spin_lock;