From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.4639.1632464053402511416 for ; Thu, 23 Sep 2021 23:14:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=qGUkFnov; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="287679648" X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="287679648" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 23:14:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="558856244" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 23 Sep 2021 23:14:12 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 23 Sep 2021 23:14:11 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 23 Sep 2021 23:14:11 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 23 Sep 2021 23:14:11 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 23 Sep 2021 23:14:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPpDZofDt/5dLpMf0VTC0/4MjUhuC+j4o+oitoZnyz6NwvW8j19SrIZGp4GEuWjRELonWBXgbbi/5svCV6xFX1zo+pNVdA+H0Zx2GPbC13KpJ8+TvDqWCYvMI7EwARA1OkC8HAEIbEYy5dBKxWNnF7Mck0bVUZLQFVUgxLe0kkX8qsUASmKutWBHMTGA8QMhaQX0HuLlgGF3gf168d4RfLLrKLd84c8jaqt4UT31EneTTKtPIEbsfSZuhp/dUZdxaK1sIhbQM8StZkni59PJc14+DhZMXQgiGgZUF0gh7efHjjYs/oaA2/o2crthNP6Di9HgP1z76Av8tJEedS6sdw== 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=QGwhcsPz/IaizAoy8ucy+dt69ZpYfkirNMfMxSHh7MM=; b=YEYkYUZBIxb3d6XNExQJJ+KfJbJzqBXuUqipLGWJzas/xKP9P+b2tkXALazakyPmHBbN8sWorgGb762RsawIJ5Sc3x7riPJSlDbaupCty8lRtKWmDc+fRwdOxXd6CD8KrYIp8pmzc1RWRKdB6CfLo3j4V+zvNhqESRQy5u+BajHevvoeE808y1jj2ikqA5aBJQhXxATmXmD3dq1OPvQQN7o0OCD191sw5kVVAYdy4GqW3Q24eylzU0IOVmkDgLngfQsWrr3eiLWwTdo9GN8/198PyVzpa5U6xXrjGn1D3eo0PNrHoSfqWTdlh1GhwqB4W9ZysUg4wBKPtrlqKZbO/Q== 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=QGwhcsPz/IaizAoy8ucy+dt69ZpYfkirNMfMxSHh7MM=; b=qGUkFnovlsib6aYIk8dsPIacrmOil9ElHYa36m2q0nYxG4XMsdBaE8hY+EEkUqU03mtx6pShAG2qyixfBKZ0zKTEnH1e+iMgtx9RHQgY1m5kLQLwAKKjr5Xb9svWW/AV4ufA+ZTjBVAkDNViEuqbOa3ZlrJ0yXZgtiiYxV8V4OI= Received: from CY4PR1101MB2072.namprd11.prod.outlook.com (2603:10b6:910:1d::15) by CY4PR11MB1798.namprd11.prod.outlook.com (2603:10b6:903:11b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Fri, 24 Sep 2021 06:14:05 +0000 Received: from CY4PR1101MB2072.namprd11.prod.outlook.com ([fe80::7dc5:34b5:bbff:832f]) by CY4PR1101MB2072.namprd11.prod.outlook.com ([fe80::7dc5:34b5:bbff:832f%8]) with mapi id 15.20.4544.014; Fri, 24 Sep 2021 06:14:05 +0000 From: "Ni, Ray" To: "Xue, Shengfeng" , "devel@edk2.groups.io" , "Wu, Hao A" CC: "Liang, PanlingX" , "Xue, ShengfengX" Subject: Re: [PATCH V4] MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes Thread-Topic: [PATCH V4] MdeModulePkg/PciBusDxe: Improve the flow of testing support attributes Thread-Index: AQHXsQoDIU/bLWihpkKjoChFK7LzDquytElA Date: Fri, 24 Sep 2021 06:14:04 +0000 Message-ID: References: <1b51d351316704a1af8d38d95adb393aaf7b4565.1632463138.git.xueshengfeng@byosoft.com.cn> In-Reply-To: <1b51d351316704a1af8d38d95adb393aaf7b4565.1632463138.git.xueshengfeng@byosoft.com.cn> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: byosoft.com.cn; dkim=none (message not signed) header.d=none;byosoft.com.cn; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5dbda459-d84c-46ba-1913-08d97f2282e6 x-ms-traffictypediagnostic: CY4PR11MB1798: 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:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aGsfsFu9p/o3Qt2ndLwC4pKNYxG3pufRUsiAv9gL1qLprbHMXtCHB2B0o6EeZmWEW8PTn3kRnuQmQTBDGwKVtYVuYsSLgi2UE+4eB1Rk8u7KPfV2T18eXiQMnn1Z50e5jNqyMFlSc7iXSo1PO6YrtRGmyFUSwDvDKIVu23BRtNkTZQzK8SwJlszFzLzr1diaHil/TWAe2FcJAA11Ua3YhhjfAPhzih5O1+tRY0yP03bChboKY11leQHLAYkpApBp5NgUXzRc/lhHavweyMa45sdV4k78G23+zBsji+vmTb/xCaAkd0R0T39DDisUcg2ZVP29lD6PXgOh2m9m6qzEkc0OR9dVaxD7PycUK3EmQMBYJC/AEtjuNjXWypmPIcChnhQq7HEeFzvGhorst+n/UwAMy7z9+dKmiGG0+lcRrN2u4P731EtOvUaYakqqqBxrdwbdRQdFepSq6b65x8z19wdseM+Ov570OwRbLMjRJcRuyjgV502oNMnVRoAg4RmN+Zn2oqQPnu4RGsPWye/J7tcK0wqqhxh3+toUWqvZr9r+l676Kip/Fx5v3YZGDpgJPNPumGUcJmi0s5pE3gIVmZvY0Y7EQNVMcTq+9997wZS6whXBpiWnNuHTxITmNDpnlRODp2byDpynG/N49YCKIO4KxKa6R3mvO2vD7w6CRcynC8ZLKfTSZcuHMN06Z4uisaPlC2s3d6tKHPYDk1CuuNBQ27XY+Ti2IU/7Edk+xtUFLnoiRmtNQE216BW6Vvq31ZCOTojNxS0K2cHhg1CBORHGyfBVzBROkcK+x2qHujk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1101MB2072.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(5660300002)(7696005)(122000001)(26005)(76116006)(52536014)(38070700005)(33656002)(508600001)(4326008)(38100700002)(6636002)(316002)(110136005)(966005)(107886003)(6506007)(55016002)(66556008)(9686003)(64756008)(53546011)(71200400001)(66446008)(86362001)(54906003)(66476007)(8676002)(8936002)(186003)(2906002)(83380400001)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t0lidS8w+pNz6M4z7THXGT/uiP+AOoeSrrvf07CPwtzEdnHOYWe0/TVSM0ym?= =?us-ascii?Q?hbTvBPJDSnrdSil+lzS0cmMiUFM4ln3oHUVfSkEAKrt9Hq80ehEhkCENgqRx?= =?us-ascii?Q?ktloZ5Obq46lKXExNPGp1Hxl3WAg17PQOuaICjNAXLI5smHAk4ujcHZQO9ha?= =?us-ascii?Q?UjQqTa/dCM2chVn4D6HkLSkZAJ7bObLymZYMVSQyDwve9Yx8vNSoSFtHQf2c?= =?us-ascii?Q?sXQ5pSI0r50TuXgqq2kjQWjkjZ5oRzSzUX0qNsBBXyV3Jc9fwqfF+bG27yrc?= =?us-ascii?Q?gCPtbASSDQMPImNYxBIJ9FyGrPsj+QFC8xWIGqJRWJQZxFRPHuUlfKfxxcxG?= =?us-ascii?Q?6/IGk03B4zXeSvtXKXFo5imk2aI3wNR5VjlEVWKBpOh7hrGhLLWVS6XROdLq?= =?us-ascii?Q?o2luf2MhiAc1ez1q2ANYtlcOhYG/tQKelPEB8A7L52EdQA2+Vo8hScP0XwgU?= =?us-ascii?Q?PpWDJVijQ/XXSKPE36zk1vIB0Bg64TrIiZXSpdzTkmE7QmexLx8TcZboeIzy?= =?us-ascii?Q?VZBprJcHU9/N7943k8SSP4dZ5ZHW8X/ONImT69kR5115TBsh+b8GlfjDqmLt?= =?us-ascii?Q?a0XF0GVQXl5S/RJZpGIF9gTxzkZTq34oFIfvybJ9j38E62IfPUdb9sGV9p/C?= =?us-ascii?Q?KSgEwqwpZtzhgfl9u1hbUAyxtqSyFWl9CNKs7gVDCbRcSR9yHQqi4RZ3EhU4?= =?us-ascii?Q?5p1c/UtNqjlGjjc9jTCxn0TFLE9/8XJgEchURKqh1BpIk/4zaES48ZO5MfWk?= =?us-ascii?Q?tE3wxrDUy5p7fxLiHu4tNGsYnVh14vjjp8xhy9kUyLvXCVG/W1GZ67X9FAKD?= =?us-ascii?Q?RHcvWInJTOC/8hKOqM+F2eFzVCJiPFVDB4XCtGpgQ6ufHBNZn+SzCpMc5186?= =?us-ascii?Q?poMnSr67oWitxwk/98pCFiHr7sL7237dxMAVivwOD9/jg8k43qp2YlJjdjyH?= =?us-ascii?Q?QiswulHTdGVl8tJYWQ3GzuFnevURZ7JPwgOCp+uhd32nPDQevBY2PWJs7K78?= =?us-ascii?Q?O13RqjAltMiaYEf0UigQAIBadsLlm8ruXzzf5iosd2uiTTB/Iq0jB0mHwDO/?= =?us-ascii?Q?IdYlWFkU27Z//7Z0oR0ovy+IWk5NM6EhYwzQHA57EboatVwEa/q3jHLR7Gh5?= =?us-ascii?Q?anIsJvQtW8J7QMfM+VWiVqvLxzd40I48y6FI+kcBXvLjldhBkzGzzDxIOUjz?= =?us-ascii?Q?5G5FX8AQPerxZmnMq6ioZk2BmxE0VI7x6qClcBXecVLwzGZW+1u4atLQZiRH?= =?us-ascii?Q?+ebuMDuVak4PR8rMzFZGe66iASyj2G1+cv/W13ARdHos/zgTI3P8FtgTaIpP?= =?us-ascii?Q?6X10dQiVHJct3Xv8DOiCQpqp?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR1101MB2072.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dbda459-d84c-46ba-1913-08d97f2282e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2021 06:14:04.9739 (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: VH8KpPTU3Nj998X8E5U6zqq/DFsZlxrUgjtES4tw1XIvmff2Bl8ewmXBoxqDlvZ75KcuTYxqdo5XIUJq/T20IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1798 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You can only carry "Reviewed-by" when the person replied "Reviewed-by: ..."= . Reviewing the patch and providing comments don't mean you get the "Reviewed= -by". Reviewed-by: Ray Ni > -----Original Message----- > From: xueshengfeng > Sent: Friday, September 24, 2021 2:03 PM > To: devel@edk2.groups.io; Ni, Ray ; Wu, Hao A > Cc: Liang, PanlingX ; Xue, ShengfengX > Subject: [PATCH V4] MdeModulePkg/PciBusDxe: Improve the flow of testing s= upport attributes >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3635 >=20 > Currently, in order to test the supported attributes, > the PciTestSupportedAttribute() will set the command register > to 0x27 (EFI_PCI_COMMAND_IO_SPACE, EFI_PCI_COMMAND_MEMORY_SPACE, > EFI_PCI_COMMAND_BUS_MASTER, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) firstly, > and then read back to check whether these attributes are > set successfully in the device. > This will cause the other enabled bits > (other than EFI_PCI_COMMAND_IO_SPACE,EFI_PCI_COMMAND_MEMORY_SPACE, > EFI_PCI_COMMAND_BUS_MASTER,EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) > be cleared for a short of time > This patch fixes this issue by keeping the origina > enabled bits when setting 0x27. >=20 > Signed-off-by: xueshengfeng > Reviewed-by: Ray > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > index db1b35f8ef..3a238d4e46 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > @@ -933,6 +933,7 @@ PciTestSupportedAttribute ( > ) > { > EFI_TPL OldTpl; > + UINT16 CommandValue; >=20 > // > // Preserve the original value > @@ -943,10 +944,12 @@ PciTestSupportedAttribute ( > // Raise TPL to high level to disable timer interrupt while the BAR is= probed > // > OldTpl =3D gBS->RaiseTPL (TPL_HIGH_LEVEL); > + CommandValue =3D *Command | *OldCommand; >=20 > - PCI_SET_COMMAND_REGISTER (PciIoDevice, *Command); > - PCI_READ_COMMAND_REGISTER (PciIoDevice, Command); > + PCI_SET_COMMAND_REGISTER (PciIoDevice, CommandValue); > + PCI_READ_COMMAND_REGISTER (PciIoDevice, &CommandValue); >=20 > + *Command =3D *Command & CommandValue; > // > // Write back the original value > // > -- > 2.31.1.windows.1 >=20 >=20 >=20