From mboxrd@z Thu Jan 1 00:00:00 1970 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 31564C00528 for ; Fri, 4 Aug 2023 12:15:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbjHDMPB (ORCPT ); Fri, 4 Aug 2023 08:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbjHDMO7 (ORCPT ); Fri, 4 Aug 2023 08:14:59 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1E646A6; Fri, 4 Aug 2023 05:14:58 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RHPhL3SYBz6J6sL; Fri, 4 Aug 2023 20:11:30 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 13:14:55 +0100 Date: Fri, 4 Aug 2023 13:14:54 +0100 From: Jonathan Cameron To: Smita Koralahalli CC: , , , Bjorn Helgaas , , Lukas Wunner , "Kuppuswamy Sathyanarayanan" , "Mahesh J Salgaonkar" , Alison Schofield , Vishal Verma , "Ira Weiny" , Ben Widawsky , "Dan Williams" , Yazen Ghannam , Terry Bowman , Robert Richter Subject: Re: [PATCH v3 3/3] cxl/pci: Replace host_bridge->native_aer with pcie_aer_is_native() Message-ID: <20230804131454.00000622@Huawei.com> In-Reply-To: <20230803230129.127590-4-Smita.KoralahalliChannabasappa@amd.com> References: <20230803230129.127590-1-Smita.KoralahalliChannabasappa@amd.com> <20230803230129.127590-4-Smita.KoralahalliChannabasappa@amd.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Aug 2023 23:01:29 +0000 Smita Koralahalli wrote: > Use pcie_aer_is_native() to determine the native AER ownership as the > usage of host_bride->native_aer does not cover command line override of > AER ownership. > > Signed-off-by: Smita Koralahalli > Reviewed-by: Kuppuswamy Sathyanarayanan > Reviewed-by: Robert Richter I hope there aren't systems getting this wrong but make sense to support same override as for other cases. Reviewed-by: Jonathan Cameron > --- > v2: > Replaced pcie_aer_is_native() at a later stage for automated > backports. > v3: > Added more context to commit message. > Added "Reviewed-by" tag. > --- > drivers/cxl/pci.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 2323169b6e5f..44a21ab7add5 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -529,7 +529,6 @@ static int cxl_pci_setup_regs(struct pci_dev *pdev, enum cxl_regloc_type type, > > static int cxl_pci_ras_unmask(struct pci_dev *pdev) > { > - struct pci_host_bridge *host_bridge = pci_find_host_bridge(pdev->bus); > struct cxl_dev_state *cxlds = pci_get_drvdata(pdev); > void __iomem *addr; > u32 orig_val, val, mask; > @@ -542,7 +541,7 @@ static int cxl_pci_ras_unmask(struct pci_dev *pdev) > } > > /* BIOS has PCIe AER error control */ > - if (!host_bridge->native_aer) > + if (!pcie_aer_is_native(pdev)) > return 0; > > rc = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &cap);