From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.3102.1663738276887363481 for ; Tue, 20 Sep 2022 22:31:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=TgqgHIGv; spf=pass (domain: intel.com, ip: 192.55.52.151, 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=1663738276; x=1695274276; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=X48KQgy8p57E7jyFJIg29hSqOjCLNWKq/gypOjcCY8c=; b=TgqgHIGvLa1wivUXmEQOLrjvdc7D+C8vaxfgAj+/Vi/f5CcjMTY4OtwJ q2CjyPOMvrrxF0hsoDWTfHlvVEgj1LDRALBhTtK+WLFmVDWEuDdxz0cmx Z9aMsvQWjgtYc5MDLKufpF/OTix/M7Yhz3zgHOnNTX3e8nQBhgcLJF68c bBCOJYQdpMVMYeh2snFHnMR1KRdaLH2bXi+9Xgqtde8zkJV1SchIHhrER m8+geiAldsAXaNDuX1U+o32x82HbCxaI+IoYhR4/wRpabfeBi/oPgfaMj Ht8Q8zTQPEWf6JxBdaMjVRcsu+JnQJm84vDuXLvllRfclIKH5K9YIiaLF g==; X-IronPort-AV: E=McAfee;i="6500,9779,10476"; a="280278562" X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="280278562" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 22:31:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="681620207" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 20 Sep 2022 22:31:16 -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.2375.31; Tue, 20 Sep 2022 22:31:15 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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:15 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) 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:15 -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:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yhhw2wJ/0uP/BgobMezU4iHTMwACR+mBs8IXD7X5iV/Rm5yIrrblGlVLD4Kylg+p3Dl/OE44fn3/8LwX74eJKPbKNscAmm0F0spMfW5AlZsLWkySbnb1uSk8iwCFbEqeKEGfv9nrG+kk74TX8O6MawmQPgSp8SyY9vN0LRodeCClzWhc0v9Xxfwvzfa2+Oxt1JMOF2ryZF179Mt59OrXfoKjZWFe4qiFNAmLcDoHgnEnGV3IUPo7NFH61dZa58LItmMeICxMb+TnrYQc78/TRl9aQR6oKMvoiI6DMk9PvRdfZrjsRRytWc1FM0TYy2KRzPEsKYD/0+MW8xoqyTmVbQ== 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=oFB5v4RPWLWh4cMlwsoVVHZgDiycyEe1mmhUagFih0o=; b=LdvDhH0dYhK+xnqRUFiANiqnm/QO1XaGFCBgi7ZH/eZeZK4TCiwQajq4x8qHX6LJLMFISXQ1HJIMtSSMbbEI06XCXh+2hQ/bxfuranZ4+Id7lBssLjOOBQMTKO4KCAca+M9ttLWVmOhZQkzZo3bpYDkF0KXhSYms7znRASuqMchZlvqR8o76gJyqER6L0eOQoeNNYoIokiwT/FH6ItwNUVPMybwOuTGsCUi1iVN9mfgZMojjiSSNSl8pPsaw0GGF3L7Px+ryBKIJMzjXVUepsf7TqG/xIvuC51EoBGsgDCz3/ul1blhkcSySMRi+GT9xKGg2okfd54I4I7qXqATaxQ== 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:30:56 +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:30:56 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Rhodes, Sean" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path Thread-Topic: [edk2-devel] [PATCH 1/2] MdeModulePkg/UsbBusDxe: Avoid continuing on error path Thread-Index: AQHYzPLtPmLuKCUo9EOz+z/dMUdhoK3pVejQ Date: Wed, 21 Sep 2022 05:30:56 +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: 0e4b961b-6044-492b-81a0-08da9b92758e 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: HdoIqmrimHX0ZTrd5cIw4o2KtS3yOA5+YJOvyR9rPavF/rOkIC+HWhkHp6Axb+bkdjnLukPAo6TOoPwXzuJFVMDKFaWpJF8GEJCjELZFZgHD5IMh3jBM99HsGnzU/8kv4egCTQsuqm14o/U7ilIFMj+Hh4jlx/uiyZUfLfcd35MDw/TUZ7PI6qbq0pwGheDZGiljpUNI2ywIU5dpqsyZwhF9V5PIYATobgq0ztsQxINXzs3voZNaDv+btW9yf9CcBFMQB2t1t2T1ZGmD6SG/mwqrq9rsd9tPmFgAyUb3t0gBrj7tfgjvaltXpzyHYtzPVx4py0TqSrM/LIodqPgFYCX2VIUOMkGlRiwdH/GePwShAMx4Ywy8lM8l23RQyi7IQVdsasQUj8EwFIVHmyMDdGJdFOrGzpkV5rGoDbGwuLETZVwG+QTPu3du5nw9CHbJNioyyssIWnM12xsNspyMJvRPq61UEg/qKnwPVEzPfio1FrOu1/oOAiynChE9lnK34G5iJSTqsTJ2WYBYNUlWekyw2s0DLVoVLE2EHMMJcXsGX7kH/9+Jg/OclUi+Q8p5LIsJFq4cGD07NezK1rYvJ+Mg9UcNEquD4PXB4xIP9vzVwxOV4cCxWD/ZXPlW8azyZaVUcV2rKpiwlGzVgiP59v0s2pnn1w4EEJEikvY9e3buVyoD3zxRciCYMQHqgLge1I3XLKNOiPPk9URSbQ9LYNkz5c3yrzz/mcdfJlBQl7bXLHv9nkbTyJfdd8R/n+iN6u0qDJn+nqgjoPSNd8QWW2DacWNtrITwO09CJbanuxYDQ/4sYHceziDhrmvnYPc9Z6Gj7AnXL7CQlKinSiKOjQ== 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?4dJZq8C8jbfDfQJF5+eYz+vbm5gdPlqfwp1M27UGIeRMpEgAl0OhHU6jZB/C?= =?us-ascii?Q?I4KflBps2J4T8wyImGE6UM8Yh5Vd3j8/RHu06DVRyGnVCbC/A9xCjzZmHKYE?= =?us-ascii?Q?aOfpDcYCOF3BsQWkv96KuS3LjDQZ1BBF3wf8QwvK3xVgwU4mnPgXPX9HOotx?= =?us-ascii?Q?7+NiD0NfBcdTDiEac3T3EC1j8+cx8QwoNa98TnJnmFLY9DmvvqHLErArrC6W?= =?us-ascii?Q?YIqcInlk1Qsa1nM6qRItRyFUajk1MrfbN3F+vIQwyMNHkB8QDTezfDqqigRS?= =?us-ascii?Q?h+StHARd1Y3CTY0Fe1MPzFXLwa9J+rAAPtN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7svSOoFQy9sgdNFnewaztqTHqv84+mFQTfvzsWfEIRhUrb?= =?us-ascii?Q?rSRC1uxPxkDxO8VGpnabtFOzWGQw8IkynwItD90YW7QZHWbOrl1hcduclVwJ?= =?us-ascii?Q?1bfvtIGNwyHJmv3wiIqY6MMKTB8PZGojWXb3MofreklRHNqpWW54SdWaYVPn?= =?us-ascii?Q?yrBunP7QAEG4E8J4c9mbdDTTxC6wUIbr4/slEewDq7RDlE0GOBtaHA0hNrNx?= =?us-ascii?Q?whg+f9iTM3cDJdYyeSI1pkei69CiDuRumcO9B3VfAGW7+eTcsicMnv6Q+D8c?= =?us-ascii?Q?rSbsnsg/ePP8L8qHVGyCZrc2w7V/o90OWWVjCLSMHX0lEngJgWZeTCnfr9fS?= =?us-ascii?Q?dXuY17yPRZhbWBkJb+tE6oBiGXaB4d77X6/gxzv0?= 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: 0e4b961b-6044-492b-81a0-08da9b92758e X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 05:30:56.5838 (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: 4H6sjpj1vQz0JhFqM0F1v7NY4OvOQiZ0BgAba2cVoFQpt96OaU2zcOBJoyZlP8xIMLqQC5c1PqfRiUbxMaxiCg== 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 Sorry, could you help to share more information on what issue is met for th= is proposed patch? It seems to me that the change made below is to handle the case where: 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; }=20 GetPortStatus() returns EFI_ SUCCESS, but does not update the output parame= ter 'PortState'. Could you help to check what causes 'PortState' not being updated after a s= uccess return from GetPortStatus()? Thanks in advance. Also, one inline comment below: > -----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 1/2] MdeModulePkg/UsbBusDxe: Avoid > continuing on error path >=20 > Zero out the PortState in case GetPortStatus didn't set it, to avoid > continuing with EFI_DEVICE_ERROR. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Sean Rhodes > --- > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > index aed34596f4..7fc567898a 100644 > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c > @@ -900,6 +900,11 @@ UsbEnumeratePort ( > Child =3D NULL; >=20 > HubApi =3D HubIf->HubApi; >=20 >=20 >=20 > + // Zero out PortState in case GetPortStatus does not set it and we >=20 > + // continue on the EFI_DEVICE_ERROR path >=20 > + PortState.PortStatus =3D 0; >=20 > + PortState.PortChangeStatus =3D 0; Could you help to use: ZeroMem (&PortState, sizeof (EFI_USB_PORT_STATUS)); here to align with other places in this driver? Best Regards, Hao Wu >=20 > + >=20 > // >=20 > // Host learns of the new device by polling the hub for port changes. >=20 > // >=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 (#93989): https://edk2.groups.io/g/devel/message/93989 > Mute This Topic: https://groups.io/mt/93802896/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