Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1441187 > unrolled thread

[PATCH] mpt3sas: Fix panic when aer correct error occured

Started byKefeng Wang <wangkefeng.wang@huawei.com>
First post2016-07-12 11:50 +0200
Last post2016-07-15 21:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mpt3sas: Fix panic when aer correct error occured Kefeng Wang <wangkefeng.wang@huawei.com> - 2016-07-12 11:50 +0200
    RE: [PATCH] mpt3sas: Fix panic when aer correct error occured Chaitra Basappa <chaitra.basappa@broadcom.com> - 2016-07-14 12:50 +0200
    Re: [PATCH] mpt3sas: Fix panic when aer correct error occured "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-07-15 21:10 +0200

#1441187 — [PATCH] mpt3sas: Fix panic when aer correct error occured

FromKefeng Wang <wangkefeng.wang@huawei.com>
Date2016-07-12 11:50 +0200
Subject[PATCH] mpt3sas: Fix panic when aer correct error occured
Message-ID<rU2ue-37M-17@gated-at.bofh.it>
The _scsih_pci_mmio_enabled called if scsih_pci_error_detected returns
PCI_ERS_RESULT_CAN_RECOVER, at this point, read/write to the device
still works, no need to reset slot.

Or the mpt3sas_base_map_resources in scsih_pci_slot_reset will fail,
and iounamp ioc->chip, then we will meet issue when read ioc->chip
in mpt3sas_base_get_iocstate from _base_fault_reset_work.

Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---

NOTE: I found this with an earlier kernel version, but the logic is not changed.

 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 6bff13e..eedd62e3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -9033,8 +9033,11 @@ scsih_pci_mmio_enabled(struct pci_dev *pdev)
 
 	/* TODO - dump whatever for debugging purposes */
 
-	/* Request a slot reset. */
-	return PCI_ERS_RESULT_NEED_RESET;
+	/* This called only if scsih_pci_error_detected returns
+	 * PCI_ERS_RESULT_CAN_RECOVER, read/write to the device
+	 * still works, not need to reset slot.
+	 */
+	return PCI_ERS_RESULT_RECOVERED;
 }
 
 /*
-- 
1.7.12.4

[toc] | [next] | [standalone]


#1443352

FromChaitra Basappa <chaitra.basappa@broadcom.com>
Date2016-07-14 12:50 +0200
Message-ID<rUMnp-8m-47@gated-at.bofh.it>
In reply to#1441187
Hi,
 Please consider this patch as Acked-by: Chaitra P B
<chaitra.basappa@broadcom.com>

Thanks,
 Chaitra

-----Original Message-----
From: Kefeng Wang [mailto:wangkefeng.wang@huawei.com]
Sent: Tuesday, July 12, 2016 3:13 PM
To: martin.petersen@oracle.com; suganath-prabu.subramani@broadcom.com;
MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
guohanjun@huawei.com; Kefeng Wang; Sathya Prakash; Chaitra P B
Subject: [PATCH] mpt3sas: Fix panic when aer correct error occured

The _scsih_pci_mmio_enabled called if scsih_pci_error_detected returns
PCI_ERS_RESULT_CAN_RECOVER, at this point, read/write to the device still
works, no need to reset slot.

Or the mpt3sas_base_map_resources in scsih_pci_slot_reset will fail, and
iounamp ioc->chip, then we will meet issue when read ioc->chip in
mpt3sas_base_get_iocstate from _base_fault_reset_work.

Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---

NOTE: I found this with an earlier kernel version, but the logic is not
changed.

 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 6bff13e..eedd62e3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -9033,8 +9033,11 @@ scsih_pci_mmio_enabled(struct pci_dev *pdev)

 	/* TODO - dump whatever for debugging purposes */

-	/* Request a slot reset. */
-	return PCI_ERS_RESULT_NEED_RESET;
+	/* This called only if scsih_pci_error_detected returns
+	 * PCI_ERS_RESULT_CAN_RECOVER, read/write to the device
+	 * still works, not need to reset slot.
+	 */
+	return PCI_ERS_RESULT_RECOVERED;
 }

 /*
--
1.7.12.4

[toc] | [prev] | [next] | [standalone]


#1444524

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-07-15 21:10 +0200
Message-ID<rVgEP-2iR-41@gated-at.bofh.it>
In reply to#1441187
>>>>> "Kefeng" == Kefeng Wang <wangkefeng.wang@huawei.com> writes:

Kefeng> The _scsih_pci_mmio_enabled called if scsih_pci_error_detected
Kefeng> returns PCI_ERS_RESULT_CAN_RECOVER, at this point, read/write to
Kefeng> the device still works, no need to reset slot.

Applied to 4.8/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web