Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp20471rwb; Mon, 26 Sep 2022 08:47:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7i6oFzfc3F+Q9UwBUGILGg30IoqTiqwpGL4gOfz5vOyx6PykzZWBXFsxSx//u6I1x0O2lY X-Received: by 2002:a17:90b:1bd2:b0:202:56b2:4f35 with SMTP id oa18-20020a17090b1bd200b0020256b24f35mr36716165pjb.65.1664207237448; Mon, 26 Sep 2022 08:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664207237; cv=none; d=google.com; s=arc-20160816; b=JZpI7CdgefLctF2cwmp6oIZ0dGEmTwXu3k41I3V+MiHagbxZJ59lXFmECskJfniVEV H4LuZdo8V6PR9ua1ahng7ZznZ47UE4F54aMTgU4YueYuT3yTLiWi/KGTGJwT/RZ2TT/0 ZVvBHBd5eV1K8wFUhE70pgzxd/LlWk/Vgtj+I8JbfoG1lUpe8BcloPF98GHwEzmCDlte H37rPebgMom/z17jVHRH16xoa8NWWo7HxbnSuCO6BEuQ+nrCyjfka6h5HcACRCmfaE7I RjFND8/OiI2zAp18LO/6FMGqXMknoPWC3vUh2i3R6IFr7oXto2AuYpbXX3+Di28nOEdI lfbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=f9x4Js9aJ8GGYBn29EvIVTQooQM7+4F6Gd+zw2Mc6M8=; b=zow94vLnz7rS4gEtCgRmr6qUaZPOBumreTTyHug3gd9Bl/xG82NFzUcyKFoefZAmz7 0gV44hn/u9n3ihAPiFb9FJbwwOxhKnCrLBCkR9wNXtERRvUuAObnH5lGa7xwjZ8f7fJY vTvb6D0vIt9ckWgxv5d1ve25xCmejrdbxjGb6KLAgg9f4xceeNq1rxu/f6WyhpYNoKtQ +YbX/qkggUqatHaAVAeeBmA/tICflRjRsOxN6zkJf46D01dn4bIWWtVh8CN/ALulS3XX AetazzM5MuUR55Y/4KQ3fec1Dnks4nSMp/gbE1UC634mokGPREv1K0KjFnJ534lQI76N OieA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=zbi+yH6o; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu3-20020a17090b1b0300b002009da5d10asi14021311pjb.128.2022.09.26.08.47.05; Mon, 26 Sep 2022 08:47: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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=zbi+yH6o; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236670AbiIZPbh (ORCPT + 99 others); Mon, 26 Sep 2022 11:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237432AbiIZPaq (ORCPT ); Mon, 26 Sep 2022 11:30:46 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CAFD80F4C for ; Mon, 26 Sep 2022 07:16:32 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso6926885pjd.4 for ; Mon, 26 Sep 2022 07:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=f9x4Js9aJ8GGYBn29EvIVTQooQM7+4F6Gd+zw2Mc6M8=; b=zbi+yH6owkuseZsPd8cID/9/WJR+WXOO72huZu1wJYjkboy+f0MsZabCpreRAfu0Sf 3BZmYRBcwpD7wi8A/IOpfuJVOl1A8rCJFaIcGSG0jKTrF8oCvuPQ+RBCTLvziQZNwC1g Jd9oklGK6EvDETceCFaUoZePQcW8L05Zcov7bvOd0XZhHHpbvz9QNXl7DZPgxMgKI0QQ vLCHPHYSGblBh6eb+LQZr1TrgBNIz+T+/FWuQZnJCYJQz7wXYaPUaM7LuExyVVf5TwXJ ct7K8VAqw2t9I2n0tte3U2h0Rk0Ver57AT66B18Yzk80ZWyfj9mzyHlAE/JXkq2hSxLS 3r+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=f9x4Js9aJ8GGYBn29EvIVTQooQM7+4F6Gd+zw2Mc6M8=; b=0OSoLSoAo+VZ1QVh9Gb7QMCEncbaMcLHldUAkQ9mZtMBTAKl9/xEC6eB/2ILBFL0yZ qpsK2qyLorhxxv/iN+6OLxw6ShAVbbND/Eql0Aw5G137wgU0EZK1v/xrSAMGAGIa8sq6 6cwyTSmmxPn8rS8CyVLkuqRol1t5kr550LpvLos6TCHw0EuELsWZ4mqj9cdCDSeTue69 2bof9QmmH5/DE84FxUYi8gHIFjYqXXnjjwO2X7qjjw72WaPx8WjIHCWBvhcKKyFCs7Q+ ecZAlv+ZYRzSqTcwrtuGkW2HifWFMG+QEeSL9sL7D44k2bMcpxhcAjIvdh+CbGNQJD0R E7Jg== X-Gm-Message-State: ACrzQf0UNKH/VIBXX6q6siJpyMubPog2Knzg5+RQluLD1RacF+iJh5Vn njh4O3fdy2ApOGqx97jKrf5Y3A== X-Received: by 2002:a17:902:6b0a:b0:178:9a17:5b89 with SMTP id o10-20020a1709026b0a00b001789a175b89mr21933535plk.113.1664201791912; Mon, 26 Sep 2022 07:16:31 -0700 (PDT) Received: from [10.2.223.68] ([61.120.150.77]) by smtp.gmail.com with ESMTPSA id b11-20020a170903228b00b001781cad59e3sm11362897plh.108.2022.09.26.07.16.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 07:16:31 -0700 (PDT) Message-ID: <3e025745-06af-c5c6-aa70-6ff1f9ad0962@bytedance.com> Date: Mon, 26 Sep 2022 22:16:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH 3/3] PCI/AER: Use pci_aer_raw_clear_status() to clear root port's AER error status Content-Language: en-US To: Bjorn Helgaas 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 References: <20220922215030.GA1341314@bhelgaas> From: Zhuo Chen In-Reply-To: <20220922215030.GA1341314@bhelgaas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 9/23/22 5:50 AM, Bjorn Helgaas wrote: > 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 Thanks Bjorn, this very detailed correction is helpful. By the way, 'only for use in the EDR path' obviously written in the function comments may be better. So far only commit log has included these. I will change to use pci_aer_clear_status() in next patch. -- Thanks, Zhuo Chen