From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.121047.1671063975043218478 for ; Wed, 14 Dec 2022 16:26:15 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ZuH6DBsq; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671063975; x=1702599975; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XGM8eRq2BA9IJ2fCwEg/E2ve/PbDm3HFLZepJXn/lXs=; b=ZuH6DBsqaQKDiuVUu7iwahPLIWs3oDm9LIOvmx72G/Kuvn31+FIepX1N tTiNOiDqP59PoUg94NHIUjpcoyHKqU+zZaIK1K4j/4eBCR6VurWer6Fze KCTE/jrIj+7GGsY17R7YqgRWfS8dZmTkaiUEysbXuPpSLStICDVbZKo9q ich3RaVT4uGfWABK11u2EjL8EZVzZhpsPjNfkd0/vQ0bgdMpRRzTGPJVl oQGSNbpMKHkNbBZdo2jfE5l7Ixm5Xz+rzH3oTq0O83QFPWWC2NhDTwkoO Fn+sLfGy4ZBRCoDxoWhuc16yuPaGy7fSPA3hgLl7IqkINs29wkznGYVkz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="316184632" X-IronPort-AV: E=Sophos;i="5.96,245,1665471600"; d="scan'208";a="316184632" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 16:26:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="599377057" X-IronPort-AV: E=Sophos;i="5.96,245,1665471600"; d="scan'208";a="599377057" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 14 Dec 2022 16:26:12 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 14 Dec 2022 16:26:11 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 14 Dec 2022 16:26:11 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 14 Dec 2022 16:26:11 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 14 Dec 2022 16:26:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FO68AJNyIjmI2EmL39uWy2w/GbWjrxlfFlOOBhqP0h+/mld5OJQEKbcbDLvZ2LMGSJlmRnEeUoMS5lmrR8rc4jO1aMX7bUMmGcWllYayVN9apCHFBHuh2eBudKRb1N+ewyCnsBzsQTAEjQTOhKRbmhFTNb/rplCfPl6x8JirO2LXzVZPy5MPwX1ddh8xTwqhXsvwxehMl1gP8AWk1yu9xlUw5YbwmZBG1+vQKAaWvUuYbXcY+A2ocAIlE1BLlRlUVBdE8vmKUxreYSkyIpzCxpqKDPBNO4TIL/7K/TPba84BS674f57sPEKGtzhcI+Su91pEgFRYLb0o5vxuR5HC/A== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LNhjaSA79Cprdu/I7fw4utIDjk8NQUpaBUz7Yvz9YB4=; b=iXOVFKgswSbaOOPkwz7xzFnpVZZBcocReeeOXFhASxj5+u/XRwGevGtDsNVD+0E7E9BwbRT9txuzH+TcxMhf/HbwRzP0i2MLTTznbty2SPWHAZqYRFcxoCm21Q2CdSDVBgZSQ+/RNeswIohidrVNnpcB9A4g5Nc14CdgfWhvJNmA9X72GPbqNZnuV2kqmB17OMuoZJAuImTNC12V3/cRdJ6imTcuyy3N4/tukHUHY99mJ5B/uJd6wuEpYNwzbGi9lDR929v+nHRQqx7ZFRQwAFJjiyLsx97E1fi2sUDOemK6B0eXd8OmVMuwLrQoft2gkBQLfB4Njh483C+zfY5O7A== 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 Received: from MN2PR11MB4031.namprd11.prod.outlook.com (2603:10b6:208:150::18) by MN2PR11MB4712.namprd11.prod.outlook.com (2603:10b6:208:264::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Thu, 15 Dec 2022 00:26:06 +0000 Received: from MN2PR11MB4031.namprd11.prod.outlook.com ([fe80::6c89:9cdb:3201:97ce]) by MN2PR11MB4031.namprd11.prod.outlook.com ([fe80::6c89:9cdb:3201:97ce%5]) with mapi id 15.20.5880.019; Thu, 15 Dec 2022 00:26:06 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: "Chiu, Ian" Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Handle incorrect PSIV indices Thread-Topic: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Handle incorrect PSIV indices Thread-Index: AQHZDA9Pja34UYSAkEq6gm5Wsboa5q5phmIg Date: Thu, 15 Dec 2022 00:26:06 +0000 Message-ID: References: <6c69b4c50a198bf4348066fbc8156b07520d6b77.1670618740.git.sean@starlabs.systems> In-Reply-To: <6c69b4c50a198bf4348066fbc8156b07520d6b77.1670618740.git.sean@starlabs.systems> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR11MB4031:EE_|MN2PR11MB4712:EE_ x-ms-office365-filtering-correlation-id: 60b64997-9f69-42b9-0dba-08dade32f4ae x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lyBKLiAbkhLzYLD20Ne6OD3YCsbcJhvQZkr2vVv1LNZOHPN8bC0JITF7j4NlQxFaeUR1RsOcPIhiFi/M2Sm++I95xsXRcn54H2MduOo+QIr6Kife1cfwzxPi4dIzF1P5VG8k8TB6Uht+gytfrpIqEMBmSeGBzCWS6BFxfRdvQgQ+gy8S32fkdORvP42Mo9doUTR4u488tse2Bm8md/p7/V73pVrS5QBocTJh9PkzTxt/XW28GZ864YYUWM2z0QDKykLtXCvb/fuoXxFCBNqCDsT42quXvuH3A58tuervjmEjT/7s8yjSf3AKKonicNBAJ6HBH4JsXi5svCkDsN0WIlX6VDg23NDw5KpfkqQYhzqasIMxLGbgbJPZb5l/ktxO6gUyuszKMiAx+6/7GGGjYBeqTS1LAYk0M6p1GY1g4Kn2q+MAUjDKFci8Mix2KTbOj2a1X1qp6ki7HSt5szcIpoRUSg5trJNy3Pf0zA9iY0F+E9eLf01KSKkPaDwu72le8Y8++xaTe1sZehEXheGwlZ7egdOiuuI3Zy3DryL9NBwRxjb02kxDXss7XQWNin8q9htK3Gd98U9e1GPD5HUQIGAnea2RtbsLk1lrxRUI8y+9Fj5BG5bp2oim0RogAWcTerq4ACvRk7c2hoTkLhUnLbfeVUyrD/QrR/G0rl5MG4ZMXy6XlDGB+n5iAmSII1G5fPpB0Bg6pL2H/eywu4k4nSvLGARQ+JigSaXT5fr3afgGFv9EBaw+CsoHhK2+0fXPv9FDy8cyWX+L2G9rN2MnbA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR11MB4031.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199015)(71200400001)(55016003)(33656002)(41300700001)(64756008)(86362001)(76116006)(66556008)(66446008)(66946007)(9686003)(8676002)(26005)(186003)(52536014)(66476007)(4326008)(478600001)(966005)(53546011)(110136005)(6506007)(7696005)(316002)(107886003)(122000001)(38100700002)(38070700005)(82960400001)(5660300002)(2906002)(83380400001)(8936002)(66899015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jSlURLqBJ8VaBKtOBLGkseCL4lSB0+m8O9AtiN0iOTYDyMK/75wlP9eK57ri?= =?us-ascii?Q?kJdVw8btDt4PvaL1kS8OJbLgfiahIRuzMcKm4/CQM+YggC9cRDlFThjUm+rO?= =?us-ascii?Q?pqxLAqe2pvYOTLj1qjWqzvB8OuUm44d2fe9bq8yg/seZQ7jjSlA2hArSRZZn?= =?us-ascii?Q?XOErPmcwOoDOJpulHEE+zBNvR+OqTkennnyziNeZ1JVpez5Qx1izUMGq1kPt?= =?us-ascii?Q?jbglC0Ki8mmg18NrmIj7NSqEvW+M9gj0/dzd+pJn/kVfJUm8EclK6FGzIOtG?= =?us-ascii?Q?0khwxEEUmxptADM3hgQsETSYzl3luRYNlR7cUzw/qyP7lY16XqZUaIXyVpBK?= =?us-ascii?Q?V+4v7mlA1pByfC+InECan6aKfLaHjCofuFECfjCXWOHZpy+YvyzRKTDNNz9C?= =?us-ascii?Q?UgBn9Nw33Z88pnxKpdx8lCmZlGYrkwa1G+JGPfAq1U092FW7cMMyEdjY0EJe?= =?us-ascii?Q?hsn46RjkAuDNCtz/5YkOEq9xzjrvP4frGxBN8lguiLwlIwzHCN1LT3f8y2xq?= =?us-ascii?Q?VQb20p3jEYoOzyTus7XskONXbselyhYlawgZ7maIZWb0Ykg3lNly6yiV4c2R?= =?us-ascii?Q?kG+lT2RGDUXC6IYwWs7HBDn+UJPGdTqbLgxUspuX/4s9HpuipaMWXg6nbe1k?= =?us-ascii?Q?0AA2LZ7TFojYTEad+YpjXDK25BOvpHru5fhKk0oCF5Cw40u91YuHz9UrMKZJ?= =?us-ascii?Q?o8Bp1RLEbdeaJdptVCYwniZGCfg3uG/CLLdpyPA26ddWExpqs+YQFeymDE3k?= =?us-ascii?Q?Y5kmPOdpGi5Qlj24Ep87QK9y8z3B2WJKp3FVBM1vj/DDr3Vf76Wg0msgl/pR?= =?us-ascii?Q?mDbsZgAk/dUXLZ7EdQoYAscLN8T+5P+KQrxGA1FvtrQ3DA5DPscCnHM4cy4s?= =?us-ascii?Q?OYVa2NvLwhk40hkq35HXrRYoFDuU5YmxxF/8RapGOfwbJorreTv8HNVQeQ8g?= =?us-ascii?Q?wA02CzkmphVnhG8Zjfc641XuL71OECyLD7AG+e5jiyPRYjtKf47TYv0n6duS?= =?us-ascii?Q?YVy8xYinfTHoKk66gRJDLKtpnV2enP6KI2CTMb9NAqkHmyrS+Og3/UMGMrff?= =?us-ascii?Q?xEJs0AQUKgfkVAJjUFO8mGKNBTo1eH4ccqOHTjfj01x9UyqbsN80Skt6K1N0?= =?us-ascii?Q?JtbJNmt4AO9WomqJFdtvj/OV01g84SlouTlkaTjiWKiKxMvbpmyZRV277bqG?= =?us-ascii?Q?LG7/wUS5gYn/G1sn3Qbkdn6963Dq/RNf6h+lea2DGYZv3hEyPB/uzYNQ2ieB?= =?us-ascii?Q?1CdKXFbvUgUk8scfbmMWCr3Cp6ybrMGQ/8oG1sgdaKvuuiUuwyubbRwE9mQE?= =?us-ascii?Q?d18Nj3T9Jrrg/NQTdE7HUSoSXRh0lh4HtQEfcEvqReMssWbNOic1RuVpZOgQ?= =?us-ascii?Q?SltVBtF6bMbrKasuIE1X5Itif6JoU1XTb83n5U97JfnAL8fprIQoqvp2T8pE?= =?us-ascii?Q?gVVWxDecsKgxHDnv4pvgI7yDuqFfQcQi2qt9R7B6YkKsqD2DtRY+MC9GEKDt?= =?us-ascii?Q?3iaWCc8dlsEeZ184JF4gKiZ7wix0jzIgqPG8bGs39QB1p2HAob64MiKMp1u7?= =?us-ascii?Q?xrVMQ3+5LnXLV3I9e1FVzDfVpwP5w/TQkP/8Vkn/?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB4031.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60b64997-9f69-42b9-0dba-08dade32f4ae X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2022 00:26:06.0656 (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: lBm+xFekElgbu4mI6kro9S6i8/ntyPuk2xUNXm5tUTRwY3SF9XowK7h2gXbY2dYa7YXNdKUSBUwoMBHF7IxgjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4712 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, Could you help to: 1. Update the function description comment for XhcCheckUsbPortSpeedUsedPsic= () in .C/.H files for adding the new input parameter 'PortNumber' 2. Add additional checks in XhciPsivGetPsid() to not allow: * PortId.Data.CompPortOffset having a value of 0 * PortId.Data.CompPortCount having a value of 0 Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sean > Rhodes > Sent: Saturday, December 10, 2022 4:46 AM > To: devel@edk2.groups.io > Cc: Rhodes, Sean > Subject: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Handle > incorrect PSIV indices >=20 > On some platforms, including Sky Lake and Kaby Lake, the PSIV (Protocol > Speed ID Value) indices are shared between Protocol Speed ID DWORD' in > the extended capabilities registers for both USB2 (Full Speed) and USB3 > (Super Speed). >=20 > An example can be found below: >=20 > XhcCheckUsbPortSpeedUsedPsic: checking for USB2 ext caps > XhciPsivGetPsid: found 3 PSID entries > XhciPsivGetPsid: looking for port speed 1 > XhciPsivGetPsid: PSIV 1 PSIE 2 PLT 0 PSIM 12 > XhciPsivGetPsid: PSIV 2 PSIE 1 PLT 0 PSIM 1500 > XhciPsivGetPsid: PSIV 3 PSIE 2 PLT 0 PSIM 480 > XhcCheckUsbPortSpeedUsedPsic: checking for USB3 ext caps > XhciPsivGetPsid: found 3 PSID entries > XhciPsivGetPsid: looking for port speed 1 > XhciPsivGetPsid: PSIV 1 PSIE 3 PLT 0 PSIM 5 > XhciPsivGetPsid: PSIV 2 PSIE 3 PLT 0 PSIM 10 > XhciPsivGetPsid: PSIV 34 PSIE 2 PLT 0 PSIM 1248 >=20 > The result is edk2 detecting USB2 devices as USB3 devices, which > consequently causes enumeration to fail. >=20 > To avoid incorrect detection, check the Compatible Port Offset to find > the starting Port of Root Hubs that support the protocol. >=20 > Signed-off-by: Sean Rhodes > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +- > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 26 > ++++++++++++++++++++++---- > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h | 3 ++- > 3 files changed, 25 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index 8dd7a8fbb7..461b2cd9b5 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -405,7 +405,7 @@ XhcGetRootHubPortStatus ( > // Section 7.2 xHCI Support Protocol Capability >=20 > // >=20 > if (PortSpeed > 0) { >=20 > - PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > PortSpeed); >=20 > + PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > PortSpeed, PortNumber); >=20 > // If no match found in ext cap reg, fall back to PORTSC >=20 > if (PortStatus->PortStatus =3D=3D 0) { >=20 > // >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > index 2b4a4b2444..bca53e9ac0 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > @@ -636,6 +636,7 @@ XhcGetSupportedProtocolCapabilityAddr ( > @param Xhc The XHCI Instance. >=20 > @param ExtCapOffset The USB Major Version in xHCI Support Protocol > Capability Field >=20 > @param PortSpeed The Port Speed Field in USB PortSc register >=20 > + @param PortNumber The Port Number (0-indexed) >=20 >=20 >=20 > @return The Protocol Speed ID (PSI) from xHCI Supported Protocol > capability register. >=20 >=20 >=20 > @@ -644,12 +645,15 @@ UINT32 > XhciPsivGetPsid ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > IN UINT32 ExtCapOffset, >=20 > - IN UINT8 PortSpeed >=20 > + IN UINT8 PortSpeed, >=20 > + IN UINT8 PortNumber >=20 > ) >=20 > { >=20 > XHC_SUPPORTED_PROTOCOL_DW2 PortId; >=20 > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID Reg; >=20 > UINT32 Count; >=20 > + UINT32 MinPortIndex; >=20 > + UINT32 MaxPortIndex; >=20 >=20 >=20 > if ((Xhc =3D=3D NULL) || (ExtCapOffset =3D=3D 0xFFFFFFFF)) { >=20 > return 0; >=20 > @@ -663,6 +667,19 @@ XhciPsivGetPsid ( > // >=20 > PortId.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > XHC_SUPPORTED_PROTOCOL_DW2_OFFSET); >=20 >=20 >=20 > + // >=20 > + // According to XHCI 1.1 spec November 2017, valid values >=20 > + // for CompPortOffset are 1 to CompPortCount - 1. >=20 > + // >=20 > + // PortNumber is zero-indexed, so subtract 1. >=20 > + // >=20 > + MinPortIndex =3D PortId.Data.CompPortOffset - 1; >=20 > + MaxPortIndex =3D MinPortIndex + PortId.Data.CompPortCount - 1; >=20 > + >=20 > + if ((PortNumber < MinPortIndex) || (PortNumber > MaxPortIndex)) { >=20 > + return 0; >=20 > + } >=20 > + >=20 > for (Count =3D 0; Count < PortId.Data.Psic; Count++) { >=20 > Reg.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > XHC_SUPPORTED_PROTOCOL_PSI_OFFSET + (Count << 2)); >=20 > if (Reg.Data.Psiv =3D=3D PortSpeed) { >=20 > @@ -685,7 +702,8 @@ XhciPsivGetPsid ( > UINT16 >=20 > XhcCheckUsbPortSpeedUsedPsic ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > - IN UINT8 PortSpeed >=20 > + IN UINT8 PortSpeed, >=20 > + IN UINT8 PortNumber >=20 > ) >=20 > { >=20 > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID SpField; >=20 > @@ -703,7 +721,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > // PortSpeed definition when the Major Revision is 03h. >=20 > // >=20 > if (Xhc->Usb3SupOffset !=3D 0xFFFFFFFF) { >=20 > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpee= d); >=20 > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpee= d, > PortNumber); >=20 > if (SpField.Dword !=3D 0) { >=20 > // >=20 > // Found the corresponding PORTSC value in PSIV field of USB3 offs= et. >=20 > @@ -717,7 +735,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > // PortSpeed definition when the Major Revision is 02h. >=20 > // >=20 > if ((UsbSpeedIdMap =3D=3D 0) && (Xhc->Usb2SupOffset !=3D 0xFFFFFFFF)) = { >=20 > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpee= d); >=20 > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpee= d, > PortNumber); >=20 > if (SpField.Dword !=3D 0) { >=20 > // >=20 > // Found the corresponding PORTSC value in PSIV field of USB2 offs= et. >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > index 5fe2ba4f0e..5fd5485a5e 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > @@ -632,7 +632,8 @@ XhcGetSupportedProtocolCapabilityAddr ( > UINT16 >=20 > XhcCheckUsbPortSpeedUsedPsic ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > - IN UINT8 Speed >=20 > + IN UINT8 Speed, >=20 > + IN UINT8 PortNumber >=20 > ); >=20 >=20 >=20 > #endif >=20 > -- > 2.37.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#97210): https://edk2.groups.io/g/devel/message/97210 > Mute This Topic: https://groups.io/mt/95569299/1768737 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20