From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C0BADD8094F for ; Wed, 20 Sep 2023 08:19:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=l2/qGsTgQD4DIpet36Bxo/2Ibe1tRTj+yty1Q3wBHlU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695197995; v=1; b=vAVdcqTIIOaDAgzkWQ0+XT3qens0h4x/ihel/1M42MBPNjtbbMFdphoMZ0BFcx8YfquRQaPU EciO1BRuha4hLYJjspXIcoxB2VDa9I4Ve/4N3bNra1FLlkY1WcIoxOW806IPtld3Myx1HJbZNMP 7YlUUVgWR2uvbQzFyKw2ALl4= X-Received: by 127.0.0.2 with SMTP id Q0IpYY7687511xIH2JgpsFpv; Wed, 20 Sep 2023 01:19:55 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.32464.1695197994246360558 for ; Wed, 20 Sep 2023 01:19:54 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="380064767" X-IronPort-AV: E=Sophos;i="6.02,161,1688454000"; d="scan'208";a="380064767" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2023 01:19:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="836758193" X-IronPort-AV: E=Sophos;i="6.02,161,1688454000"; d="scan'208";a="836758193" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Sep 2023 01:19:48 -0700 X-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.2507.32; Wed, 20 Sep 2023 01:19:48 -0700 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.2507.32; Wed, 20 Sep 2023 01:19:47 -0700 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Wed, 20 Sep 2023 01:19:47 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 20 Sep 2023 01:19:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJMdSDd/eYkmLWPmBHVdYznFIHOyZxG51VqsxFjNOcj4Wp8hJfMRdmctoPP9RF7Qi9Ox/qrBX9fK5LUoSkULhQiRRvE58or2kN1Nxmp7ZaPMUnvsK2kuWqlrc3cnX6pfEqIGh3PC3TMIU7GSnNoX3xZClUkmuEM3VZz1jGG3NJN8WHkbavqVQK4diibyt37V9Uhlpo3Dy0d19/UWWowFsrRUvtD+XkhhTkHNATPirWYOEBjyau1qJzsqnaCtnwWMkEX2QlmSVqF+60bwI9K6nTNej6YDabo8pEVblgg/iFdOex0KX/bQCkBdWWO3iL1h9KjE9wOzUc9pfIOH2BYaww== 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=QWwz/tgcJp5tOYbYh0t2h25PBWki8ZRCfKsNy13AEVs=; b=e80AhZqs4jtC1QdV4vA/5/ODmDZFtPKFv/N0j4/I89K1PQXQXiRjPBeBi/50I4MbMBzSaKuqukSQN1kPyImQXjLcMrc180FOB+kD1zqsiJMhXe6LlZeXKWJXkqUrIAXfD2SUTHWlLKMrpsSbKArSOtM93LfLKAyI1cGqX8otqsDr5716DtfGaUxC9o24lQeAJ/MeQrAkFlJadUOdPg5mOWUZIF09NIyDnNOFWwTVnGHUXrtDZBnkxC0ujPPv2WZYxoh//5CwU1WjKsbk4uF0SMLhifnFJectNFCS4oAee4/Ez/IhLBQrf3vyD6MLDWiWvn/JStUK3udjm4CY8xMoMQ== 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 X-Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Wed, 20 Sep 2023 08:19:39 +0000 X-Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::38c3:ed7c:3562:2e18]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::38c3:ed7c:3562:2e18%4]) with mapi id 15.20.6792.026; Wed, 20 Sep 2023 08:19:39 +0000 From: "Wu, Hao A" To: "Cai, Xianglei" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Wang, Jian J" , "Gao, Liming" , "Shih, More" Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg\XhciDxe: Command Abort when times out Thread-Topic: [PATCH 1/1] MdeModulePkg\XhciDxe: Command Abort when times out Thread-Index: AQHZ6f1eIKgrxnB9kEaRoGbOy2c2wbAjW+4g Date: Wed, 20 Sep 2023 08:19:39 +0000 Message-ID: References: <91ce12999b52f08034b6cc58ad642dd526cf6c4b.1695020158.git.xianglei.cai@intel.com> In-Reply-To: <91ce12999b52f08034b6cc58ad642dd526cf6c4b.1695020158.git.xianglei.cai@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|PH8PR11MB8107:EE_ x-ms-office365-filtering-correlation-id: bdc212ed-002b-49e5-e9de-08dbb9b2558f x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2R0nr5mzEhAGIXsfsS7VZyUA68kgE6O2bPcEKzHEsFE1ZCKii8DX2O2mZDpIUo7PdefNgjjdEn+b56UKk8q9IFeco+poa8IKOERkYjODOf4nWX+eyj5W/OVwd4bV4gjil/HcQ1VkyvVN1Be4u/BCPkdaISlSmzT1wcRIn7pDXXbANKHgdNId3rWqOlvMELdMo92M07XnIA1+g/W9mXahKyNoCvfT2Y3ZKm6mOfzBK7PEFqyuUHuNNd5Iwiyzq55AaT9SJNAIIYap1hwqKDfq5bMW83cl/+t/A+rhUCOs9dST1DcZ0qOJM4ZJbhzQng67rAELzNUADKHxSzUWiNtz0BXY3+fqTaCXOT286nAye3CugIfnYfqWalouh+hPNyppc8fLEBrnJ6DhXf+5p7D1ifwTpDU+uw1s0giPz530f2m8mLkUiIOKzhKU/EspVyOvjdiaM8jaChGCJ4kCn2fu/zChNDDGZkRper1q1V3vr85MLtrtP2B6rJ6L99AB9gHwcB0291MH7TXVIOlImBQgY3o6+L5lvcHiThCI58VRZfB2GosAxWd4aUAXLT1Pk+xobyKrBCAntOATbxnC3BrM6wKkyt17gYzHlLNPipmtSACctl4xNZ7hdaIyDel2biN2tYLz/nl9VF/j8Pbhs3NXKA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t6DHN4/MgUrd65BVIvFSlSrTQQ4pIbbfm+p47BwisBn2+S+5VPZATwqZkYBu?= =?us-ascii?Q?BKSjXslw2poR1OVeBrfzxQ3Ft7MN5LBr2eHyXBxYdMINCndrp2tv2FGPoUde?= =?us-ascii?Q?HJqQZ6f4rvAt9LcTmdKgqK2Z1PupXl9DXd0k3S3YY+WAk47O5o684YE/iBuY?= =?us-ascii?Q?INv0mtkD23zPvt055bjJcgGhjXC6WJkroOze5xfOcd8rzn4MQFJcGF3DzbDh?= =?us-ascii?Q?zlSV6pdUQAHphw2/SaP86bF1CTey6raGAU5L2JFZ06FR95Y4EBOoxpAx+SdJ?= =?us-ascii?Q?u4wwqP082o94I9RLE/EuWn1IfL0QZ13+Nt44jDDtt/1ApOAQEmCzizTwMT6i?= =?us-ascii?Q?/Wq0G/IIJGK0eRNrNOqRlNhHz2jQZNPH1+EZRAAqAtuvYXzXRl48sq5MU2FM?= =?us-ascii?Q?7lUVnHU/1NsFBLaQYsX8zm3EdLzFgVIB0P+MHZPM5uhroYP4n05dOFflmFnk?= =?us-ascii?Q?rKt+jFz5aycwQpf4YQRpEF48Ir/WeT964tfxle4OXJEHZivm6++zAqTJVRqj?= =?us-ascii?Q?ZXfWmKhfQ44QSE732awI5l8rJ6bgwLAZP0qdmeg/WDWeE8VwWez3egpKWblB?= =?us-ascii?Q?u+0ADNggCliOpLNvSg5sPAs6/wB1gfsrPlNs2zLs1PFCPYauneOSeXOSFFzG?= =?us-ascii?Q?0jmXGf+m4un26ZJBN8PpwqBJiUSKhFHEBD+O660S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?Q?=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdc212ed-002b-49e5-e9de-08dbb9b2558f X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2023 08:19:39.3290 (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: eBMK6XvPKtEiaaPiiOTWnXrrOjjEZSD45UeFvwNl7A68G2QXJ/Hndg+tFntrGeOKEcMkPSTqUdaAoPwD75sdkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB8107 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,hao.a.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pC5aUuXoG7cHCNo5kAsl4jspx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=vAVdcqTI; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") General level comments: 1. Some CI tests failed for the proposed patch: https://github.com/tianocor= e/edk2/pull/4844. Could you help to resolve them? Please help to follow the step 11 in page: https://github.com/tianocore/tia= nocore.github.io/wiki/EDK-II-Development-Process and check the CI test resu= lts for the upcoming patch? 2. Could you help to update the title of this commit to "MdeModulePkg/XhciD= xe: Abort the Address Device cmd when time out" to better reflect the purpo= se of the change? 3. Could you help to add a brief description as the commit log message? Serveral inline comments below: > -----Original Message----- > From: Cai, Xianglei > Sent: Monday, September 18, 2023 2:57 PM > To: devel@edk2.groups.io > Cc: Cai, Xianglei ; Wu, Hao A ; > Ni, Ray ; Wang, Jian J ; Gao, > Liming ; Shih, More > Subject: [PATCH 1/1] MdeModulePkg\XhciDxe: Command Abort when times > out >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4552 >=20 > CC: Hao A Wu > CC: Ray Ni > CC: Jian J Wang > CC: Liming Gao > CC: More Shih > Signed-off-by: Xianglei Cai > --- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 35 > ++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > index 53421e64a850..5024d5e3acb9 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > @@ -2121,6 +2121,29 @@ RingIntTransferDoorBell ( > return EFI_SUCCESS; > } >=20 > +/** > + Set Command abort > + > + @param Xhc The XHCI Instance. > + @param SlotId The slot id to be disabled. > + > + @retval EFI_SUCCESS Successfully disable the device slot. This function does not return value. Please help to update the above functi= on description. > + > +**/ > +VOID > +XhcCmdRingCmdAbort ( > + IN USB_XHCI_INSTANCE *Xhc, > + IN UINT8 SlotId > + ) > +{ > + // > + // Some 3rd party XHCI external cards don't support single 64-bytes > +width register access, > + // So divide it to two 32-bytes width register access. > + // The above comments does not apply here. Please help to remove it. > + DEBUG ((DEBUG_INFO, "Command Ring Control set Command Abort, > SlotId: > +%d!\n", SlotId)); > + XhcSetOpRegBit (Xhc, XHC_CRCR_OFFSET, XHC_CRCR_CA); } Sorry for a question, do we need to wait the CRR bit of the CRCR register t= o become 0 to ensure the command ring is stopped? > + > /** > Assign and initialize the device slot for a new device. >=20 > @@ -2331,6 +2354,12 @@ XhcInitializeDeviceSlot ( > Xhc->UsbDevContext[SlotId].XhciDevAddr =3D DeviceAddress; > } else { > DEBUG ((DEBUG_ERROR, " Slot %d address not assigned successfully. > Status =3D %r\n", SlotId, Status)); > + // > + // Software need abort the command if a command times out in xHCI sp= ec > 4.6. > + // Suggest to update "xHCI spec 4.6" to "xHCI spec Revision 1.2, section 4.6.1= .2" Best Regards, Hao Wu > + if (Status =3D=3D EFI_TIMEOUT) { > + XhcCmdRingCmdAbort (Xhc, SlotId); > + } > XhcDisableSlotCmd (Xhc, SlotId); > } >=20 > @@ -2547,6 +2576,12 @@ XhcInitializeDeviceSlot64 ( > Xhc->UsbDevContext[SlotId].XhciDevAddr =3D DeviceAddress; > } else { > DEBUG ((DEBUG_ERROR, " Slot %d address not assigned successfully. > Status =3D %r\n", SlotId, Status)); > + // > + // Software need abort the command if a command times out in xHCI sp= ec > 4.6. > + // > + if (Status =3D=3D EFI_TIMEOUT) { > + XhcCmdRingCmdAbort (Xhc, SlotId); > + } > XhcDisableSlotCmd64 (Xhc, SlotId); > } >=20 > -- > 2.42.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108900): https://edk2.groups.io/g/devel/message/108900 Mute This Topic: https://groups.io/mt/101435621/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-