From patchwork Thu Jul 14 10:49:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitra P B X-Patchwork-Id: 9229555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A0CA60574 for ; Thu, 14 Jul 2016 10:49:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AFD025227 for ; Thu, 14 Jul 2016 10:49:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E94B2621B; Thu, 14 Jul 2016 10:49:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEC7725227 for ; Thu, 14 Jul 2016 10:49:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751115AbcGNKtG (ORCPT ); Thu, 14 Jul 2016 06:49:06 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:33863 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbcGNKtF (ORCPT ); Thu, 14 Jul 2016 06:49:05 -0400 Received: by mail-qk0-f175.google.com with SMTP id o67so69015053qke.1 for ; Thu, 14 Jul 2016 03:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=t7NOHkgQUz5n1ZvvaQ9mUOlQi27oMSp0W3tbmLLtxgA=; b=cLPN2XAtuCi9rluFDUau8ahZg+4jVHqGtS7ZGba8GH9TjgjDg2mnyXCik8IcP9brly +wGFxaD8sXEbCuTeGfnhO3CR35EmwpebkSXjTxWta+Oi4buqgcv33qTAsAiXJYO4ysgy svg3V6JjlwiYTmodORyJpkFxuXRMXJJ/3hEWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=t7NOHkgQUz5n1ZvvaQ9mUOlQi27oMSp0W3tbmLLtxgA=; b=PrVsbgO8w4+yjABdJ5+te3S4aY3tQvxnRijsJkg/fmPZ9XjIiG9PBep7HtXFWMp0e7 +12WlG86EKWbYKaaz+zIgsVWtVyWPVmBG9UdsSbK12ZU/gDTVddgnhVQaD90bV9W44iq Zxn+9Ow9v9nu/eXyCDhL19uq0URr7OREmSm4Ukr5LKT0CrHsEXDbURgHNsMj1nSjuxs4 ZGiGKJo2LK2KC3d8T+DE0yaHwWmqc3qfUAaTNjV8mV/KRdV6oxpuG3wsuZ65k74dLyIa HX3IoptAqIN+Nw6wPcuY/QZg6yL8c3/ZASTXv58a/V0Kt7UWTbb8455mmmssqHm7yJIZ ZdSg== X-Gm-Message-State: ALyK8tJm6lyQ8rmpwMNhost5ezZdxl3gORTQHBLFxqIlB0b9urtyMaczdq0YbVzfezhtpXpNNBSrGupcXC5MDQWt X-Received: by 10.55.221.157 with SMTP id u29mr16214427qku.200.1468493343381; Thu, 14 Jul 2016 03:49:03 -0700 (PDT) From: Chaitra Basappa References: <1468316605-788-1-git-send-email-wangkefeng.wang@huawei.com> In-Reply-To: <1468316605-788-1-git-send-email-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKucVcQ5/ySNIf0zxzPE0avGSkSSJ5ej4Sw Date: Thu, 14 Jul 2016 16:19:02 +0530 Message-ID: <5ff4138de974ecb0307f283402235e5d@mail.gmail.com> Subject: RE: [PATCH] mpt3sas: Fix panic when aer correct error occured To: Kefeng Wang , martin.petersen@oracle.com, Suganath Prabu Subramani , PDL-MPT-FUSIONLINUX Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, guohanjun@huawei.com, Sathya Prakash Veerichetty Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Please consider this patch as Acked-by: Chaitra P B 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; } /*