From 90268104c4129e76f70f4c83a06502c034910b5f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 9 Apr 2013 15:29:28 -0700 Subject: [PATCH] 3.8-stable patches added patches: alpha-add-irongate_io-to-pci-bus-resources.patch libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch libata-use-integer-return-value-for-atapi_command_packet_set.patch mips-unbreak-function-tracer-for-64-bit-kernel.patch pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch pci-pm-disable-runtime-pm-of-pcie-ports.patch --- ...add-irongate_io-to-pci-bus-resources.patch | 43 ++++++++ ...-in-reading-devslp_timing-parameters.patch | 36 ++++++ ...535-for-slimtype-dvd-a-ds8a8sh-drive.patch | 103 ++++++++++++++++++ ...n-value-for-atapi_command_packet_set.patch | 37 +++++++ ...ak-function-tracer-for-64-bit-kernel.patch | 54 +++++++++ ...devices-on-acpi-wakeup-notifications.patch | 59 ++++++++++ ...-pm-disable-runtime-pm-of-pcie-ports.patch | 66 +++++++++++ queue-3.8/series | 7 ++ 8 files changed, 405 insertions(+) create mode 100644 queue-3.8/alpha-add-irongate_io-to-pci-bus-resources.patch create mode 100644 queue-3.8/libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch create mode 100644 queue-3.8/libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch create mode 100644 queue-3.8/libata-use-integer-return-value-for-atapi_command_packet_set.patch create mode 100644 queue-3.8/mips-unbreak-function-tracer-for-64-bit-kernel.patch create mode 100644 queue-3.8/pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch create mode 100644 queue-3.8/pci-pm-disable-runtime-pm-of-pcie-ports.patch diff --git a/queue-3.8/alpha-add-irongate_io-to-pci-bus-resources.patch b/queue-3.8/alpha-add-irongate_io-to-pci-bus-resources.patch new file mode 100644 index 00000000000..2c031b6308d --- /dev/null +++ b/queue-3.8/alpha-add-irongate_io-to-pci-bus-resources.patch @@ -0,0 +1,43 @@ +From aa8b4be3ac049c8b1df2a87e4d1d902ccfc1f7a9 Mon Sep 17 00:00:00 2001 +From: Jay Estabrook +Date: Sun, 7 Apr 2013 21:36:09 +1200 +Subject: alpha: Add irongate_io to PCI bus resources + +From: Jay Estabrook + +commit aa8b4be3ac049c8b1df2a87e4d1d902ccfc1f7a9 upstream. + +Fixes a NULL pointer dereference at boot on UP1500. + +Reviewed-and-Tested-by: Matt Turner +Signed-off-by: Jay Estabrook +Signed-off-by: Matt Turner +Signed-off-by: Michael Cree +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/alpha/kernel/sys_nautilus.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/alpha/kernel/sys_nautilus.c ++++ b/arch/alpha/kernel/sys_nautilus.c +@@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vec + extern void free_reserved_mem(void *, void *); + extern void pcibios_claim_one_bus(struct pci_bus *); + ++static struct resource irongate_io = { ++ .name = "Irongate PCI IO", ++ .flags = IORESOURCE_IO, ++}; + static struct resource irongate_mem = { + .name = "Irongate PCI MEM", + .flags = IORESOURCE_MEM, +@@ -209,6 +213,7 @@ nautilus_init_pci(void) + + irongate = pci_get_bus_and_slot(0, 0); + bus->self = irongate; ++ bus->resource[0] = &irongate_io; + bus->resource[1] = &irongate_mem; + + pci_bus_size_bridges(bus); diff --git a/queue-3.8/libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch b/queue-3.8/libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch new file mode 100644 index 00000000000..9ffaf0e26d7 --- /dev/null +++ b/queue-3.8/libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch @@ -0,0 +1,36 @@ +From 8e725c7f8a60feaa88edacd4dee2c754d5ae7706 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Fri, 29 Mar 2013 11:54:55 +0000 +Subject: libata: fix DMA to stack in reading devslp_timing parameters + +From: David Woodhouse + +commit 8e725c7f8a60feaa88edacd4dee2c754d5ae7706 upstream. + +Commit 803739d25c2343da6d2f95eebdcbc08bf67097d4 ("[libata] replace +sata_settings with devslp_timing"), which was also Cc: stable, used a +stack buffer to receive data from ata_read_log_page(), which triggers +the following warning: + ahci 0000:00:1f.2: DMA-API: device driver maps memory fromstack [addr=ffff880140469948] + +Fix this by using ap->sector_buf instead of a stack buffer. + +Signed-off-by: David Woodhouse +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device + * from SATA Settings page of Identify Device Data Log. + */ + if (ata_id_has_devslp(dev->id)) { +- u8 sata_setting[ATA_SECT_SIZE]; ++ u8 *sata_setting = ap->sector_buf; + int i, j; + + dev->flags |= ATA_DFLAG_DEVSLP; diff --git a/queue-3.8/libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch b/queue-3.8/libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch new file mode 100644 index 00000000000..a2ca4902e09 --- /dev/null +++ b/queue-3.8/libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch @@ -0,0 +1,103 @@ +From a32450e127fc6e5ca6d958ceb3cfea4d30a00846 Mon Sep 17 00:00:00 2001 +From: Shan Hai +Date: Mon, 18 Mar 2013 10:30:44 +0800 +Subject: libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive + +From: Shan Hai + +commit a32450e127fc6e5ca6d958ceb3cfea4d30a00846 upstream. + +The Slimtype DVD A DS8A8SH drive locks up when max sector is smaller than +65535, and the blow backtrace is observed on locking up: + +INFO: task flush-8:32:1130 blocked for more than 120 seconds. +"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. +flush-8:32 D ffffffff8180cf60 0 1130 2 0x00000000 + ffff880273aef618 0000000000000046 0000000000000005 ffff880273aee000 + ffff880273aee000 ffff880273aeffd8 ffff880273aee010 ffff880273aee000 + ffff880273aeffd8 ffff880273aee000 ffff88026e842ea0 ffff880274a10000 +Call Trace: + [] schedule+0x5d/0x70 + [] io_schedule+0x8c/0xd0 + [] get_request+0x731/0x7d0 + [] ? cfq_allow_merge+0x50/0x90 + [] ? wake_up_bit+0x40/0x40 + [] ? bio_attempt_back_merge+0x33/0x110 + [] blk_queue_bio+0x23a/0x3f0 + [] generic_make_request+0xc6/0x120 + [] submit_bio+0x138/0x160 + [] ? bio_alloc_bioset+0x96/0x120 + [] submit_bh+0x1f1/0x220 + [] __block_write_full_page+0x228/0x340 + [] ? attach_nobh_buffers+0xc0/0xc0 + [] ? I_BDEV+0x10/0x10 + [] ? I_BDEV+0x10/0x10 + [] block_write_full_page_endio+0xe6/0x100 + [] block_write_full_page+0x15/0x20 + [] blkdev_writepage+0x18/0x20 + [] __writepage+0x17/0x40 + [] write_cache_pages+0x34a/0x4a0 + [] ? set_page_dirty+0x70/0x70 + [] generic_writepages+0x51/0x80 + [] do_writepages+0x20/0x50 + [] __writeback_single_inode+0xa6/0x2b0 + [] writeback_sb_inodes+0x311/0x4d0 + [] __writeback_inodes_wb+0x86/0xd0 + [] wb_writeback+0x1a3/0x330 + [] ? _raw_spin_lock_irqsave+0x3f/0x50 + [] ? get_nr_inodes+0x52/0x70 + [] wb_do_writeback+0x1dc/0x260 + [] ? schedule_timeout+0x204/0x240 + [] bdi_writeback_thread+0x102/0x2b0 + [] ? wb_do_writeback+0x260/0x260 + [] kthread+0xc0/0xd0 + [] ? kthread_worker_fn+0x1b0/0x1b0 + [] ret_from_fork+0x7c/0xb0 + [] ? kthread_worker_fn+0x1b0/0x1b0 + + The above trace was triggered by + "dd if=/dev/zero of=/dev/sr0 bs=2048 count=32768" + + It was previously working by accident, since another bug introduced + by 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) caused + all drives to use maxsect=65535. + +Signed-off-by: Shan Hai +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 4 ++++ + include/linux/libata.h | 1 + + 2 files changed, 5 insertions(+) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -2437,6 +2437,9 @@ int ata_dev_configure(struct ata_device + dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, + dev->max_sectors); + ++ if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48) ++ dev->max_sectors = ATA_MAX_SECTORS_LBA48; ++ + if (ap->ops->dev_config) + ap->ops->dev_config(dev); + +@@ -4098,6 +4101,7 @@ static const struct ata_blacklist_entry + /* Weird ATAPI devices */ + { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, + { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, ++ { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, + + /* Devices we expect to fail diagnostics */ + +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -398,6 +398,7 @@ enum { + ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ + ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ + ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ ++ ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ + + /* DMA mask for user DMA control: User visible values; DO NOT + renumber */ diff --git a/queue-3.8/libata-use-integer-return-value-for-atapi_command_packet_set.patch b/queue-3.8/libata-use-integer-return-value-for-atapi_command_packet_set.patch new file mode 100644 index 00000000000..e3f0f07e872 --- /dev/null +++ b/queue-3.8/libata-use-integer-return-value-for-atapi_command_packet_set.patch @@ -0,0 +1,37 @@ +From d8668fcb0b257d9fdcfbe5c172a99b8d85e1cd82 Mon Sep 17 00:00:00 2001 +From: Shan Hai +Date: Mon, 18 Mar 2013 10:30:43 +0800 +Subject: libata: Use integer return value for atapi_command_packet_set + +From: Shan Hai + +commit d8668fcb0b257d9fdcfbe5c172a99b8d85e1cd82 upstream. + +The function returns type of ATAPI drives so it should return integer value. +The commit 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) since +v2.6.39 changed the type of return value from int to bool, the change would +cause all of the ATAPI class drives to be treated as TYPE_TAPE and the +max_sectors of the drives to be set to 65535 because of the commit +f8d8e5799b7(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the +function would return true for all ATAPI class drives and the TYPE_TAPE is +defined as 0x01. + +Signed-off-by: Shan Hai +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/ata.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/ata.h ++++ b/include/linux/ata.h +@@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u1 + } + } + +-static inline bool atapi_command_packet_set(const u16 *dev_id) ++static inline int atapi_command_packet_set(const u16 *dev_id) + { + return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; + } diff --git a/queue-3.8/mips-unbreak-function-tracer-for-64-bit-kernel.patch b/queue-3.8/mips-unbreak-function-tracer-for-64-bit-kernel.patch new file mode 100644 index 00000000000..3789e7395fd --- /dev/null +++ b/queue-3.8/mips-unbreak-function-tracer-for-64-bit-kernel.patch @@ -0,0 +1,54 @@ +From ad8c396936e328f5344e1881afde9e28d5f2045f Mon Sep 17 00:00:00 2001 +From: David Daney +Date: Tue, 2 Apr 2013 22:59:29 +0000 +Subject: MIPS: Unbreak function tracer for 64-bit kernel. + +From: David Daney + +commit ad8c396936e328f5344e1881afde9e28d5f2045f upstream. + +Commit 58b69401c797 [MIPS: Function tracer: Fix broken function tracing] +completely broke the function tracer for 64-bit kernels. The symptom is +a system hang very early in the boot process. + +The fix: Remove/fix $sp adjustments for 64-bit case. + +Signed-off-by: David Daney +Cc: linux-mips@linux-mips.org +Cc: Al Cooper +Cc: viric@viric.name +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/kernel/mcount.S | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/arch/mips/kernel/mcount.S ++++ b/arch/mips/kernel/mcount.S +@@ -46,10 +46,9 @@ + PTR_L a5, PT_R9(sp) + PTR_L a6, PT_R10(sp) + PTR_L a7, PT_R11(sp) +-#else +- PTR_ADDIU sp, PT_SIZE + #endif +-.endm ++ PTR_ADDIU sp, PT_SIZE ++ .endm + + .macro RETURN_BACK + jr ra +@@ -68,7 +67,11 @@ NESTED(ftrace_caller, PT_SIZE, ra) + .globl _mcount + _mcount: + b ftrace_stub +- addiu sp,sp,8 ++#ifdef CONFIG_32BIT ++ addiu sp,sp,8 ++#else ++ nop ++#endif + + /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ + lw t1, function_trace_stop diff --git a/queue-3.8/pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch b/queue-3.8/pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch new file mode 100644 index 00000000000..bf154debc90 --- /dev/null +++ b/queue-3.8/pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch @@ -0,0 +1,59 @@ +From 24ad0ef9c8b946ed2abe681e4e44f4a1e643d882 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 28 Mar 2013 11:07:29 +0000 +Subject: PCI/ACPI: Always resume devices on ACPI wakeup notifications + +From: "Rafael J. Wysocki" + +commit 24ad0ef9c8b946ed2abe681e4e44f4a1e643d882 upstream. + +It turns out that the _Lxx control methods provided by some BIOSes +clear the PME Status bit of PCI devices they handle, which means that +pci_acpi_wake_dev() cannot really use that bit to check whether or +not the device has signalled wakeup. + +One symptom of the problem is, for example, that when an affected PCI +USB controller is runtime-suspended, then plugging in a new USB device +into one of the controller's ports will not wake up the controller, +which should happen. + +For this reason, make pci_acpi_wake_dev() always attempt to resume +the device it is called for regardless of the device's PME Status bit +value (that bit still has to be cleared if set at this point, +though). + +Reported-by: Sarah Sharp +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Bjorn Helgaas +Acked-by: Matthew Garrett +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci-acpi.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/pci/pci-acpi.c ++++ b/drivers/pci/pci-acpi.c +@@ -53,14 +53,15 @@ static void pci_acpi_wake_dev(acpi_handl + return; + } + +- if (!pci_dev->pm_cap || !pci_dev->pme_support +- || pci_check_pme_status(pci_dev)) { +- if (pci_dev->pme_poll) +- pci_dev->pme_poll = false; ++ /* Clear PME Status if set. */ ++ if (pci_dev->pme_support) ++ pci_check_pme_status(pci_dev); + +- pci_wakeup_event(pci_dev); +- pm_runtime_resume(&pci_dev->dev); +- } ++ if (pci_dev->pme_poll) ++ pci_dev->pme_poll = false; ++ ++ pci_wakeup_event(pci_dev); ++ pm_runtime_resume(&pci_dev->dev); + + if (pci_dev->subordinate) + pci_pme_wakeup_bus(pci_dev->subordinate); diff --git a/queue-3.8/pci-pm-disable-runtime-pm-of-pcie-ports.patch b/queue-3.8/pci-pm-disable-runtime-pm-of-pcie-ports.patch new file mode 100644 index 00000000000..424b601d7ca --- /dev/null +++ b/queue-3.8/pci-pm-disable-runtime-pm-of-pcie-ports.patch @@ -0,0 +1,66 @@ +From de7d5f729c72638f41d7c17487bccb1c570ff144 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Sat, 30 Mar 2013 23:38:02 +0100 +Subject: PCI/PM: Disable runtime PM of PCIe ports + +From: "Rafael J. Wysocki" + +commit de7d5f729c72638f41d7c17487bccb1c570ff144 upstream. + +The runtime PM of PCIe ports turns out to be quite fragile, as in +some cases things work while in some other cases they don't and we +don't seem to have a good way to determine whether or not they are +going to work in advance. + +For this reason, avoid enabling runtime PM for PCIe ports by +keeping their runtime PM reference counters always above 0 for the +time being. + +When a PCIe port is suspended, it can no longer report events like +hotplug, so hotplug below the port may not work, as in the bug +report below. + +[bhelgaas: changelog, stable] +Reference: https://bugzilla.kernel.org/show_bug.cgi?id=53811 +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pcie/portdrv_pci.c | 13 ------------- + 1 file changed, 13 deletions(-) + +--- a/drivers/pci/pcie/portdrv_pci.c ++++ b/drivers/pci/pcie/portdrv_pci.c +@@ -185,14 +185,6 @@ static const struct dev_pm_ops pcie_port + #endif /* !PM */ + + /* +- * PCIe port runtime suspend is broken for some chipsets, so use a +- * black list to disable runtime PM for these chipsets. +- */ +-static const struct pci_device_id port_runtime_pm_black_list[] = { +- { /* end: all zeroes */ } +-}; +- +-/* + * pcie_portdrv_probe - Probe PCI-Express port devices + * @dev: PCI-Express port device being probed + * +@@ -225,16 +217,11 @@ static int pcie_portdrv_probe(struct pci + * it by default. + */ + dev->d3cold_allowed = false; +- if (!pci_match_id(port_runtime_pm_black_list, dev)) +- pm_runtime_put_noidle(&dev->dev); +- + return 0; + } + + static void pcie_portdrv_remove(struct pci_dev *dev) + { +- if (!pci_match_id(port_runtime_pm_black_list, dev)) +- pm_runtime_get_noresume(&dev->dev); + pcie_port_device_remove(dev); + pci_disable_device(dev); + } diff --git a/queue-3.8/series b/queue-3.8/series index 82ede788250..92306ae3693 100644 --- a/queue-3.8/series +++ b/queue-3.8/series @@ -21,3 +21,10 @@ mm-prevent-mmap_cache-race-in-find_vma.patch eisa-pci-init-eisa-early-before-pnp.patch eisa-pci-fix-bus-res-reference.patch ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch +libata-use-integer-return-value-for-atapi_command_packet_set.patch +libata-set-max-sector-to-65535-for-slimtype-dvd-a-ds8a8sh-drive.patch +libata-fix-dma-to-stack-in-reading-devslp_timing-parameters.patch +mips-unbreak-function-tracer-for-64-bit-kernel.patch +alpha-add-irongate_io-to-pci-bus-resources.patch +pci-acpi-always-resume-devices-on-acpi-wakeup-notifications.patch +pci-pm-disable-runtime-pm-of-pcie-ports.patch -- 2.47.3