From 3c86003291ee6480502e3b9fcf9c15a29f02532d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 24 Jan 2013 12:58:53 -0800 Subject: [PATCH] 3.4-stable patches added patches: acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch acpi-processor-get-power-info-before-updating-the-c-states.patch ioat-fix-dma-memory-sync-direction-correct-flag.patch --- ...nter-issues-when-cpuidle-is-disabled.patch | 81 +++++++++++++++++++ ...er-info-before-updating-the-c-states.patch | 32 ++++++++ ...a-memory-sync-direction-correct-flag.patch | 66 +++++++++++++++ queue-3.4/series | 3 + 4 files changed, 182 insertions(+) create mode 100644 queue-3.4/acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch create mode 100644 queue-3.4/acpi-processor-get-power-info-before-updating-the-c-states.patch create mode 100644 queue-3.4/ioat-fix-dma-memory-sync-direction-correct-flag.patch diff --git a/queue-3.4/acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch b/queue-3.4/acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch new file mode 100644 index 00000000000..fa0ced3622f --- /dev/null +++ b/queue-3.4/acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch @@ -0,0 +1,81 @@ +From b88a634a903d9670aa5f2f785aa890628ce0dece Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Wed, 16 Jan 2013 23:40:07 +0100 +Subject: ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled + +From: Konrad Rzeszutek Wilk + +commit b88a634a903d9670aa5f2f785aa890628ce0dece upstream. + +If cpuidle is disabled, that means that: + + per_cpu(acpi_cpuidle_device, pr->id) + +is set to NULL as the acpi_processor_power_init ends up failing at + + retval = cpuidle_register_driver(&acpi_idle_driver) + +(in acpi_processor_power_init) and never sets the per_cpu idle +device. So when acpi_processor_hotplug on CPU online notification +tries to reference said device it crashes: + +cpu 3 spinlock event irq 62 +BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 +IP: [] acpi_processor_setup_cpuidle_cx+0x3f/0x105 +PGD a259b067 PUD ab38b067 PMD 0 +Oops: 0002 [#1] SMP +odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf +CPU 1 +Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680) +RIP: e030:[] [] acpi_processor_setup_cpuidle_cx+0x3f/0x105 +RSP: e02b:ffff88001742dca8 EFLAGS: 00010202 +RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000 +RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800 +RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200 +R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800 +R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0 +FS: 00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000 +CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 +Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000) +Stack: + 0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800 + 0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0 + ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336 +Call Trace: + [] acpi_processor_hotplug+0x7c/0x9f + [] ? schedule_delayed_work_on+0x16/0x20 + [] acpi_cpu_soft_notify+0x90/0xca + [] notifier_call_chain+0x4d/0x70 + [] __raw_notifier_call_chain+0x9/0x10 + [] __cpu_notify+0x1b/0x30 + [] _cpu_up+0x103/0x14b + [] cpu_up+0xd9/0xec + [] store_online+0x94/0xd0 + [] dev_attr_store+0x1b/0x20 + [] sysfs_write_file+0xf4/0x170 + +This patch fixes it. + +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/processor_idle.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -1018,6 +1018,9 @@ static int acpi_processor_setup_cpuidle_ + return -EINVAL; + } + ++ if (!dev) ++ return -EINVAL; ++ + dev->cpu = pr->id; + + if (max_cstate == 0) diff --git a/queue-3.4/acpi-processor-get-power-info-before-updating-the-c-states.patch b/queue-3.4/acpi-processor-get-power-info-before-updating-the-c-states.patch new file mode 100644 index 00000000000..9034fa50fc7 --- /dev/null +++ b/queue-3.4/acpi-processor-get-power-info-before-updating-the-c-states.patch @@ -0,0 +1,32 @@ +From f427e5f1cf75bba84cccdac1d8a90552d9ae1065 Mon Sep 17 00:00:00 2001 +From: Thomas Schlichter +Date: Sat, 19 Jan 2013 00:28:22 +0100 +Subject: ACPI / processor: Get power info before updating the C-states + +From: Thomas Schlichter + +commit f427e5f1cf75bba84cccdac1d8a90552d9ae1065 upstream. + +acpi_processor_get_power_info() has to be called before +acpi_processor_setup_cpuidle_states() to have the latest +information available. This fixes the missing C-state information +after AC-->DC transition. + +Signed-off-by: Thomas Schlichter +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/processor_idle.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -1208,6 +1208,7 @@ int acpi_processor_cst_has_changed(struc + } + + /* Populate Updated C-state information */ ++ acpi_processor_get_power_info(pr); + acpi_processor_setup_cpuidle_states(pr); + + /* Enable all cpuidle devices */ diff --git a/queue-3.4/ioat-fix-dma-memory-sync-direction-correct-flag.patch b/queue-3.4/ioat-fix-dma-memory-sync-direction-correct-flag.patch new file mode 100644 index 00000000000..5e1b6c723f6 --- /dev/null +++ b/queue-3.4/ioat-fix-dma-memory-sync-direction-correct-flag.patch @@ -0,0 +1,66 @@ +From ac4989874af56435c308bdde9ad9c837a26f8b23 Mon Sep 17 00:00:00 2001 +From: Shuah Khan +Date: Thu, 25 Oct 2012 10:22:32 -0600 +Subject: ioat: Fix DMA memory sync direction correct flag + +From: Shuah Khan + +commit ac4989874af56435c308bdde9ad9c837a26f8b23 upstream. + +ioat does DMA memory sync with DMA_TO_DEVICE direction on a buffer allocated +for DMA_FROM_DEVICE dma, resulting in the following warning from dma debug. +Fixed the dma_sync_single_for_device() call to use the correct direction. + +[ 226.288947] WARNING: at lib/dma-debug.c:990 check_sync+0x132/0x550() +[ 226.288948] Hardware name: ProLiant DL380p Gen8 +[ 226.288951] ioatdma 0000:00:04.0: DMA-API: device driver syncs DMA memory with different direction [device address=0x00000000ffff7000] [size=4096 bytes] [mapped with DMA_FROM_DEVICE] [synced with DMA_TO_DEVICE] +[ 226.288953] Modules linked in: iTCO_wdt(+) sb_edac(+) ioatdma(+) microcode serio_raw pcspkr edac_core hpwdt(+) iTCO_vendor_support hpilo(+) dca acpi_power_meter ata_generic pata_acpi sd_mod crc_t10dif ata_piix libata hpsa tg3 netxen_nic(+) sunrpc dm_mirror dm_region_hash dm_log dm_mod +[ 226.288967] Pid: 1055, comm: work_for_cpu Tainted: G W 3.3.0-0.20.el7.x86_64 #1 +[ 226.288968] Call Trace: +[ 226.288974] [] warn_slowpath_common+0x7f/0xc0 +[ 226.288977] [] warn_slowpath_fmt+0x46/0x50 +[ 226.288980] [] check_sync+0x132/0x550 +[ 226.288983] [] debug_dma_sync_single_for_device+0x3f/0x50 +[ 226.288988] [] ? wait_for_common+0x72/0x180 +[ 226.288995] [] ioat_xor_val_self_test+0x3e5/0x832 [ioatdma] +[ 226.288999] [] ? kfree+0x259/0x270 +[ 226.289004] [] ioat3_dma_self_test+0x1b/0x20 [ioatdma] +[ 226.289008] [] ioat_probe+0x2f8/0x348 [ioatdma] +[ 226.289011] [] ioat3_dma_probe+0x1d5/0x2aa [ioatdma] +[ 226.289016] [] ioat_pci_probe+0x139/0x17c [ioatdma] +[ 226.289020] [] local_pci_probe+0x5c/0xd0 +[ 226.289023] [] ? destroy_work_on_stack+0x20/0x20 +[ 226.289025] [] do_work_for_cpu+0x18/0x30 +[ 226.289029] [] kthread+0xb7/0xc0 +[ 226.289033] [] kernel_thread_helper+0x4/0x10 +[ 226.289036] [] ? _raw_spin_unlock_irq+0x30/0x50 +[ 226.289038] [] ? retint_restore_args+0x13/0x13 +[ 226.289041] [] ? kthread_worker_fn+0x1a0/0x1a0 +[ 226.289044] [] ? gs_change+0x13/0x13 +[ 226.289045] ---[ end trace e1618afc7a606089 ]--- +[ 226.289047] Mapped at: +[ 226.289048] [] debug_dma_map_page+0x87/0x150 +[ 226.289050] [] dma_map_page.constprop.18+0x70/0xb34 [ioatdma] +[ 226.289054] [] ioat_xor_val_self_test+0x1d8/0x832 [ioatdma] +[ 226.289058] [] ioat3_dma_self_test+0x1b/0x20 [ioatdma] +[ 226.289061] [] ioat_probe+0x2f8/0x348 [ioatdma] + +Signed-off-by: Shuah Khan +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/ioat/dma_v3.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/dma/ioat/dma_v3.c ++++ b/drivers/dma/ioat/dma_v3.c +@@ -951,7 +951,7 @@ static int __devinit ioat_xor_val_self_t + goto free_resources; + } + } +- dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_TO_DEVICE); ++ dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_FROM_DEVICE); + + /* skip validate if the capability is not present */ + if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask)) diff --git a/queue-3.4/series b/queue-3.4/series index 526b1e65cbc..686c78c456a 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -17,3 +17,6 @@ drivers-firmware-dmi_scan.c-fetch-dmi-version-from-smbios-if-it-exists.patch ahci-add-identifiers-for-asm106x-devices.patch alsa-usb-audio-fix-regression-by-disconnection-race-fix-patch.patch drm-i915-implement-wadisablehizplaneswhenmsaaenabled.patch +acpi-cpuidle-fix-null-pointer-issues-when-cpuidle-is-disabled.patch +acpi-processor-get-power-info-before-updating-the-c-states.patch +ioat-fix-dma-memory-sync-direction-correct-flag.patch -- 2.47.3