From patchwork Tue Mar 7 18:28:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDE2AC6FD1A for ; Tue, 7 Mar 2023 18:50:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233301AbjCGSuI (ORCPT ); Tue, 7 Mar 2023 13:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbjCGStt (ORCPT ); Tue, 7 Mar 2023 13:49:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B069AA31; Tue, 7 Mar 2023 10:38:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA1B561535; Tue, 7 Mar 2023 18:28:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3604C4339C; Tue, 7 Mar 2023 18:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213733; bh=XS+PFEsEIiwF3n0OJvyDRAlYdXATlWQBybPUUa+WKYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s+aAKQ8ciAPb9rvkw6XjR6NZIhXrGgsAd/Bs24BFlKdtLuQr3RB8e3V3c+wAKK3Oq 5ffQKPaJUcIhsDJHW6ltC6X9g1ziyQk4R6qs5xn2Pog4UdMS+ffKYuUY3W8Vt9uC2H NrVjtkjyjPVtiSblulTvcNS1I5VwEH3yB2jAED0ifXjLE3R3n5J/Rkg8BuFQwb2aAg /wE4bj5113RXlH2Zqt3tOikBVnKj4T27Npp08zqcaLUPY1UJ+wwMZ/9cdNOnzD0dpP z5yhPQHtdmxDZcXKbTrN9/EKJbADK8ZjrjO20YIuDVswFVFAJWk/WyBtrGmawOG/a0 GlygUW033hB9w== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Adaptec OEM Raid Solutions , Raghava Aditya Renukunta , Tomas Henzl , Johannes Thumshirn Subject: [PATCH 01/10] scsi: aacraid: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:33 -0600 Message-Id: <20230307182842.870378-2-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Also remove pci_disable_pcie_error_reporting() from the .error_detected() path, which was added by 5c63f7f710bd ("aacraid: Added EEH support") but looks unnecessary. Error reporting will be disabled by the device reset and will be re-enabled by the pci_restore_state() in aac_pci_slot_reset(). Signed-off-by: Bjorn Helgaas Cc: Adaptec OEM Raid Solutions Cc: Raghava Aditya Renukunta Cc: Tomas Henzl Cc: Johannes Thumshirn --- drivers/scsi/aacraid/linit.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 5ba5c18b77b4..43160bf4d6a8 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -1783,7 +1782,6 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) aac_scan_host(aac); - pci_enable_pcie_error_reporting(pdev); pci_save_state(pdev); return 0; @@ -1949,7 +1947,6 @@ static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev, scsi_host_complete_all_commands(shost, DID_NO_CONNECT); aac_release_resources(aac); - pci_disable_pcie_error_reporting(pdev); aac_adapter_ioremap(aac, 0); return PCI_ERS_RESULT_NEED_RESET; From patchwork Tue Mar 7 18:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 630DFC678D5 for ; Tue, 7 Mar 2023 18:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjCGSpg (ORCPT ); Tue, 7 Mar 2023 13:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233304AbjCGSpJ (ORCPT ); Tue, 7 Mar 2023 13:45:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 371ACB7892; Tue, 7 Mar 2023 10:34:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33930B819C8; Tue, 7 Mar 2023 18:28:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4B7EC433D2; Tue, 7 Mar 2023 18:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213735; bh=OIhHmt2mnVsj3tF12NCkxNkZk2sHr3gGQeR6T7IdeXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pKAir1xm950sFtlcYl80bwtjz9HkP1qTD3IAxsc2XVk1pbEzDWfub0f2moNJXbndc INf5FRhN+ARZEKaFr9yQw8MV23msDm6/wwu1gdEfzkpHZ/1zY+ETDfrklfKXpNGFiO kydB+qWt0GMjfu7JNuIb+TBNnm26+i3idJCIUir8CqQ+wc6ONRFyUFm+oxyItXSj+4 m06It2oCrrxW4owGhcWvGW5ctvOzgZKDlPOMWoHOdaKiKe2hUJKvjLwGLZv2WrV9Yt 0qKPHVyVH1RaefFkLQqtCcQxqtL2/HWMadJzJuHggFK6AuBohnnsGyNOMNxKj1ea8a 8EcmjP/nzoBvg== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 02/10] scsi: arcmsr: Remove unnecessary aer.h include Date: Tue, 7 Mar 2023 12:28:34 -0600 Message-Id: <20230307182842.870378-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas is unused, so remove it. Signed-off-by: Bjorn Helgaas --- drivers/scsi/arcmsr/arcmsr_hba.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index d3fb8a9c1c39..9d04cb6e62fa 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Mar 7 18:28:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF78BC678D4 for ; Tue, 7 Mar 2023 18:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233512AbjCGS4b (ORCPT ); Tue, 7 Mar 2023 13:56:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233513AbjCGS4O (ORCPT ); Tue, 7 Mar 2023 13:56:14 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88EA69749E; Tue, 7 Mar 2023 10:43:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id A6799CE1C79; Tue, 7 Mar 2023 18:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0F30C433D2; Tue, 7 Mar 2023 18:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213736; bh=3JdjywG6DsWfWzdvnLIaNQak/6ZVrelHGxK1Jb+bRtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvRTfYfCSLh/IziCDBzjHgXEvc0lyIja1XSjGQKUO6wnvdwH8JANNu7u651awRvem hX5/li75IpG+veKKl+988VGOcqNgjqGj2szYqfWShD4a60S0cOc5bMXjQXXB2AmBGA l83ZS7yFYNEUhHdcG3ElFzNtSZ6Brkz2aypJJlzaEliKmpXpNL3468i81xyqPf/YzM Frtn4G9z1RuT4gS95ggjuZd7qysoazZFtCzU0onGYJDUASzG0LV9OjaJ0e6wp7Bwgb +C/VVR/nFuAKNdQt1u/4ycjYeu2cL2OZTqGBKuAHNqluODtPXf6hVfQXMdjXt6+oMv 7CUHbBrFoQL7Q== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Ketan Mukadam Subject: [PATCH 03/10] scsi: be2iscsi: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:35 -0600 Message-Id: <20230307182842.870378-4-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: Ketan Mukadam --- drivers/scsi/be2iscsi/be_main.c | 9 --------- drivers/scsi/be2iscsi/be_main.h | 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 50a577ac3bb4..0aaf6fc47683 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -5545,13 +5545,6 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, goto disable_pci; } - /* Enable EEH reporting */ - ret = pci_enable_pcie_error_reporting(pcidev); - if (ret) - beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT, - "BM_%d : PCIe Error Reporting " - "Enabling Failed\n"); - pci_save_state(pcidev); /* Initialize Driver configuration Paramters */ @@ -5736,7 +5729,6 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, pci_disable_msix(phba->pcidev); pci_dev_put(phba->pcidev); iscsi_host_free(phba->shost); - pci_disable_pcie_error_reporting(pcidev); pci_set_drvdata(pcidev, NULL); disable_pci: pci_release_regions(pcidev); @@ -5779,7 +5771,6 @@ static void beiscsi_remove(struct pci_dev *pcidev) pci_dev_put(phba->pcidev); iscsi_host_free(phba->shost); - pci_disable_pcie_error_reporting(pcidev); pci_set_drvdata(pcidev, NULL); pci_release_regions(pcidev); pci_disable_device(pcidev); diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 98977c0700f1..71c95d144560 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Mar 7 18:28:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D767C678D4 for ; Tue, 7 Mar 2023 18:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233145AbjCGSmr (ORCPT ); Tue, 7 Mar 2023 13:42:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbjCGSlu (ORCPT ); Tue, 7 Mar 2023 13:41:50 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC4EC9E30E; Tue, 7 Mar 2023 10:32:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 726B1CE1C85; Tue, 7 Mar 2023 18:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C80C433AE; Tue, 7 Mar 2023 18:28:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213738; bh=sxhOUKyK/NsC1MzrNzYBeE7kuwoED0rqhP9R9JiXQ3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t8HGFNMk4sJ7JvkVF9YJaqueJncGoydFlLJnNwSGxSxKXyYHv0fBeoPg3MUFQDLBa tPTfvdqfiyqOpnhWUEO2+AkaAbb5Chn8COeK6LZJrB++fwGRv+uI2HsOEQ9zquY19J KR1BYAzcUGIGArw5s6U7u6UIhUMnOwrq865wfsvERv1wiHGDaIDW5W77rPLxmlU1Nn +KlC8gboOR8gPABhqyHOsH/zh5K/duy25zCpG+cwCZCfU4DSZx68sYszBiZtf0VbpB RWVr5X2Y6IK7Y03amLzW6gewbFAq78Fe9ZhraC2i9gNkKAkg3wy4w4VnWE7UnDD+1g eAkS3AEfSP80A== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Anil Gurumurthy , Sudarsana Kalluru Subject: [PATCH 04/10] scsi: bfa: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:36 -0600 Message-Id: <20230307182842.870378-5-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: Anil Gurumurthy Cc: Sudarsana Kalluru --- drivers/scsi/bfa/bfad.c | 6 ------ drivers/scsi/bfa/bfad_drv.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index e5aa982ffedc..529b73a83d69 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -738,9 +738,6 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad) goto out_release_region; } - /* Enable PCIE Advanced Error Recovery (AER) if kernel supports */ - pci_enable_pcie_error_reporting(pdev); - bfad->pci_bar0_kva = pci_iomap(pdev, 0, pci_resource_len(pdev, 0)); bfad->pci_bar2_kva = pci_iomap(pdev, 2, pci_resource_len(pdev, 2)); @@ -801,8 +798,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad) pci_iounmap(pdev, bfad->pci_bar0_kva); pci_iounmap(pdev, bfad->pci_bar2_kva); pci_release_regions(pdev); - /* Disable PCIE Advanced Error Recovery (AER) */ - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); } @@ -1562,7 +1557,6 @@ bfad_pci_slot_reset(struct pci_dev *pdev) if (restart_bfa(bfad) == -1) goto out_disable_device; - pci_enable_pcie_error_reporting(pdev); dev_printk(KERN_WARNING, &pdev->dev, "slot_reset completed flags: 0x%x!\n", bfad->bfad_flags); diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h index eaee7c8bc2d2..7682cfa34265 100644 --- a/drivers/scsi/bfa/bfad_drv.h +++ b/drivers/scsi/bfa/bfad_drv.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Mar 7 18:28:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EA2BC678D4 for ; Tue, 7 Mar 2023 18:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbjCGSnu (ORCPT ); Tue, 7 Mar 2023 13:43:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbjCGSnL (ORCPT ); Tue, 7 Mar 2023 13:43:11 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3363B9EF41; Tue, 7 Mar 2023 10:33:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 0AD26CE1C86; Tue, 7 Mar 2023 18:29:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67791C4339C; Tue, 7 Mar 2023 18:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213740; bh=86KQLMriTm2rEbApaorsRI4bA6ciwDz7r8N+iPI0q2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qID2ndgLHMBKTJVy/U/jXfv4TjPd/cIaAVgijlVrj1laJ87yNDO0eGQ0/hwasTYoc del+NqvbHWY5MvRVSX3m2CDfe4iADyLHbMAVnb81wcPsPgOenD5YCHFzlcbrZC8/yl nQukjG0jQiNEVh9ukSkKd21aUzfTHQv/uXomatL/8zFcLFvR+LFnb3Tx7+6UevX4nQ mJ8LxPPLBNmkg17nE//GYNYKXPaTAmi/kz7zGyZokTfrxW2IZCnaiQ+woUy0uH05g1 mWnscDXkBf2OAFhlvDcGzRtnewFThEQ6cdf+05Z7UvjwwHf/Cl3KyLD1W7kWt51Fi/ QrBG0sqxwN5gQ== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 05/10] scsi: csiostor: Remove unnecessary aer.h include Date: Tue, 7 Mar 2023 12:28:37 -0600 Message-Id: <20230307182842.870378-6-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas is unused, so remove it. Signed-off-by: Bjorn Helgaas --- drivers/scsi/csiostor/csio_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c index ccbded3353bd..0c32faefad7c 100644 --- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Mar 7 18:28:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 720FDC6FD1A for ; Tue, 7 Mar 2023 18:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233346AbjCGSuq (ORCPT ); Tue, 7 Mar 2023 13:50:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbjCGSu2 (ORCPT ); Tue, 7 Mar 2023 13:50:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E005B049D; Tue, 7 Mar 2023 10:38:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 97208B819CB; Tue, 7 Mar 2023 18:29:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 351E8C433A1; Tue, 7 Mar 2023 18:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213742; bh=+PdG7LuHo65TVW4uUUZYYgxV38NtxliWQLubFtzevCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SY7quN1LIgI9KYymuTOsWKvhQ5k0evvTaneTECnRFOvHxsEA9nDLe1yAlauzuEaeA wBJGLPGQ6jDCt2CFx+ELZyKZSjdC9s5tG/zRpS1jKQMONKJHjILx6cHD1fNc0DGCus dscMFNuOpEB57RsRHo4LyLf5ic1cTvp00XWxO7yady8VcOPU7UCWXyeaDT8wKw2Zyq QSfgdJCv5DNax4W3/7I06Aa5KCkov98uVmF8wh2ugIYWoPGmr9myfHHcbuWSQRD/K9 R9/V9++fAGNuVSVdwE+epUGjC9RTz3Hzjj+NSaOGVGBfDHBnpAOYeu9mKfaaqbw22M dOpMu/MIdj87g== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Don Brace , storagedev@microchip.com Subject: [PATCH 06/10] scsi: hpsa: Remove unnecessary pci_disable_pcie_error_reporting() comment Date: Tue, 7 Mar 2023 12:28:38 -0600 Message-Id: <20230307182842.870378-7-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas 105a3dbc7452 ("hpsa: clean up driver init") added a comment about pci_disable_pcie_error_reporting(), but hpsa has never called either pci_enable_pcie_error_reporting() or pci_disable_pcie_error_reporting(). Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core is responsible for managing PCIe device error reporting. Remove the comment about pci_disable_pcie_error_reporting(). Signed-off-by: Bjorn Helgaas Cc: Don Brace Cc: storagedev@microchip.com --- drivers/scsi/hpsa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f6da34850af9..fec7e17747f7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -9108,7 +9108,6 @@ static void hpsa_remove_one(struct pci_dev *pdev) free_percpu(h->lockup_detected); /* init_one 2 */ h->lockup_detected = NULL; /* init_one 2 */ - /* (void) pci_disable_pcie_error_reporting(pdev); */ /* init_one 1 */ hpda_free_ctlr_info(h); /* init_one 1 */ } From patchwork Tue Mar 7 18:28:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82714C678D5 for ; Tue, 7 Mar 2023 18:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbjCGSja (ORCPT ); Tue, 7 Mar 2023 13:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232879AbjCGSi5 (ORCPT ); Tue, 7 Mar 2023 13:38:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 525278F72C; Tue, 7 Mar 2023 10:30:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BCE9C61539; Tue, 7 Mar 2023 18:29:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F25DDC433A1; Tue, 7 Mar 2023 18:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213744; bh=2W4mTqL66cnI3Q1Av2sbikshcnOcST9Zd6947tR9OmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b7Xw7jP+vrqoeZ3kp358N9bDL9hbc/5tMOAw0BN3Zh0SUfsuCIqjHBi9/nxJU32nK iz5liu5dZjx8FWdacyOWiLHowKtRI6W0svfKdqsYH4AfK7dGYJ/7MxXpYpu6El+Ahm JY7YBdT2AF/j6qcTiT8M2C59cMVZ3qEWuWFXe6lJY4POfXM9m0ycgM54aMrViaPkSQ liMfQPba+kTKD7WGXlkgJnXGnFSE38j6w5E08hl+iLoLfn642zZ4rSD24CA+O0K/f2 B+q8FBSmL7hO0tkUnp0ZR5lArcVYyMirPlX6YtcvonXA2gMzsqCfASw3WUVXE4+qRN UPJm8W09shCfg== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , James Smart , Dick Kennedy Subject: [PATCH 07/10] scsi: lpfc: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:39 -0600 Message-Id: <20230307182842.870378-8-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: James Smart Cc: Dick Kennedy --- drivers/scsi/lpfc/lpfc.h | 2 - drivers/scsi/lpfc/lpfc_attr.c | 96 ++++++++++------------------------- drivers/scsi/lpfc/lpfc_init.c | 1 - drivers/scsi/lpfc/lpfc_sli.c | 55 -------------------- 4 files changed, 27 insertions(+), 127 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index cf55f8e3bd9f..5e3a93d13a91 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1036,7 +1036,6 @@ struct lpfc_hba { #define FCF_TS_INPROG 0x200 /* FCF table scan in progress */ #define FCF_RR_INPROG 0x400 /* FCF roundrobin flogi in progress */ #define HBA_FIP_SUPPORT 0x800 /* FIP support in HBA */ -#define HBA_AER_ENABLED 0x1000 /* AER enabled with HBA */ #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ #define HBA_IOQ_FLUSH 0x8000 /* FCP/NVME I/O queues being flushed */ @@ -1190,7 +1189,6 @@ struct lpfc_hba { #define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP #define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP #endif - uint32_t cfg_aer_support; uint32_t cfg_sriov_nr_virtfn; uint32_t cfg_request_firmware_upgrade; uint32_t cfg_suppress_link_up; diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 22f2e046e8eb..5cc7b59b528f 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -4365,13 +4365,22 @@ static DEVICE_ATTR_RW(lpfc_link_speed); /* # lpfc_aer_support: Support PCIe device Advanced Error Reporting (AER) -# 0 = aer disabled or not supported # 1 = aer supported and enabled (default) -# Value range is [0,1]. Default value is 1. +# PCIe error reporting is always enabled by the PCI core, so this always +# shows 1. +# +# N.B. Parts of LPFC_ATTR open-coded since some of the underlying +# infrastructure (phba->cfg_aer_support) is gone. */ -LPFC_ATTR(aer_support, 1, 0, 1, - "Enable PCIe device AER support"); -lpfc_param_show(aer_support) +static uint lpfc_aer_support = 1; +module_param(lpfc_aer_support, uint, S_IRUGO); +MODULE_PARM_DESC(lpfc_aer_support, "Enable PCIe device AER support"); +static ssize_t +lpfc_aer_support_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + return scnprintf(buf, PAGE_SIZE, "%d\n", lpfc_aer_support); +} /** * lpfc_aer_support_store - Set the adapter for aer support @@ -4382,76 +4391,27 @@ lpfc_param_show(aer_support) * @count: unused variable. * * Description: - * If the val is 1 and currently the device's AER capability was not - * enabled, invoke the kernel's enable AER helper routine, trying to - * enable the device's AER capability. If the helper routine enabling - * AER returns success, update the device's cfg_aer_support flag to - * indicate AER is supported by the device; otherwise, if the device - * AER capability is already enabled to support AER, then do nothing. - * - * If the val is 0 and currently the device's AER support was enabled, - * invoke the kernel's disable AER helper routine. After that, update - * the device's cfg_aer_support flag to indicate AER is not supported - * by the device; otherwise, if the device AER capability is already - * disabled from supporting AER, then do nothing. + * PCIe error reporting is enabled by the PCI core, so drivers don't need + * to do anything. Retain this interface for backwards compatibility, + * but do nothing. * * Returns: - * length of the buf on success if val is in range the intended mode - * is supported. - * -EINVAL if val out of range or intended mode is not supported. + * length of the buf on success + * -EINVAL if val out of range **/ static ssize_t lpfc_aer_support_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct Scsi_Host *shost = class_to_shost(dev); - struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; - struct lpfc_hba *phba = vport->phba; - int val = 0, rc = -EINVAL; + int val = 0; if (!isdigit(buf[0])) return -EINVAL; if (sscanf(buf, "%i", &val) != 1) return -EINVAL; - switch (val) { - case 0: - if (phba->hba_flag & HBA_AER_ENABLED) { - rc = pci_disable_pcie_error_reporting(phba->pcidev); - if (!rc) { - spin_lock_irq(&phba->hbalock); - phba->hba_flag &= ~HBA_AER_ENABLED; - spin_unlock_irq(&phba->hbalock); - phba->cfg_aer_support = 0; - rc = strlen(buf); - } else - rc = -EPERM; - } else { - phba->cfg_aer_support = 0; - rc = strlen(buf); - } - break; - case 1: - if (!(phba->hba_flag & HBA_AER_ENABLED)) { - rc = pci_enable_pcie_error_reporting(phba->pcidev); - if (!rc) { - spin_lock_irq(&phba->hbalock); - phba->hba_flag |= HBA_AER_ENABLED; - spin_unlock_irq(&phba->hbalock); - phba->cfg_aer_support = 1; - rc = strlen(buf); - } else - rc = -EPERM; - } else { - phba->cfg_aer_support = 1; - rc = strlen(buf); - } - break; - default: - rc = -EINVAL; - break; - } - return rc; + dev_info_once(dev, "PCIe error reporting automatically enabled by the PCI core; sysfs write ignored\n"); + return strlen(buf); } static DEVICE_ATTR_RW(lpfc_aer_support); @@ -4464,16 +4424,16 @@ static DEVICE_ATTR_RW(lpfc_aer_support); * @count: unused variable. * * Description: - * If the @buf contains 1 and the device currently has the AER support - * enabled, then invokes the kernel AER helper routine + * If the @buf contains 1, invokes the kernel AER helper routine * pci_aer_clear_nonfatal_status() to clean up the uncorrectable * error status register. * * Notes: * * Returns: - * -EINVAL if the buf does not contain the 1 or the device is not currently - * enabled with the AER support. + * -EINVAL if the buf does not contain 1 + * -EPERM if the OS cannot clear AER error status, i.e., when platform + * firmware owns the AER Capability **/ static ssize_t lpfc_aer_cleanup_state(struct device *dev, struct device_attribute *attr, @@ -4491,8 +4451,7 @@ lpfc_aer_cleanup_state(struct device *dev, struct device_attribute *attr, if (val != 1) return -EINVAL; - if (phba->hba_flag & HBA_AER_ENABLED) - rc = pci_aer_clear_nonfatal_status(phba->pcidev); + rc = pci_aer_clear_nonfatal_status(phba->pcidev); if (rc == 0) return strlen(buf); @@ -7277,7 +7236,6 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) lpfc_sg_seg_cnt_init(phba, lpfc_sg_seg_cnt); lpfc_hba_queue_depth_init(phba, lpfc_hba_queue_depth); - lpfc_aer_support_init(phba, lpfc_aer_support); lpfc_sriov_nr_virtfn_init(phba, lpfc_sriov_nr_virtfn); lpfc_request_firmware_upgrade_init(phba, lpfc_req_fw_upgrade); lpfc_suppress_link_up_init(phba, lpfc_suppress_link_up); diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 61958a24a43d..d3d4477dd472 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c5b69f313af3..b2294e638e29 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #ifdef CONFIG_X86 #include @@ -5204,13 +5203,9 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) volatile struct MAILBOX_word0 mb; struct lpfc_sli *psli; void __iomem *to_slim; - uint32_t hba_aer_enabled; spin_lock_irq(&phba->hbalock); - /* Take PCIe device Advanced Error Reporting (AER) state */ - hba_aer_enabled = phba->hba_flag & HBA_AER_ENABLED; - psli = &phba->sli; /* Restart HBA */ @@ -5251,10 +5246,6 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) /* Give the INITFF and Post time to settle. */ mdelay(100); - /* Reset HBA AER if it was enabled, note hba_flag was reset above */ - if (hba_aer_enabled) - pci_disable_pcie_error_reporting(phba->pcidev); - lpfc_hba_down_post(phba); return 0; @@ -5273,7 +5264,6 @@ static int lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) { struct lpfc_sli *psli = &phba->sli; - uint32_t hba_aer_enabled; int rc; /* Restart HBA */ @@ -5281,9 +5271,6 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) "0296 Restart HBA Data: x%x x%x\n", phba->pport->port_state, psli->sli_flag); - /* Take PCIe device Advanced Error Reporting (AER) state */ - hba_aer_enabled = phba->hba_flag & HBA_AER_ENABLED; - rc = lpfc_sli4_brdreset(phba); if (rc) { phba->link_state = LPFC_HBA_ERROR; @@ -5301,10 +5288,6 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets)); psli->stats_start = ktime_get_seconds(); - /* Reset HBA AER if it was enabled, note hba_flag was reset above */ - if (hba_aer_enabled) - pci_disable_pcie_error_reporting(phba->pcidev); - hba_down_queue: lpfc_hba_down_post(phba); lpfc_sli4_queue_destroy(phba); @@ -5725,25 +5708,6 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) } phba->fcp_embed_io = 0; /* SLI4 FC support only */ - /* Enable PCIe device Advanced Error Reporting (AER) if configured */ - if (phba->cfg_aer_support == 1 && !(phba->hba_flag & HBA_AER_ENABLED)) { - rc = pci_enable_pcie_error_reporting(phba->pcidev); - if (!rc) { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2709 This device supports " - "Advanced Error Reporting (AER)\n"); - spin_lock_irq(&phba->hbalock); - phba->hba_flag |= HBA_AER_ENABLED; - spin_unlock_irq(&phba->hbalock); - } else { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2708 This device does not support " - "Advanced Error Reporting (AER): %d\n", - rc); - phba->cfg_aer_support = 0; - } - } - if (phba->sli_rev == 3) { phba->iocb_cmd_size = SLI3_IOCB_CMD_SIZE; phba->iocb_rsp_size = SLI3_IOCB_RSP_SIZE; @@ -9053,25 +9017,6 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) mod_timer(&phba->eratt_poll, jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval)); - /* Enable PCIe device Advanced Error Reporting (AER) if configured */ - if (phba->cfg_aer_support == 1 && !(phba->hba_flag & HBA_AER_ENABLED)) { - rc = pci_enable_pcie_error_reporting(phba->pcidev); - if (!rc) { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2829 This device supports " - "Advanced Error Reporting (AER)\n"); - spin_lock_irq(&phba->hbalock); - phba->hba_flag |= HBA_AER_ENABLED; - spin_unlock_irq(&phba->hbalock); - } else { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2830 This device does not support " - "Advanced Error Reporting (AER)\n"); - phba->cfg_aer_support = 0; - } - rc = 0; - } - /* * The port is ready, set the host's link state to LINK_DOWN * in preparation for link interrupts. From patchwork Tue Mar 7 18:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D13BC678DB for ; Tue, 7 Mar 2023 18:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbjCGSzH (ORCPT ); Tue, 7 Mar 2023 13:55:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233478AbjCGSyd (ORCPT ); Tue, 7 Mar 2023 13:54:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D01A5F6; Tue, 7 Mar 2023 10:42:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9371561538; Tue, 7 Mar 2023 18:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC636C4339E; Tue, 7 Mar 2023 18:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213746; bh=3BwaxeqR5K9UM6t70G9A7Zg8LXyh/lE1LnqW0l4i6Jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBDFXwGmb4NbFsnOLQNVjKfCxYBZQe6gNNlsx3x0rX+hVweeeTXZ9n6hO3ziosB6x WU0LRWK1gsud8ozmdXQVhaBQkzv5y6PwpV6rYIqxIU67i7XF2MAtI1v8CxbYHhOmh5 C2umXRpwPBPBw1hSxq2Q/Z/SB64Hkq4HpHnVsEmHpPPxn0pBRlCEI9GQ+qke617Epq Y+IpQ4mEHCEcdVsUjeLIGyYTAmmQalsQyGpejG5L22UcUdGDUJokGMhTC/s48i8ckt nRccsUU1YJ8NJn+8Y51wKPN23u+xDU4mdtFb6FEUoepcrTHyx0BWAkKd+Bk5wbROKT 3p+pYSz9Q3OLA== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , MPT-FusionLinux.pdl@broadcom.com Subject: [PATCH 08/10] scsi: mpt3sas: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:40 -0600 Message-Id: <20230307182842.870378-9-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Subramani Cc: MPT-FusionLinux.pdl@broadcom.com --- drivers/scsi/mpt3sas/mpt3sas_base.c | 5 ----- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 2ee9ea57554d..a8b260f46796 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -60,7 +60,6 @@ #include #include #include /* To get host page size per arch */ -#include #include "mpt3sas_base.h" @@ -3535,7 +3534,6 @@ mpt3sas_base_unmap_resources(struct MPT3SAS_ADAPTER *ioc) if (pci_is_enabled(pdev)) { pci_release_selected_regions(ioc->pdev, ioc->bars); - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); } } @@ -3615,9 +3613,6 @@ mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc) goto out_fail; } -/* AER (Advanced Error Reporting) hooks */ - pci_enable_pcie_error_reporting(pdev); - pci_set_master(pdev); diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 8e24ebcebfe5..e2f09833659f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Mar 7 18:28:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0184EC678DB for ; Tue, 7 Mar 2023 18:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbjCGSjI (ORCPT ); Tue, 7 Mar 2023 13:39:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbjCGSin (ORCPT ); Tue, 7 Mar 2023 13:38:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9732B301A6; Tue, 7 Mar 2023 10:30:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6B37E6150E; Tue, 7 Mar 2023 18:29:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A696CC433EF; Tue, 7 Mar 2023 18:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213747; bh=zEI877upDLwimMSOZL/AiD7txmrPJ/Mr1O8OUkLbrS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOCIwPdVFuAn51LZbQFX+j+ni6gswOsPKQjmceJyKeogZo1kAP+xjM3o9TQCmbiUS 9fFhxJcelhr0gwqsMl7LAE/DGgxXRa1HS7mD/SKQ6blu8BwNQat6hwux/YxwMMflDv xFl4EQ0TD7ODRGIHo0W7UfCIXyIKhzIaWe2O51m06Jst5ZdKe45dgsgSn7nSVdFRY7 7gJCytW5wXD3mODPuZFjA/7IZdCZq4BMwoYcexhvVdjceBODy7OaOiNdgcQTix8wGJ 4SD0IqF74jAApjkM8fNK9FOm7f2ESh9IA/jtfg6TiFontpnELTK9KKJR4ZQbEvLJul B5uErx3JPanqQ== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com Subject: [PATCH 09/10] scsi: qla2xxx: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:41 -0600 Message-Id: <20230307182842.870378-10-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: Nilesh Javali Cc: GR-QLogic-Storage-Upstream@marvell.com --- drivers/scsi/qla2xxx/qla_def.h | 1 - drivers/scsi/qla2xxx/qla_os.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index ec0e987b71fa..df5e5b7fdcfe 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 545167627e48..a6c5e0d8641d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2940,9 +2940,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ql2xallocfwdump = 0; } - /* This may fail but that's ok */ - pci_enable_pcie_error_reporting(pdev); - ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); if (!ha) { ql_log_pci(ql_log_fatal, pdev, 0x0009, @@ -3949,8 +3946,6 @@ qla2x00_remove_one(struct pci_dev *pdev) pci_release_selected_regions(ha->pdev, ha->bars); kfree(ha); - pci_disable_pcie_error_reporting(pdev); - pci_disable_device(pdev); } @@ -6825,7 +6820,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work) qla2x00_unmap_iobases(ha); pci_release_selected_regions(ha->pdev, ha->bars); - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); /* From patchwork Tue Mar 7 18:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 660378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01A4C678D4 for ; Tue, 7 Mar 2023 18:38:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233029AbjCGSiz (ORCPT ); Tue, 7 Mar 2023 13:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232821AbjCGSig (ORCPT ); Tue, 7 Mar 2023 13:38:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 355EDA226B; Tue, 7 Mar 2023 10:30:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4138B819C2; Tue, 7 Mar 2023 18:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AE31C4339C; Tue, 7 Mar 2023 18:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678213749; bh=5BE9wZCtaDseXu0/Lv+W7WCLDoimdI41Hg2fMs8HhDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A+QWpy5vzZ9/X3juu/fwf9cVoeaZqgxgUo3SAVMRWvYy2BXQA8ukuCt/CITD93mzl rGRACDKas4jH63jQpx2P3iqRMboehcUDh3Dp1QeWzku9yTa1e4b76VexBRJbSdAbpY z4cNtBYASorZ35SwDq3RcXProMs8qZ7s+7IaspemytoPzgI7nns8XNTadaAqLKIfpI vPYYUsTOL+GU5aafA3VhoMLb2HZu5lFUYUIjJtyF3Wy3WlBkLrCgjHnhvRQIEMicyy A1SFf2YukrqvJKeyoGfCOY35fhyAZtTe28Ww2t0Mf44DTtQXOy5J769iniV3zK8CPP qc0J5lpcBPI5g== From: Bjorn Helgaas To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com Subject: [PATCH 10/10] scsi: qla4xxx: Drop redundant pci_enable_pcie_error_reporting() Date: Tue, 7 Mar 2023 12:28:42 -0600 Message-Id: <20230307182842.870378-11-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230307182842.870378-1-helgaas@kernel.org> References: <20230307182842.870378-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Bjorn Helgaas pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas Cc: Nilesh Javali Cc: Manish Rangankar Cc: GR-QLogic-Storage-Upstream@marvell.com --- drivers/scsi/qla4xxx/ql4_def.h | 1 - drivers/scsi/qla4xxx/ql4_os.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index 5f82c8afd5e0..5e683ba49fa5 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 005502125b27..ee6d784c095c 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -8639,8 +8639,6 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, ha->host_no = host->host_no; ha->func_num = PCI_FUNC(ha->pdev->devfn); - pci_enable_pcie_error_reporting(pdev); - /* Setup Runtime configurable options */ if (is_qla8022(ha)) { ha->isp_ops = &qla4_82xx_isp_ops; @@ -8867,7 +8865,6 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, qla4xxx_free_adapter(ha); probe_failed_ioconfig: - pci_disable_pcie_error_reporting(pdev); scsi_host_put(ha->host); probe_disable_device: @@ -9022,7 +9019,6 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev) scsi_host_put(ha->host); - pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); }