]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0015-scsi-hpsa-disable-device-during-shutdown.patch
18109a63bc794aca5be171458fd7d331cdf81447
[pve-kernel.git] / patches / kernel / 0015-scsi-hpsa-disable-device-during-shutdown.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 Date: Sun, 1 Jul 2018 18:22:37 +0200
4 Subject: [PATCH] scsi: hpsa: disable device during shutdown
5
6 4.17-stable review patch. If anyone has any objections, please let me know.
7
8 ------------------
9
10 From: Sinan Kaya <okaya@codeaurora.org>
11
12 commit 0d98ba8d70b0070ac117452ea0b663e26bbf46bf upstream.
13
14 'Commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during
15 shutdown")' has been added to kernel to shutdown pending PCIe port service
16 interrupts during reboot so that a newly started kexec kernel wouldn't
17 observe pending interrupts.
18
19 pcie_port_device_remove() is disabling the root port and switches by
20 calling pci_disable_device() after all PCIe service drivers are shutdown.
21
22 This has been found to cause crashes on HP DL360 Gen9 machines during
23 reboot due to hpsa driver not clearing the bus master bit during the
24 shutdown procedure by calling pci_disable_device().
25
26 Disable device as part of the shutdown sequence.
27
28 Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
29 Link: https://bugzilla.kernel.org/show_bug.cgi?id=199779
30 Fixes: cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")
31 Cc: stable@vger.kernel.org
32 Reported-by: Ryan Finnie <ryan@finnie.org>
33 Tested-by: Don Brace <don.brace@microsemi.com>
34 Acked-by: Don Brace <don.brace@microsemi.com>
35 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
36 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
37 Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
38 ---
39 drivers/scsi/hpsa.c | 10 ++++++++--
40 1 file changed, 8 insertions(+), 2 deletions(-)
41
42 diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
43 index 211975cc28c9..2d4b5177d1a2 100644
44 --- a/drivers/scsi/hpsa.c
45 +++ b/drivers/scsi/hpsa.c
46 @@ -8879,7 +8879,7 @@ static void hpsa_disable_rld_caching(struct ctlr_info *h)
47 kfree(options);
48 }
49
50 -static void hpsa_shutdown(struct pci_dev *pdev)
51 +static void __hpsa_shutdown(struct pci_dev *pdev)
52 {
53 struct ctlr_info *h;
54
55 @@ -8894,6 +8894,12 @@ static void hpsa_shutdown(struct pci_dev *pdev)
56 hpsa_disable_interrupt_mode(h); /* pci_init 2 */
57 }
58
59 +static void hpsa_shutdown(struct pci_dev *pdev)
60 +{
61 + __hpsa_shutdown(pdev);
62 + pci_disable_device(pdev);
63 +}
64 +
65 static void hpsa_free_device_info(struct ctlr_info *h)
66 {
67 int i;
68 @@ -8937,7 +8943,7 @@ static void hpsa_remove_one(struct pci_dev *pdev)
69 scsi_remove_host(h->scsi_host); /* init_one 8 */
70 /* includes hpsa_free_irqs - init_one 4 */
71 /* includes hpsa_disable_interrupt_mode - pci_init 2 */
72 - hpsa_shutdown(pdev);
73 + __hpsa_shutdown(pdev);
74
75 hpsa_free_device_info(h); /* scan */
76