From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.3254.1632289687062137495 for ; Tue, 21 Sep 2021 22:48:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=EVJMUnQH; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="223564150" X-IronPort-AV: E=Sophos;i="5.85,312,1624345200"; d="scan'208";a="223564150" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 22:48:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,312,1624345200"; d="scan'208";a="474432034" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 21 Sep 2021 22:48:05 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 21 Sep 2021 22:48:05 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 21 Sep 2021 22:48:04 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 21 Sep 2021 22:48:04 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 21 Sep 2021 22:48:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gGs6ldNxYghk93vaTG1xYFhC9HKJ+wE+i+/5WM1Ec/KG5r/hCQw7jrgDyaKjjxAJ/8Rhdvyeic4osAPtcISqDxDX37m4E71ROA6cIN+X9BtLLBqA8h9Y1MZWsTgAwObp3CWzNAahxh//b+eGgjW6zR/c7g944rzjC5bk4Jv8ALdTrT6InPE4qVTrgeQOcs0Z8CvjIGcfrTVxGVn5vof2ZkmjeKWkj/G/T+KQpmtrDsPPlFHUDdaa0nP2nbnpmQjftFH06yajKNIxf9lEk0gIJz7s1+BZwKXtRFMlHNzfKqR6M3kGnWF4Chh2xVGiu9Hu/gcZYegcdJ2XF5odAf86rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6zrfHOy7Zc3qwcxGVlt6p3Yk0buVu/FxqB5XLxYtMmU=; b=ggfuik7x7k2VMR/Ddu929K5yOB7QP67RDHZg7eUVP3zCqwSLwaIF7cMSw8rlKDlTg1u2u0FUWaC0jat7aU9Vfz7MSAj9iv5OhIZ+Gj6tpXrF4D2LcGztpBIbkuADMSPOAuhM03CBjXhZZSaXM1IKmLvRWOZAzWv658lqXAZ8QXHQAiwiYBl6knN4nJg/IiqsZ/fB1HASOqlJNFZnGTK8a6YNOJQ/rrvKJq+XS/OFWdG7Q1x0FKEeokuXU4vLhiwR78/yjkljzGdpZm2DF0Lgn5WaNoc9qpZHIWJrVt4CnUz8eAjavrJa260MxGY0+P8IGD9r0qmgqzoCIjbv0sFISw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6zrfHOy7Zc3qwcxGVlt6p3Yk0buVu/FxqB5XLxYtMmU=; b=EVJMUnQHf85IErU4/KU7hrjmUXxOMuH069BFrcbTbzn/m+MJqCUSeICTBLx4dK6+SeV1Hgifs45DMAZ0TNKXb1vaPWocClngDT6CEcVNZHLqAjuWLBsa1ubBuY0lSXKzcso+84KTGl2T0QxulkCmtP1ugJKUyu2fbX+us0QOA5s= Received: from DM5PR11MB1708.namprd11.prod.outlook.com (2603:10b6:3:d::16) by DM6PR11MB4396.namprd11.prod.outlook.com (2603:10b6:5:203::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Wed, 22 Sep 2021 05:47:59 +0000 Received: from DM5PR11MB1708.namprd11.prod.outlook.com ([fe80::6572:2c5:164:5e94]) by DM5PR11MB1708.namprd11.prod.outlook.com ([fe80::6572:2c5:164:5e94%6]) with mapi id 15.20.4523.020; Wed, 22 Sep 2021 05:47:58 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Wu, Hao A" , "Xue, Shengfeng" , "gaoliming@byosoft.com.cn" , "Ni, Ray" CC: "Xue, ShengfengX" , "Liang, PanlingX" Subject: Re: [edk2-devel] [PATCH] On branch PCIBus dulePkg/PciBusDxe: PciTestSupportedAttribute logic should be changed. Thread-Topic: [edk2-devel] [PATCH] On branch PCIBus dulePkg/PciBusDxe: PciTestSupportedAttribute logic should be changed. Thread-Index: AQHXr3VlS+BF9zNEr0GuJBfImAKQeA== Date: Wed, 22 Sep 2021 05:47:58 +0000 Message-ID: References: <57eb87fe03d054ffd8078bd40652104c9bc5c76e.1632280373.git.xueshengfeng@byosoft.com.cn> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fc3c2e11-ea49-4d37-82e2-08d97d8c8848 x-ms-traffictypediagnostic: DM6PR11MB4396: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:98; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3FJWAc23GegO+5G1+0f3bSb2Xc24R1sdy1PNAnDm7wliEUyzYS9FkBn2QbmeGFmmFFke6Hfuylcm2gDc7SS+kQsMRc5UPJrYnxWtnJiuQvxT3l9bbbR1e0rmMUBu6uLHo5V24JE6o+t7drbM060kWBSE/dyA9vvhCwsS+KEmEsgltD9U6Nf0eTYxDnK6+DwoLGHL9zE5MHARVQgo0YBG+s4TKqRapfSRQWxPIfWx0sCIeD3CMGE5IU5Wuind7eq0xP959tKa2DIPVNaf5GXJoXbvnMsiH6QoaPfJX1zNbWSJLVZiCu0gt5VvJcrAR3K3hrnwjmhaif2g0+AXz5n9PLlojuHK5FUYDGHjckdSk+e89+r9IOstzS73G3MVqmX2L5xHH937dXf6OaeJSznc/2dI1J6LZeUCnnP3ijr6CjyYT6EK1Pl6ZiPGhxKH33hB0bzldY9FojPEL8d+oMYTianAiDIJ80/prYEPJqVeyRpzw1iC8A6kawdefhpOx/BfH1mzvqlRvNWGaqurHzifAGTl/1WHww2ZPiZ5+LPIx0OAFKeuVyicp4Bx2WjxCNKjrXpYYNGh8470PmWn+FdnOOcNICS8R6z3/2SxE7cJ/aM5fB7IMOcWeJtLLmLNSOs0mozr6YgDbrv1r0/Ckum0nMlYdKwYZnpIGLUpuuG++gPDskofUMlRX1YbKkh/VToRSsov+TKShHLmAzmwSpvvN+V+5N1CKkYP6x1Ra9jAFJnyGoiwvO7jf8IbJbm7wiEyggDvbUHwwGVvtMAL7ubKo51JClaoUi5hYosJ+keXXPQOz/uUSWsPz9RSNH3eW0fge7T+Z2f+IzNhdovDHgkcOg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1708.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(2906002)(83380400001)(71200400001)(9686003)(55016002)(33656002)(508600001)(26005)(2940100002)(966005)(54906003)(38100700002)(8936002)(38070700005)(107886003)(86362001)(66946007)(7696005)(4326008)(110136005)(5660300002)(53546011)(122000001)(186003)(6506007)(66476007)(316002)(66446008)(76116006)(64756008)(52536014)(6636002)(8676002)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BrfVvwAzT9nnJAqWuzGEA7D4AXaQ3Y2bl/qHG5ZFpioO5626fHi08AJQFsdI?= =?us-ascii?Q?YkBYSVrs+GwrrWPy5dE6ODRqMBcL2Xd4rkA1l3Ku90LkOsE61t9boZQdlOph?= =?us-ascii?Q?AO98XBQI6VA3cq3W40STNIsIGVuqfUIaZlgBKEuKfsdWGmN50OeIXMoGVdUL?= =?us-ascii?Q?h1q5eG5ikMp7uKSy5udT+bpGL+sKeogSFgSs7K2bJX1mIfS4jB4Pm0m24VVs?= =?us-ascii?Q?O3Wawh9WlrZ39qPWMvQ4O9PM2IFYLLh3SzcqKiEP2GVB//zs9Cga8DykVY44?= =?us-ascii?Q?a4XdcJa46v743//DtCi3rUneZK9Si/hneaMwq1DKwAbrxNE22eCD/uUo3xev?= =?us-ascii?Q?BixszWkwLIRbsKYEyHZ8nhJiqN8OZME6ASDcFF2wTd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OVQ7w4WxWDEnXdkM3yamslAyjAyHBcJWGOX+Bg0jMdrkOKUUWB5XdH?= =?us-ascii?Q?M58iLvpGJMAkar4ZIdAofOm4?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1708.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc3c2e11-ea49-4d37-82e2-08d97d8c8848 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2021 05:47:58.3473 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VJmh5OMSUM3VcmK0zcmNIR2CYGO6Qh8RdMLuaNTU/23+B0lPsXTbuEU1msi1cSiz/r7cwAeqyLG7q3yaiNiTAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4396 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry for missing one comment. Please help to update the subject of the patch to: MdeModulePkg/PciBusDxe: PciTestSupportedAttribute logic should be changed > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wu, Hao A > Sent: Wednesday, September 22, 2021 1:45 PM > To: Xue, Shengfeng ; devel@edk2.groups.io; > gaoliming@byosoft.com.cn; Ni, Ray > Cc: Xue, ShengfengX ; Liang, PanlingX > > Subject: Re: [edk2-devel] [PATCH] On branch PCIBus dulePkg/PciBusDxe: > PciTestSupportedAttribute logic should be changed. >=20 > Two inline comments below: >=20 >=20 > > -----Original Message----- > > From: xueshengfeng > > Sent: Wednesday, September 22, 2021 11:18 AM > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Wu, Hao A > > ; Ni, Ray > > Cc: Xue, ShengfengX ; Liang, PanlingX > > > > Subject: [PATCH] On branch PCIBus dulePkg/PciBusDxe: > > PciTestSupportedAttribute logic should be changed. > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3635 > > > > In file Edk2\MdeModulePkg\Bus\Pci\PciBusDxe\PciEnumeratorSupport.c > > Function PciTestSupportedAttribute, This function is called when > > doing the PCI enumerate, it tries to test whether the device can > > support given attributes by follow steps. > > 1), read the original register value > > 2), set to the input register value > > 3), read back the register value, return this value as output 4), > > restore the original value This will cause the enabled bits in this > > register be disabled during this sequence. > > > > Below are the new suggested flow: > > 1) , read the original register value. > > 2), set to input register value OR(|) the original register value. > > 3), read back the register value, return the value AND(&) the input > > command value as output. > > 4), restore the original value > > > > Above sequence will not change the enabled bits in the register, > > and can the new supported attributes by the device. > > > > Signed-off-by: shengfengx.xue@intel.com > > Reviewed-by: gaoliming@byosoft.com.cn >=20 >=20 > Please fix the inconsistent space indent within the commit log message. >=20 >=20 > > --- > > MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > > index db1b35f8ef..2462f58833 100644 > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > > @@ -933,6 +933,7 @@ PciTestSupportedAttribute ( > > ) > > { > > EFI_TPL OldTpl; > > + UINT16 CommandTemp =3D 0; >=20 >=20 > Please separate the local variable definition and its initial value assig= nment. >=20 > With the above 2 comments handled, > Reviewed-by: Hao A Wu >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > // > > // Preserve the original value > > @@ -944,9 +945,10 @@ PciTestSupportedAttribute ( > > // > > OldTpl =3D gBS->RaiseTPL (TPL_HIGH_LEVEL); > > > > - PCI_SET_COMMAND_REGISTER (PciIoDevice, *Command); > > - PCI_READ_COMMAND_REGISTER (PciIoDevice, Command); > > + PCI_SET_COMMAND_REGISTER (PciIoDevice, (*Command | > *OldCommand)); > > + PCI_READ_COMMAND_REGISTER (PciIoDevice, &CommandTemp); > > > > + *Command =3D (*Command) & CommandTemp; > > // > > // Write back the original value > > // > > -- > > 2.31.1.windows.1 > > >=20 >=20 >=20 >=20 >=20