From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.3103.1663738297577751709 for ; Tue, 20 Sep 2022 22:31:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Xqj9Q41X; spf=pass (domain: intel.com, ip: 192.55.52.43, 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=1663738297; x=1695274297; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M9amoEQj8BU3n+h5Y7K+S0KJxbx4TDHWFVZdE5i/1Rk=; b=Xqj9Q41XuMq6bgM2a1+iKybbcHJyDTFwa8e01yLK6+7btbvO66CtCiPG D1y/nd1LrSmX/zZW/aG7HVAodBjORy9P/ltpDHk1n50eaWGDMyofH9qd1 X+1tc+MoC/zjUBpaBr/aPyDRQPFju/p6V/W+wvLPHsJFmAIYAtF0WgT9h smMiM7gi/fGT/Ka3ETNdERx0RWE50BemxAKQSaDKhW0XcOyBuqSLudb4U SohAuZgEe8SmqXJx+0UDk0TfqQ9Un/6blPSMmMwbAxUbw57RSrtpSz5kh dsUf/ouRVAu/nNeRCEHqB7cYwR+KK23hbO6WSfB6RMnMALIauSrbHQMmd A==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="386189655" X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="386189655" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 22:31:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="570387352" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 20 Sep 2022 22:31:17 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2375.31; Tue, 20 Sep 2022 22:31:17 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2375.31; Tue, 20 Sep 2022 22:31:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2375.31 via Frontend Transport; Tue, 20 Sep 2022 22:31:17 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) 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.2375.31; Tue, 20 Sep 2022 22:31:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l1Lf8qZX9dX9Bk+22jY2t2NPdiGPdDozM3ZTxWFRbvk4quxwdwrZBAKCYIOYEQIkhG/RwWorl2CKCdSRAkQ7U38tPwWulDwHV72/ogoRro2GgbIjEc0P+uLWkFGn6oPL4a/LIDX+/I6ZRlSKWIy7ypa2BIqDtZ/gyXuFttGLwaqOZ/bfdxKck3qMRcnR1086IhGoR6BFNZqw54Hz+sUWu1EosgXXifEJ+LfcMqqvlS2K/nrUOMEDxdMOZyBHfmcrWTHCFmz2IHiEZg3T4oQDmPEcyRUKmyLBgHxoGNnMMgN9ZG/3QoNz4hFgww03xYYdShs50XxELI90t3TW5dg49Q== 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=WkIxJVoSdMzbZHDOn8frZj5bu1iyUbuM78nrvPg9D0w=; b=LLJIXP3A7EiUyxD441X+vGdgUqq0wdD0BcqeowKb4Nq04AkWVFjoQBvGhpEATloIyaOw+qRIsVmh3ptd9mmSgz62OMM5wbmIaETILqAvYgtdj+I+f5KQ0dfd+g0XY1cScrjGhTsdF6OMYUsilGIyPYMJRx6eUqw01RPJvu7l/Vst3GEOUH3k9/ga5zPr0N4NPOUEHDVd3/sRlK0saxxpfOe8artl9OXc9LTCLX2uNr7bb+EOU3j6KdqItMkthVDgUn5o5VAr3uQUBCdiBrs6oULQc4KR9/7JnA7ao5lBcv+3Lxg8b7DQb/YEMWLi8DvSrxAxHUEsTrUDKzeox0CnZg== 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 DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by CY8PR11MB7059.namprd11.prod.outlook.com (2603:10b6:930:51::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Wed, 21 Sep 2022 05:31:01 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::1167:1c79:220a:eece]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::1167:1c79:220a:eece%4]) with mapi id 15.20.5632.021; Wed, 21 Sep 2022 05:31:01 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the device on error Thread-Topic: [edk2-devel] [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the device on error Thread-Index: AQHYzPLvWbS8Qsb3WkKKqt3FPvDiWa3pWy2Q Date: Wed, 21 Sep 2022 05:31:01 +0000 Message-ID: References: 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|CY8PR11MB7059:EE_ x-ms-office365-filtering-correlation-id: e23c74cd-0662-4f35-51e4-08da9b927876 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: E40cScBJ3vspcWlAeParnJALL8yAgIcZ0sLuwTAPhp1LbUg0/SIY+lXXzAVuX5ba9zdMlSnTWpANk6cCs3mPl4xPiXApD1/dv72Z4iJnDI/lEE5457I4SKEfj+da9s3K9A44R+0M0tH7A5isv86blKzOmU07dauMskXyqBgBeqaCyCH4NN4B97GivjrYi76IucfrYDpwU327bOb79x8Lcu+UcauTkFlPDpj7G7DmXQLQfD7h7DtbnF09lFz+7MmChjffgQj+JwbHKbGqhhoxhTEESKD61GnNkcZQGdrL7WwNbZibZFr9GmmxhliAWPNe6JTZ8QfoLaF985/TN1sFQdpAgZOu2BVG044jLkbiGJtdq+MMwUQHb6jM5o/ouIvT/sEdR0He0g3B+3yQM3KjPxcveh2HxXtkTfvCRy1SEsKHQDrXMN0dTNBq2fldwNIjP1VHiYYkDqYtsg39CbWhIpZP0HaWQ2eoPONbYKCbVox1Qm/75qPa9DQZb93LpVaZaY5A91RTwgnmJhd7jLtFwB/eLUYRYev8Q/If15CozqsWCQMzoQLvOtbFafBplFdFhWPdzpHGsVWgru6XXamR31WXxVIdSN647EeugcwttZKLBclb6hd93AZQmPFgbwzw8F3OIo3S7LE3ZVZ75ih2YPs1GcshUNIBiuqSJNG0QH7l2nL9awA0T59xd7OZwycFEJDH6m5FcoOQMHqO7HudrqfODaX2/3u2yyI+1Wy3btjFvrLmE4DbFJxW4HmwUeOiAyN1iHH6swmQ/BaJBgR+aCyPT/wixjLcZ/a813dY0KIDP65dV5HWyATcDoFvw6Iu7yXeH4Dewtf75P6Vl4Kq6Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(376002)(366004)(39860400002)(396003)(136003)(451199015)(83380400001)(316002)(76116006)(33656002)(4326008)(38070700005)(64756008)(66446008)(66476007)(66556008)(86362001)(66946007)(2906002)(52536014)(8676002)(38100700002)(82960400001)(122000001)(966005)(71200400001)(478600001)(55016003)(9686003)(26005)(53546011)(186003)(5660300002)(110136005)(107886003)(41300700001)(8936002)(7696005)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iZl8nbZQzFb1TPGoyRqpqsKtCJR19sLPvEbRiIvk3IfI3mS5kMeGUTM6EbRq?= =?us-ascii?Q?qA/PKHaF5MLFgXsDUQp+guL5hbuuQIZLErgJKpP1PbmJSRayIRUKgv5632gn?= =?us-ascii?Q?cGqkvhBjup9hkqpyfVW4r/q1bvnjmS8hdio8nJdtTMwpLl2ao3woItkZHzvb?= =?us-ascii?Q?93Q9LmfFumz4eVFVOwWyAx1yJeZz/klaBJvpOsMMTHu8p56AS9Gxn7QusSyB?= =?us-ascii?Q?MeX8TA8SZLTcwZ2kR1vLWyf7+K/k1grPot3RAjRH5nNRDNyrtaD8AT/vwcNp?= =?us-ascii?Q?FZ3eJQKsVawXo0mIiTLUICNt5D4GFq8RmPB3dwoomJ4vv+Jd6ig1CFnZmhkL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XO842iaoDGwiVPEZluWgkf1kHa?= =?us-ascii?Q?Km912V+BY4AlzZSUlEC8hsSPFOtUhxyoOKr3DC5VQ90o5wgPETMJnuwBoAJr?= =?us-ascii?Q?p8KJszvkMe+MfWPEaqpPQKrKvo7L8JO8ZyzpuFfiZYZgtk/Pggf9YJoJrv/1?= =?us-ascii?Q?8DKulLOSFE3vLaJ9Iy9q1T3fUl5OvGhfgcb1wOvWw+McHyZN98x0NhD+8yKf?= =?us-ascii?Q?3phGk04bQH9wStZ4H9V3RG6o8j4MLGWwjo6RIxa+ztfkO0/rLhh0fb6HgsBp?= =?us-ascii?Q?PTLobq2r71nVCiOIbHXFu0Cfh2QWVv3kfuqpJipR4/DwtT/k9WJJg76a+gWg?= =?us-ascii?Q?ESzFVeyt1G2nqvlKE0xoLiEiGwwmsutH8SXXrJAO?= 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: e23c74cd-0662-4f35-51e4-08da9b927876 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 05:31:01.4897 (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: 4MWy1lAKqOSBCpXetDksYaY08FyZgOBEhxXqP4HNWkJPjTlbF89lTP9XKOfIvGXjpAM/hggYssLj1xsO2zySbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7059 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 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sean > Rhodes > Sent: Tuesday, September 20, 2022 9:14 PM > To: devel@edk2.groups.io > Cc: Rhodes, Sean ; Wu, Hao A > ; Ni, Ray > Subject: [edk2-devel] [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the > device on error >=20 > Try a port reset if GetPortStatus returns and error. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Sean Rhodes > --- > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > index 7fc567898a..13112be2a5 100644 > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > @@ -992,7 +992,9 @@ UsbEnumeratePort ( > // Now, new device connected, enumerate and configure the device >=20 > // >=20 > DEBUG ((DEBUG_INFO, "UsbEnumeratePort: new device connected at > port %d\n", Port)); >=20 > - if (USB_BIT_IS_SET (PortState.PortChangeStatus, > USB_PORT_STAT_C_RESET)) { >=20 > + if (USB_BIT_IS_SET (PortState.PortChangeStatus, > USB_PORT_STAT_C_RESET) && >=20 > + (Status !=3D EFI_DEVICE_ERROR)) Sorry, I do not understand the purpose of the patch. Looking into the current implementation of function UsbEnumeratePort(), if = the execution flow reaches here, the local variable 'Status' must have a va= lue of EFI_SUCCESS. My take is that this check: Status =3D HubApi->GetPortStatus (HubIf, Port, &PortState); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: failed to get state of port %d\= n", Port)); return Status; } will make the function return if the value of 'Status' does not equals to E= FI_SUCCESS. Did I miss something for the above understanding? Best Regards, Hao Wu >=20 > + { >=20 > Status =3D UsbEnumerateNewDev (HubIf, Port, FALSE); >=20 > } else { >=20 > Status =3D UsbEnumerateNewDev (HubIf, Port, TRUE); >=20 > -- > 2.34.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#93990): https://edk2.groups.io/g/devel/message/93990 > Mute This Topic: https://groups.io/mt/93802899/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