Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp98188rwb; Thu, 22 Sep 2022 15:05:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5XQMasa7cERREzFlFkPQ/9POksXlrXEdrZi1+m3vOFam5JT5daNvxRVrNYpes37q1h5AdQ X-Received: by 2002:a17:907:8a17:b0:782:6e72:7aba with SMTP id sc23-20020a1709078a1700b007826e727abamr3011858ejc.474.1663884317869; Thu, 22 Sep 2022 15:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663884317; cv=none; d=google.com; s=arc-20160816; b=rCXXeI5Oshw5voSsssYE+mxqi5jASIpXMRGY0y8ogAL3tYOI/K0sY/xfNw10LrdnM+ hqx9lLtNZKs8AKTp8duGm+OiO00ubiZ8R4V0xbWv6BUqks8+L0pKuoE6lql4oG1MoYo3 s7b7Seq84t4SuiwQKbb5iY5xiSrfUN4cFAffVQ1Uk62TsvJA1sykCY944ZLsm4GUtnaw Xg2TJuZMIyYaVDFoPrupF83t5i+87Ffix4HCvLc0xJ8T+LBiqgqUvXw1nizC0Xr/h4zq N0rseQ0TOJTONx5EBPv2+lE4JZfaFoegmGTKZ2nBlreSnuEzEUubw7FO0qEIuvm4F0kf D2Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=H876eVvikaCxO/hTR2uLIGJUaS6NQIw44N6TLkTr/Bs=; b=nCus3SdF5uWVx2cd5JePCvhNSwE1yMEjgV4j9CrlaoKTfYtgzNqdFF/bPlimLGLQKA pe5M1Z5I6VwhNeDO7mzBxtFSo0IfrYROreSQNo76lwJcur1vSLditIIOX7j2ZXvNEzwM rCyhQlEs0sK8gXx1sosCgkySR5cAMkZija3Y4qYmF4w2FMgYV/4Z/BQEyeFMW8JFgTWU kF3pPQhdTOhYO7YbSkAnP2Z5RGGMHN0KyT03cgxkBKzcDPBkWzuuKgQ+Q7m27KyiNQjJ PDtmc4mwAXhkoovPuJ5l27Z8ul8DDao2TPPfVEPLg4yHPUr8hmcTDiCJmcmLdJG8TLng XbPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYgCEWLP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb25-20020a1709077e9900b007820e1a4302si5690050ejc.675.2022.09.22.15.04.51; Thu, 22 Sep 2022 15:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYgCEWLP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbiIVVuk (ORCPT + 99 others); Thu, 22 Sep 2022 17:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231642AbiIVVue (ORCPT ); Thu, 22 Sep 2022 17:50:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2043D9C20C; Thu, 22 Sep 2022 14:50:33 -0700 (PDT) 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 B0FD1624B4; Thu, 22 Sep 2022 21:50:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA640C433D7; Thu, 22 Sep 2022 21:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663883432; bh=MgTN7LkGK6RTKAK8xVN3320exVPlVXdsT6FCYwP83tA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XYgCEWLPerROkbSvzzraCysPpwUrHSr4ezRMEPzD/ldnsRprA24KspE1uqZz2Lud3 +R/nXgSNU53Ci9h+ObaShk9tsEctWfNDGis5b1UWi93JIQlrKTPW6V0Izp4Dlf3kES BfJdiFGPoX5QiO/uIZh9h5L6fr3x5OC48pG6l94oppUo3FzD9qJO4pyfZQZ3kw75Tx 0+9bJybb6Hkuf7t/doyH+9AjA+eGxEvcJUqlKgO/jAjSec2SFBQhU+8Sn9eoSb7Ekx X0yg8nxr8vmau0UWfJECH2zzeVv/V0E1M5Hrv8aW10ZF74JV/wXq5hl/DvDqgp7FSG UAybAAMfGEg6w== Date: Thu, 22 Sep 2022 16:50:30 -0500 From: Bjorn Helgaas To: Zhuo Chen Cc: fancer.lancer@gmail.com, jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com, bhelgaas@google.com, ruscur@russell.cc, oohall@gmail.com, james.smart@broadcom.com, dick.kennedy@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ntb@lists.linux.dev, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 3/3] PCI/AER: Use pci_aer_raw_clear_status() to clear root port's AER error status Message-ID: <20220922215030.GA1341314@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901181634.99591-4-chenzhuo.1@bytedance.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2022 at 02:16:34AM +0800, Zhuo Chen wrote: > Statements clearing AER error status in aer_enable_rootport() has the > same function as pci_aer_raw_clear_status(). So we replace them, which > has no functional changes. > > Signed-off-by: Zhuo Chen > --- > drivers/pci/pcie/aer.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index d2996afa80f6..eb0193f279f2 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -1287,12 +1287,7 @@ static void aer_enable_rootport(struct aer_rpc *rpc) > SYSTEM_ERROR_INTR_ON_MESG_MASK); > > /* Clear error status */ > - pci_read_config_dword(pdev, aer + PCI_ERR_ROOT_STATUS, ®32); > - pci_write_config_dword(pdev, aer + PCI_ERR_ROOT_STATUS, reg32); > - pci_read_config_dword(pdev, aer + PCI_ERR_COR_STATUS, ®32); > - pci_write_config_dword(pdev, aer + PCI_ERR_COR_STATUS, reg32); > - pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, ®32); > - pci_write_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, reg32); > + pci_aer_raw_clear_status(pdev); It's true that this is functionally equivalent. But 20e15e673b05 ("PCI/AER: Add pci_aer_raw_clear_status() to unconditionally clear Error Status") says pci_aer_raw_clear_status() is only for use in the EDR path (this should have been included in the function comment), so I think we should preserve that property and use pci_aer_clear_status() here. pci_aer_raw_clear_status() is the same as pci_aer_clear_status() except it doesn't check pcie_aer_is_native(). And I'm pretty sure we can't get to aer_enable_rootport() *unless* pcie_aer_is_native(), because get_port_device_capability() checks the same thing, so they should be equivalent here. Bjorn