From: Greg Kroah-Hartman Date: Mon, 8 Oct 2012 16:39:17 +0000 (-0700) Subject: 3.5-stable patches X-Git-Tag: v3.0.46~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2bfd3e7a6f947a0cf61083e4cc91d7df62f433f;p=thirdparty%2Fkernel%2Fstable-queue.git 3.5-stable patches added patches: acpi-run-_osc-after-acpi_full_initialization.patch drivers-scsi-atp870u.c-fix-bad-use-of-udelay.patch kernel-sys.c-call-disable_nonboot_cpus-in-kernel_restart.patch lib-gcd.c-prevent-possible-div-by-0.patch mfd-max8925-move-_io-resources-out-of-ioport_ioresource.patch pci-acpiphp-check-whether-_adr-evaluation-succeeded.patch --- diff --git a/queue-3.5/acpi-run-_osc-after-acpi_full_initialization.patch b/queue-3.5/acpi-run-_osc-after-acpi_full_initialization.patch new file mode 100644 index 00000000000..56e2672deee --- /dev/null +++ b/queue-3.5/acpi-run-_osc-after-acpi_full_initialization.patch @@ -0,0 +1,48 @@ +From fc54ab72959edbf229b65ac74b2f122d799ca002 Mon Sep 17 00:00:00 2001 +From: Lin Ming +Date: Mon, 16 Jul 2012 16:30:21 +0800 +Subject: ACPI: run _OSC after ACPI_FULL_INITIALIZATION + +From: Lin Ming + +commit fc54ab72959edbf229b65ac74b2f122d799ca002 upstream. + +The _OSC method may exist in module level code, +so it must be called after ACPI_FULL_INITIALIZATION + +On some new platforms with Zero-Power-Optical-Disk-Drive (ZPODD) +support, this fix is necessary to save power. + +Signed-off-by: Lin Ming +Tested-by: Aaron Lu +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/bus.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/bus.c ++++ b/drivers/acpi/bus.c +@@ -990,8 +990,6 @@ static int __init acpi_bus_init(void) + status = acpi_ec_ecdt_probe(); + /* Ignore result. Not having an ECDT is not fatal. */ + +- acpi_bus_osc_support(); +- + status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n"); +@@ -999,6 +997,12 @@ static int __init acpi_bus_init(void) + } + + /* ++ * _OSC method may exist in module level code, ++ * so it must be run after ACPI_FULL_INITIALIZATION ++ */ ++ acpi_bus_osc_support(); ++ ++ /* + * _PDC control method may load dynamic SSDT tables, + * and we need to install the table handler before that. + */ diff --git a/queue-3.5/drivers-scsi-atp870u.c-fix-bad-use-of-udelay.patch b/queue-3.5/drivers-scsi-atp870u.c-fix-bad-use-of-udelay.patch new file mode 100644 index 00000000000..ca8b6da94cc --- /dev/null +++ b/queue-3.5/drivers-scsi-atp870u.c-fix-bad-use-of-udelay.patch @@ -0,0 +1,58 @@ +From 0f6d93aa9d96cc9022b51bd10d462b03296be146 Mon Sep 17 00:00:00 2001 +From: Martin Michlmayr +Date: Thu, 4 Oct 2012 17:11:25 -0700 +Subject: drivers/scsi/atp870u.c: fix bad use of udelay + +From: Martin Michlmayr + +commit 0f6d93aa9d96cc9022b51bd10d462b03296be146 upstream. + +The ACARD driver calls udelay() with a value > 2000, which leads to to +the following compilation error on ARM: + + ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined! + make[1]: *** [__modpost] Error 1 + +This is because udelay is defined on ARM, roughly speaking, as + + #define udelay(n) ((n) > 2000 ? __bad_udelay() : \ + __const_udelay((n) * ((2199023U*HZ)>>11))) + +The argument to __const_udelay is the number of jiffies to wait divided +by 4, but this does not work unless the multiplication does not +overflow, and that is what the build error is designed to prevent. The +intended behavior can be achieved by using mdelay to call udelay +multiple times in a loop. + +[jrnieder@gmail.com: adding context] +Signed-off-by: Martin Michlmayr +Signed-off-by: Jonathan Nieder +Cc: James Bottomley +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/atp870u.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/atp870u.c ++++ b/drivers/scsi/atp870u.c +@@ -1173,7 +1173,16 @@ wait_io1: + outw(val, tmport); + outb(2, 0x80); + TCM_SYNC: +- udelay(0x800); ++ /* ++ * The funny division into multiple delays is to accomodate ++ * arches like ARM where udelay() multiplies its argument by ++ * a large number to initialize a loop counter. To avoid ++ * overflow, the maximum supported udelay is 2000 microseconds. ++ * ++ * XXX it would be more polite to find a way to use msleep() ++ */ ++ mdelay(2); ++ udelay(48); + if ((inb(tmport) & 0x80) == 0x00) { /* bsy ? */ + outw(0, tmport--); + outb(0, tmport); diff --git a/queue-3.5/kernel-sys.c-call-disable_nonboot_cpus-in-kernel_restart.patch b/queue-3.5/kernel-sys.c-call-disable_nonboot_cpus-in-kernel_restart.patch new file mode 100644 index 00000000000..632d2db16be --- /dev/null +++ b/queue-3.5/kernel-sys.c-call-disable_nonboot_cpus-in-kernel_restart.patch @@ -0,0 +1,38 @@ +From f96972f2dc6365421cf2366ebd61ee4cf060c8d5 Mon Sep 17 00:00:00 2001 +From: Shawn Guo +Date: Thu, 4 Oct 2012 17:12:23 -0700 +Subject: kernel/sys.c: call disable_nonboot_cpus() in kernel_restart() + +From: Shawn Guo + +commit f96972f2dc6365421cf2366ebd61ee4cf060c8d5 upstream. + +As kernel_power_off() calls disable_nonboot_cpus(), we may also want to +have kernel_restart() call disable_nonboot_cpus(). Doing so can help +machines that require boot cpu be the last alive cpu during reboot to +survive with kernel restart. + +This fixes one reboot issue seen on imx6q (Cortex-A9 Quad). The machine +requires that the restart routine be run on the primary cpu rather than +secondary ones. Otherwise, the secondary core running the restart +routine will fail to come to online after reboot. + +Signed-off-by: Shawn Guo +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sys.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/sys.c ++++ b/kernel/sys.c +@@ -368,6 +368,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier + void kernel_restart(char *cmd) + { + kernel_restart_prepare(cmd); ++ disable_nonboot_cpus(); + if (!cmd) + printk(KERN_EMERG "Restarting system.\n"); + else diff --git a/queue-3.5/lib-gcd.c-prevent-possible-div-by-0.patch b/queue-3.5/lib-gcd.c-prevent-possible-div-by-0.patch new file mode 100644 index 00000000000..9b5da7f6e0f --- /dev/null +++ b/queue-3.5/lib-gcd.c-prevent-possible-div-by-0.patch @@ -0,0 +1,38 @@ +From e96875677fb2b7cb739c5d7769824dff7260d31d Mon Sep 17 00:00:00 2001 +From: Davidlohr Bueso +Date: Thu, 4 Oct 2012 17:13:18 -0700 +Subject: lib/gcd.c: prevent possible div by 0 + +From: Davidlohr Bueso + +commit e96875677fb2b7cb739c5d7769824dff7260d31d upstream. + +Account for all properties when a and/or b are 0: +gcd(0, 0) = 0 +gcd(a, 0) = a +gcd(0, b) = b + +Fixes no known problems in current kernels. + +Signed-off-by: Davidlohr Bueso +Cc: Eric Dumazet +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + lib/gcd.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/lib/gcd.c ++++ b/lib/gcd.c +@@ -9,6 +9,9 @@ unsigned long gcd(unsigned long a, unsig + + if (a < b) + swap(a, b); ++ ++ if (!b) ++ return a; + while ((r = a % b) != 0) { + a = b; + b = r; diff --git a/queue-3.5/mfd-max8925-move-_io-resources-out-of-ioport_ioresource.patch b/queue-3.5/mfd-max8925-move-_io-resources-out-of-ioport_ioresource.patch new file mode 100644 index 00000000000..cf857412961 --- /dev/null +++ b/queue-3.5/mfd-max8925-move-_io-resources-out-of-ioport_ioresource.patch @@ -0,0 +1,76 @@ +From bee6e1fa617b1fb7f6f91033428410e05f5ab0ed Mon Sep 17 00:00:00 2001 +From: Mark Brown +Date: Tue, 7 Aug 2012 19:42:43 +0100 +Subject: mfd: max8925: Move _IO resources out of ioport_ioresource + +From: Mark Brown + +commit bee6e1fa617b1fb7f6f91033428410e05f5ab0ed upstream. + +The removal of mach/io.h from most ARM platforms also set the range of +valid IO ports to be empty for most platforms when previously any 32 +bit integer had been valid. This makes it impossible to add IO resources +as the added range is smaller than that of the root resource for IO ports. + +Since we're not really using IO memory at all fix this by defining our +own root resource outside the normal tree and make that the parent of +all IO resources. This also ensures we won't conflict with read IO ports +if we ever run on a platform which happens to use them. + +Signed-off-by: Mark Brown +Acked-by: Haojian Zhuang +Tested-by: Haojian Zhuang +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/max8925-core.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mfd/max8925-core.c ++++ b/drivers/mfd/max8925-core.c +@@ -18,12 +18,19 @@ + #include + #include + ++static struct resource io_parent = { ++ .start = 0, ++ .end = 0xffffffff, ++ .flags = IORESOURCE_IO, ++}; ++ + static struct resource backlight_resources[] = { + { + .name = "max8925-backlight", + .start = MAX8925_WLED_MODE_CNTL, + .end = MAX8925_WLED_CNTL, + .flags = IORESOURCE_IO, ++ .parent = &io_parent, + }, + }; + +@@ -42,6 +49,7 @@ static struct resource touch_resources[] + .start = MAX8925_TSC_IRQ, + .end = MAX8925_ADC_RES_END, + .flags = IORESOURCE_IO, ++ .parent = &io_parent, + }, + }; + +@@ -60,6 +68,7 @@ static struct resource power_supply_reso + .start = MAX8925_CHG_IRQ1, + .end = MAX8925_CHG_IRQ1_MASK, + .flags = IORESOURCE_IO, ++ .parent = &io_parent, + }, + }; + +@@ -118,6 +127,7 @@ static struct mfd_cell onkey_devs[] = { + .start = MAX8925_##_start, \ + .end = MAX8925_##_end, \ + .flags = IORESOURCE_IO, \ ++ .parent = &io_parent, \ + } + + static struct resource regulator_resources[] = { diff --git a/queue-3.5/pci-acpiphp-check-whether-_adr-evaluation-succeeded.patch b/queue-3.5/pci-acpiphp-check-whether-_adr-evaluation-succeeded.patch new file mode 100644 index 00000000000..fd17a0bb90f --- /dev/null +++ b/queue-3.5/pci-acpiphp-check-whether-_adr-evaluation-succeeded.patch @@ -0,0 +1,55 @@ +From dfb117b3e50c52c7b3416db4a4569224b8db80bb Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Wed, 20 Jun 2012 16:18:29 -0600 +Subject: PCI: acpiphp: check whether _ADR evaluation succeeded + +From: Bjorn Helgaas + +commit dfb117b3e50c52c7b3416db4a4569224b8db80bb upstream. + +Check whether we evaluated _ADR successfully. Previously we ignored +failure, so we would have used garbage data from the stack as the device +and function number. + +We return AE_OK so that we ignore only this slot and continue looking +for other slots. + +Found by Coverity (CID 113981). + +Signed-off-by: Bjorn Helgaas +Signed-off-by: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/hotplug/acpiphp_glue.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/pci/hotplug/acpiphp_glue.c ++++ b/drivers/pci/hotplug/acpiphp_glue.c +@@ -132,6 +132,15 @@ register_slot(acpi_handle handle, u32 lv + if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle)) + return AE_OK; + ++ status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); ++ if (ACPI_FAILURE(status)) { ++ warn("can't evaluate _ADR (%#x)\n", status); ++ return AE_OK; ++ } ++ ++ device = (adr >> 16) & 0xffff; ++ function = adr & 0xffff; ++ + pdev = pbus->self; + if (pdev && pci_is_pcie(pdev)) { + tmp = acpi_find_root_bridge_handle(pdev); +@@ -144,10 +153,6 @@ register_slot(acpi_handle handle, u32 lv + } + } + +- acpi_evaluate_integer(handle, "_ADR", NULL, &adr); +- device = (adr >> 16) & 0xffff; +- function = adr & 0xffff; +- + newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL); + if (!newfunc) + return AE_NO_MEMORY; diff --git a/queue-3.5/series b/queue-3.5/series index f628fe70b7b..2dca89e31a5 100644 --- a/queue-3.5/series +++ b/queue-3.5/series @@ -8,3 +8,9 @@ arm-7548-1-include-linux-sched.h-in-syscall.h.patch em28xx-make-all-em28xx-extensions-to-be-initialized-asynchronously.patch media-rc-ite-cir-initialise-ite_dev-rdev-earlier.patch media-gspca_pac7302-add-support-for-device-1ae7-2001-speedlink-snappy-microphone-sl-6825-sbk.patch +acpi-run-_osc-after-acpi_full_initialization.patch +pci-acpiphp-check-whether-_adr-evaluation-succeeded.patch +mfd-max8925-move-_io-resources-out-of-ioport_ioresource.patch +lib-gcd.c-prevent-possible-div-by-0.patch +kernel-sys.c-call-disable_nonboot_cpus-in-kernel_restart.patch +drivers-scsi-atp870u.c-fix-bad-use-of-udelay.patch