From patchwork Tue Jul 12 09:43:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 71797 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp378079qga; Tue, 12 Jul 2016 02:45:09 -0700 (PDT) X-Received: by 10.98.55.1 with SMTP id e1mr42330997pfa.107.1468316708947; Tue, 12 Jul 2016 02:45:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si3022542pac.181.2016.07.12.02.45.08; Tue, 12 Jul 2016 02:45:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932335AbcGLJpF (ORCPT + 30 others); Tue, 12 Jul 2016 05:45:05 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:2962 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbcGLJpC (ORCPT ); Tue, 12 Jul 2016 05:45:02 -0400 Received: from 172.24.1.36 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.36]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DKC36768; Tue, 12 Jul 2016 17:44:45 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Tue, 12 Jul 2016 17:44:35 +0800 From: Kefeng Wang To: , , CC: , , , Kefeng Wang , "Sathya Prakash" , Chaitra P B Subject: [PATCH] mpt3sas: Fix panic when aer correct error occured Date: Tue, 12 Jul 2016 17:43:25 +0800 Message-ID: <1468316605-788-1-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.5784BC10.0122, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4efebd809eb52214c81be70078d22500 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Kefeng Wang --- 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(-) -- 1.7.12.4 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; } /*