Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp201243rwb; Mon, 26 Sep 2022 11:06:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4j0Iw4RyOOQ7hCMF68zS8yA2H4chOM4kXLT3DQORQT8+00A9U6N9AQx5ecn91k5T7QolgY X-Received: by 2002:a05:6a00:1892:b0:540:acee:29e8 with SMTP id x18-20020a056a00189200b00540acee29e8mr25254796pfh.1.1664215572941; Mon, 26 Sep 2022 11:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664215572; cv=none; d=google.com; s=arc-20160816; b=iKZGsJ9r9SnyrTLQPvlnhXFC2UFD0eLqrppxPhjxxt0IWntzTBWDh1Fm+fHAqWpmKe 5Px9bI7w55T/En+bkQwfJF7tvmSLlDOKyfdJSOx9CWLYgAwDtfWrrRaecylBzpiPp0lF Pdq+B0aa6EoWLg+G4sg2iqCSbtkDDVolNQP+neK8/La1UGRorsM8sfJWzy7wUu2nV1Db wS/LsTSS/unwXjUralhMrk2EwfDUELKwsJZ5k7+uFZvUty+edorAvIRiIb6fh2zdwp6K HZW9FSmb+irAPt282blGnTYTz7wRMcH82QzMAbUcu12eJ57Lr7XeCKFvmO4+zt+CRLo+ 5rTQ== 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=graZvOy3JWlZplIJ+MfQ0cgohFmd2VXDN3onYldcU/Y=; b=qtaY0eLe0AWfgOjZ9ItkKNLFV5QLZ8Txpbv5p5TszlfnsQ1d81jotpdEVYrH/zL4qy JxpkNBmC4yZen80mJCC37iIhkD5aLboku3m5rCbREc15RgGejzKw85BFRLGhyhccEFJG joix4YZcINsQCYRq//4rfe/CUMLbfrcGaFTXolQ5cZg0HMiZ7mGilvt3BKnVBmwxEBje 1AK0WxQrFcLG2qkjFYNCujMAvpejp/ntKhNF8wcI72tdloIboISiai02P/8/krprvyG4 tO+E2xgop/m66y3bgXvknaM2+P0afhXiZgoES8i9+DWrXfogQReG8RzJ7T4pUIWwe7aH nw8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XBGoGIPo; 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 e4-20020a170902b78400b0016d67ef8943si11617041pls.187.2022.09.26.11.05.58; Mon, 26 Sep 2022 11:06:12 -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=XBGoGIPo; 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 S231293AbiIZRuj (ORCPT + 99 others); Mon, 26 Sep 2022 13:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiIZRuN (ORCPT ); Mon, 26 Sep 2022 13:50:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5D61A4865; Mon, 26 Sep 2022 10:22:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id 5C60AB80B8B; Mon, 26 Sep 2022 17:22:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC080C433C1; Mon, 26 Sep 2022 17:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664212968; bh=4EYiYZ0wrDgSgsqkBMAwgMjP6z1zRz5Fmv8L+RYBpPg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XBGoGIPobGMP16I4bFTLp4eHtOgJGOZUZHef8ebOBcb7pYrIzpxDPi39Cv3BXSbTE yDIpGbaDJShRsyYq50eEe0VIQT7TJCiUN3p5oqjE/QK7IvCBtUmJiPCLZLSXlH7tJY apt19ITXr926s7KKXqBlNpm4DCsmlFbnuabBiKWwLA9JYL0EWeVfO9kAyG2aSB+T/G ZsLqStUswyWHmlaVpAud1aYKUdvH2cNneaIE4hegZSo442hawm0mJq9j2jha91GKn3 HqBU1xFvU/s7p8HS0QDiwHdI1FUCqErzpQZm911AHs8ewHGOV2UR13IMJSpttiIkU3 6i8iuXQnYBY7Q== Date: Mon, 26 Sep 2022 12:22:46 -0500 From: Bjorn Helgaas To: Zhuo Chen Cc: allenbh@gmail.com, dave.jiang@intel.com, linux-scsi@vger.kernel.org, martin.petersen@oracle.com, linux-pci@vger.kernel.org, jejb@linux.ibm.com, jdmason@kudzu.us, james.smart@broadcom.com, fancer.lancer@gmail.com, linux-kernel@vger.kernel.org, ntb@lists.linux.dev, oohall@gmail.com, bhelgaas@google.com, dick.kennedy@broadcom.com, 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: <20220926172246.GA1609538@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e025745-06af-c5c6-aa70-6ff1f9ad0962@bytedance.com> X-Spam-Status: No, score=-7.2 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 Mon, Sep 26, 2022 at 10:16:23PM +0800, Zhuo Chen wrote: > 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. > > > - 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. > > > 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. Yes, definitely! I goofed when I applied that patch without making sure there was something in the function comment. Bjorn