Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10907340rwd; Thu, 22 Jun 2023 06:29:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71Xt8Ot1wQL9p5ULSe2yz6bfZ46WL3Mz0LQXIxh7ay8cPXhb/oo1gC6juLNfvsYpnWW2y1 X-Received: by 2002:a17:90a:d90b:b0:256:dbfb:9b5e with SMTP id c11-20020a17090ad90b00b00256dbfb9b5emr11417272pjv.29.1687440578560; Thu, 22 Jun 2023 06:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687440578; cv=none; d=google.com; s=arc-20160816; b=lL0mww3cB4bdzfkhux2naaCe2J7eFqajq/cxJyGq+dwfVlxm1ZLGkqotdJo52WKPlS R3kjqTazTQx5y0fpr3VskmrhgK4Q0MEk20QX0CeR4LEH49Ig7fNmn2ALbwLj9A5Soi9D RtvUcDvyGKO9HE9+NYE09v88EZLRu4jtJmwq5VrqZdNKXHNNP63qJYFhoXlmx+2JL9Kh U7buz1Rs7hdtAszKZK7tkFbuXObgGsLINF6CG5EfrRcJTbckaMk9xkLhM79068o4uQBK eynBS4mwicA9wLfxN6WIk7pIe09i58YKcIPDOvlll3+tmmHeJ70FACavqzrJuSdboGvB JXbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=XVB9JWuUeMePek9JF0hIik5dilsHFLoMkRp2IBXkKlo=; b=gk5b9YW2wlQQdhdAWGghBpnyba1hTm3OdDy9fBtZxBhl1pufzadTQpXkig6k0m0MKD MhgG4xPWeuHy/Crhw40gWt1gKrQ5sV+Cc7eVuLs0Xx3xiOKkvbjrX+QCrRV2TuN5o614 1GFpD6J7TSI1hIUn6D9VNdl1L6vxMKrzdG3bfmTMKbQcRd3cuNyG7exO/ZlBF+Mqq2wG ys9AGgbXjIeI7mSD7/lwjIa2vKKjIc96g7yvbi+SNADf5aVfQY5wQ0ar9nlW1U+sBArs UAPOY5hJy4/kMwk7xUiLeipEZGW8De6WnPXMnAQi7HydABY8AfoNnxPDtDKZX3/hM1/k SIRw== ARC-Authentication-Results: i=1; mx.google.com; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a17090a01d100b00260fadc24b7si3590715pjd.75.2023.06.22.06.29.26; Thu, 22 Jun 2023 06:29:38 -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; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231543AbjFVNHn (ORCPT + 99 others); Thu, 22 Jun 2023 09:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231569AbjFVNHf (ORCPT ); Thu, 22 Jun 2023 09:07:35 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C18C1FC6; Thu, 22 Jun 2023 06:07:30 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Qn0vg5fLCz6J6kS; Thu, 22 Jun 2023 21:04:47 +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; Thu, 22 Jun 2023 14:07:27 +0100 Date: Thu, 22 Jun 2023 14:07:26 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v6 27/27] PCI/AER: Unmask RCEC internal errors to enable RCH downstream port error handling Message-ID: <20230622140726.00002dce@Huawei.com> In-Reply-To: <20230622035126.4130151-28-terry.bowman@amd.com> References: <20230622035126.4130151-1-terry.bowman@amd.com> <20230622035126.4130151-28-terry.bowman@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: lhrpeml500001.china.huawei.com (7.191.163.213) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Wed, 21 Jun 2023 22:51:26 -0500 Terry Bowman wrote: > From: Robert Richter > > AER corrected and uncorrectable internal errors (CIE/UIE) are masked > in their corresponding mask registers per default once in power-up > state. [1][2] Enable internal errors for RCECs to receive CXL > downstream port errors of Restricted CXL Hosts (RCHs). > > [1] CXL 3.0 Spec, 12.2.1.1 - RCH Downstream Port Detected Errors > [2] PCIe Base Spec r6.0, 7.8.4.3 Uncorrectable Error Mask Register, > 7.8.4.6 Correctable Error Mask Register > > Co-developed-by: Terry Bowman > Signed-off-by: Terry Bowman > Signed-off-by: Robert Richter > Acked-by: Bjorn Helgaas Trivial suggestion inline. Either way Reviewed-by: Jonathan Cameron > > +static int handles_cxl_error_iter(struct pci_dev *dev, void *data) > +{ > + int *handles_cxl = data; > + > + if (!*handles_cxl) > + *handles_cxl = is_cxl_mem_dev(dev) && cxl_error_is_native(dev); All bools, why not make handles_cxl a bool and avoid need for !! below? > + > + /* Non-zero terminates iteration */ > + return *handles_cxl; > +} > + > +static bool handles_cxl_errors(struct pci_dev *rcec) > +{ > + int handles_cxl = 0; > + > + if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC && > + pcie_aer_is_native(rcec)) > + pcie_walk_rcec(rcec, handles_cxl_error_iter, &handles_cxl); > + > + return !!handles_cxl; This is the one you can get rid of the !! on if you make handles_cxl a bool. > +}