Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1773730pxb; Thu, 4 Mar 2021 22:13:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFkhhADC68YfKEYHPoiaUSCWZDpXY5pBG4uRZJCdbp8fTGtIrRsmySZFiaglpqDkfWPE7K X-Received: by 2002:a17:906:801:: with SMTP id e1mr873648ejd.465.1614924824336; Thu, 04 Mar 2021 22:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614924824; cv=none; d=google.com; s=arc-20160816; b=iRGYNzsVCk5zZi6yQB4w/n3pQyfOyrSgjGAeXegxCQEBKOIYEzuGJBEQDA/XS3y1jR TcgiM3ai9WNsijaFt/rQnrRgcwmMAS+58oNRalqSeWVjIp/B2+DxOqhwEf3h5+Q06i+2 IleQ8J587TC/HazwYdfbuZ9Q78+jqZRNBltGrfTl65T+LYKfyz0LMCZwp7v2QoQf6iUp ZxdAkQ5waWzHQnbrnEo0DvcYvdZHc4+kjNgPxe8gJtwhDSa3vvIQAC335ezFzXf0fHJc DJHNti48prlhc1qC7hE3SkdgQQ+2jE9qgkU2RM4wWfrHlQmOOeIZwnLGUNIrfvbKEC5a ikBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :dlp-version:dlp-reaction:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=ngHEhZVkxuQMt/DU2Di7uaB1ZkQEO2RPevAhhCOg/Cc=; b=Emzgu4OXT8Ar4J6PsGsoK9Fsy6sWro6uUeEh3kQzPmYe5bnAqfl+9ZPSob5wS57mwb zYnTGCC0MthJTiT5xvdB8JfOsgIPBMGph2CZ7Cp5g4Aa44NJmnwD/I+LFqtnndX+D+V9 1AQvu4lIYa90wc7TBYsPKjwVyxIahKjccJ58xh8An5erb43DEiLtyCDiL7YeVDWN9wlw KV7l74TBIu8n2eE863IGK8hXz1ZCSIh2Cj3BFAGMRqV2fnegRwkNTbUk/dJWHFudDysR wnUjaewx+sTHkVOE64/RMjAIorydWX7g8f2wF8LUrHU7X3ifpWsuwdO1QtZbmBYCz4Sn lbBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu7si828136ejb.169.2021.03.04.22.13.21; Thu, 04 Mar 2021 22:13:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbhCEGMl convert rfc822-to-8bit (ORCPT + 99 others); Fri, 5 Mar 2021 01:12:41 -0500 Received: from mga18.intel.com ([134.134.136.126]:27758 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbhCEGMk (ORCPT ); Fri, 5 Mar 2021 01:12:40 -0500 IronPort-SDR: FNxpkIOH3nFIXm6Og9i8PCbgx/HenRYa9xCs8PkE1KA06ApSoLQ0zQEvyXWLO70cwHIDpiLq9B mOFc/7kn8z4Q== X-IronPort-AV: E=McAfee;i="6000,8403,9913"; a="175209077" X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="175209077" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 22:12:40 -0800 IronPort-SDR: ZfcXcgfo3INW0TpmgzYUaWfSm95uw/OHtr75iij2tRkjF8VCavOOLEe8IwLGJ76uDPbCZXccPO v/dOkRGbtn1Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="518942639" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2021 22:12:40 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 4 Mar 2021 22:12:39 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 4 Mar 2021 22:12:38 -0800 Received: from shsmsx605.ccr.corp.intel.com ([10.109.6.215]) by SHSMSX605.ccr.corp.intel.com ([10.109.6.215]) with mapi id 15.01.2106.013; Fri, 5 Mar 2021 14:12:36 +0800 From: "Zhuo, Qiuxu" To: Bjorn Helgaas CC: Lorenzo Pieralisi , =?iso-8859-2?Q?Krzysztof_Wilczy=F1ski?= , "Kelley, Sean V" , "Luck, Tony" , "Jin, Wen" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 1/1] PCI/RCEC: Fix RCiEP capable devices RCEC association Thread-Topic: [PATCH v3 1/1] PCI/RCEC: Fix RCiEP capable devices RCEC association Thread-Index: AQHXCLh6LEG1CfkjwEO3CLgkzlZ+yap0+zLA Date: Fri, 5 Mar 2021 06:12:36 +0000 Message-ID: References: <4a0bf3a852ed47deb072890319fb39ec@intel.com> <20210222011717.43266-1-qiuxu.zhuo@intel.com> In-Reply-To: <20210222011717.43266-1-qiuxu.zhuo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, Do you have any comments on this patch? If need any changes, please let me know. Thanks! -Qiuxu > -----Original Message----- > From: Zhuo, Qiuxu > Sent: Monday, February 22, 2021 9:17 AM > To: Bjorn Helgaas > Cc: Zhuo, Qiuxu ; Lorenzo Pieralisi > ; Krzysztof Wilczy?ski ; Kelley, > Sean V ; Luck, Tony ; Jin, Wen > ; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH v3 1/1] PCI/RCEC: Fix RCiEP capable devices RCEC association > > Function rcec_assoc_rciep() incorrectly used "rciep->devfn" (a single byte > encoding the device and function number) as the device number to check > whether the corresponding bit was set in the RCiEPBitmap of the RCEC (Root > Complex Event Collector) while enumerating over each bit of the RCiEPBitmap. > > As per the PCI Express Base Specification, Revision 5.0, Version 1.0, Section > 7.9.10.2, "Association Bitmap for RCiEPs", p. 935, only needs to use a device > number to check whether the corresponding bit was set in the RCiEPBitmap. > > Fix rcec_assoc_rciep() using the PCI_SLOT() macro and convert the value of > "rciep->devfn" to a device number to ensure that the RCiEP devices associated > with the RCEC are linked when the RCEC is enumerated. > > Fixes: 507b460f8144 ("PCI/ERR: Add pcie_link_rcec() to associate RCiEPs") > Reported-and-tested-by: Wen Jin > Reviewed-by: Sean V Kelley > Signed-off-by: Qiuxu Zhuo > --- > v2->v3: > Drop "[ Krzysztof: Update commit message. ]" from the commit message > > drivers/pci/pcie/rcec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/rcec.c b/drivers/pci/pcie/rcec.c index > 2c5c552994e4..d0bcd141ac9c 100644 > --- a/drivers/pci/pcie/rcec.c > +++ b/drivers/pci/pcie/rcec.c > @@ -32,7 +32,7 @@ static bool rcec_assoc_rciep(struct pci_dev *rcec, struct > pci_dev *rciep) > > /* Same bus, so check bitmap */ > for_each_set_bit(devn, &bitmap, 32) > - if (devn == rciep->devfn) > + if (devn == PCI_SLOT(rciep->devfn)) > return true; > > return false; > -- > 2.17.1