From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02olkn080c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe45::80c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DAE72208F7A36 for ; Mon, 3 Apr 2017 02:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bfM6e8OyGoitFcOqZMSTQM/IUi2D8eLwFomdq/XYcD4=; b=tH5OgrathBamLn1WAcHZNH9SHU26GVRAPuoWIYIiFEiHDj5QS9faQ8IJ5oatOnF6nD3g46gKe8bC7d0Uy5oPAYKjNe+ajZvLyaIhemlTDfrlPBeiy5fJppx5psYxwZQRqFnGOacMQD+Og0HnucEtHIUt1uP//RKa6vW+Xhsly9zvKF7hqPeoHStVI5OrBo9a3FLjvG2l6aprJW5+dP91xp1MwsM2adk/XaACnqjsJtVv6bb69P7M8XaFf/FxKozkaf97Bsfcobw0iSckEoMdFB4kOnTAjucagpXLy6ZfaDD1x8CoOvP8TGX36fEdSqCaVj5u7M76ofbPVU1pWvTB+A== Received: from CY1NAM02FT040.eop-nam02.prod.protection.outlook.com (10.152.74.52) by CY1NAM02HT157.eop-nam02.prod.protection.outlook.com (10.152.75.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5; Mon, 3 Apr 2017 09:58:07 +0000 Received: from MWHPR11MB1822.namprd11.prod.outlook.com (10.152.74.52) by CY1NAM02FT040.mail.protection.outlook.com (10.152.75.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.5 via Frontend Transport; Mon, 3 Apr 2017 09:58:07 +0000 Received: from MWHPR11MB1822.namprd11.prod.outlook.com ([10.175.53.137]) by MWHPR11MB1822.namprd11.prod.outlook.com ([10.175.53.137]) with mapi id 15.01.1005.018; Mon, 3 Apr 2017 09:58:07 +0000 From: Amit kumar To: Andrew Fish , "edk2-devel@lists.01.org" Thread-Topic: [edk2] DisconnectController API not working. Thread-Index: AQHSqkHw1+ed4W2EGUea0zD5eEaJwqGzankV Date: Mon, 3 Apr 2017 09:58:07 +0000 Message-ID: References: , <37439A6C-0D5F-45E8-B634-1841B73268CE@apple.com> In-Reply-To: <37439A6C-0D5F-45E8-B634-1841B73268CE@apple.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: apple.com; dkim=none (message not signed) header.d=none;apple.com; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:28228B96C0119B29F912D3D8D28500C45BA925405844B8F7E1C0DD9E24630ECD; UpperCasedChecksum:B0FD13E5F536FD3FB094BF8A74C796ABD4BD6F547A2CDCBDFA1D5ACEA4A05BEC; SizeAsReceived:8180; Count:42 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [cpGn5PgMyGIDb/oBx/p5iRjjIXuMNFOe] x-microsoft-exchange-diagnostics: 1; CY1NAM02HT157; 5:woSWtolGE7iVUnpRECuXCJPkC0zAQPg8U5PxDtk4brch/1Q7ZRG3GJN8B0oPYZYCGGmT9zuYDDkzzTTaTo3wJ4tNA0gJpNNaz98lFLNWtcrZcbePE8GU38nPr4kZ+3cd4kH+1YYdR0dNSkwlXQOS8A==; 24:UsA59GuJZpzPWJgxlvN3Lt3+mon9tGaGgfqF8k5hPDoF8LfFDGlotDkSLm8HAwRtNHcsS3qP8FnpS9mnyQkX4712o5eYn0vK6IimDj0vX3E=; 7:vY2bCsgvodC30wNYvlqNCSwAHLTBNVAKYgID5rka7YNLV4HlPz3+Qj+lJdVzElUCAc0GmLamWDzWPayjKJUCA1XMtXtHo/ezriDfhFPQCkdb49blKo6DZ60i+vDP24S/p/ZeRwxY77bBgVHAZH2Au+9P0v7uhrTYsP4K1yMOBEAKhPqduq0Agm/ApzKVelYzN5EG/hKDm3CwxbHjUFA46d9fpHALouNCJU5VzVQr/52+pslUz9L/Q6Y1R27f1VS/S4RoxF8Pp90eSBBFyuyIoC2qOuozDaolgEB5rmyl3sqqbLqqbm5QOndSOJhk9jM9 x-incomingheadercount: 42 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:CY1NAM02HT157; H:MWHPR11MB1822.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: bbc769a3-8d04-44f1-9677-08d47a77eddc x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322274)(1601125374)(1603101448)(1701031045); SRVR:CY1NAM02HT157; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:CY1NAM02HT157; BCL:0; PCL:0; RULEID:; SRVR:CY1NAM02HT157; x-forefront-prvs: 0266491E90 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2017 09:58:07.3643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT157 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: DisconnectController API not working. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 09:58:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Andrew , I did some testing and found out, same code works fine on Server boards but= it fails on desktop boards. I Have double checked the ControllerHandle by printing its handle index usi= ng ConvertHandleToHandleIndex(ControllerHandle), the ControllerHandle look= s correct. I have one new query; i have made a startup.nsh file in which i am issuing load driver.efi , i am= getting file not found. i have also tried using load fs0:driver.efi, and again i get file not foun= d. I have been trying to run this script from internal shell as well as us= b shell. Regards Amit Kumar ________________________________ From: afish@apple.com on behalf of Andrew Fish Sent: Friday, March 31, 2017 10:42:08 PM To: Amit kumar Cc: edk2-devel@lists.01.org Subject: Re: [edk2] DisconnectController API not working. On Mar 31, 2017, at 5:26 AM, Amit kumar > wrote: Hi , I am trying to disconnect a controller from the usb mass storage driver, fo= r which i am using Status =3D gBS->DisconnectController ( ControllerHandle, NULL, NULL ); after the call i get Status =3D SUCCESS , but when i run drivers command in= shell, i find it still being manged by the same old driver handle. Although when i run disconnect command from shell (e.g disconnect 163 ...ou= tput disconnect(163,0,0):Status =3D SUCCESS) it works as expected and detaches the controller from the driver. Can some body point me out what could be the reason. Amit, It is always good to double check you are using the right ControllerHandle. Sequence of events matters. There are boot flows and Shell commands that do= ConnectController. ~/work/src/edk2/ShellPkg(master)>git grep ConnectController Library/UefiShellDebug1CommandsLib/LoadPciRom.c:402: gBS->ConnectControl= ler (HandleBuffer[Index], NULL, NULL, TRUE); Library/UefiShellDriver1CommandsLib/Connect.c:54: Status =3D gBS->Co= nnectController (Handle, NULL, RemainingDevicePath, FALSE); Library/UefiShellDriver1CommandsLib/Connect.c:95: gBS->ConnectController= (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE); Library/UefiShellDriver1CommandsLib/Connect.c:116:ConnectControllers ( Library/UefiShellDriver1CommandsLib/Connect.c:150: // This is where we cal= l the gBS->ConnectController function. Library/UefiShellDriver1CommandsLib/Connect.c:158: Status =3D gBS->Con= nectController(*HandleWalker, DriverHandleList, NULL, Recursive); Library/UefiShellDriver1CommandsLib/Connect.c:167: Status =3D gBS->Conne= ctController(ControllerHandle, DriverHandleList, NULL, Recursive); Library/UefiShellDriver1CommandsLib/Connect.c:298: Status = =3D gBS->ConnectController ( Library/UefiShellDriver1CommandsLib/Connect.c:354:ConvertAndConnectControll= ers ( Library/UefiShellDriver1CommandsLib/Connect.c:391: return (ConnectControll= ers(Handle1, Handle2, Recursive, Output, (BOOLEAN)(Handle2 !=3D NULL && Han= dle1 !=3D NULL))); Library/UefiShellDriver1CommandsLib/Connect.c:536: Status =3D Conv= ertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package,= L"-r"), (BOOLEAN)(Count!=3D0)); Library/UefiShellDriver1CommandsLib/DrvCfg.c:492: EFI_HANDLE ConnectContr= ollerContextOverride[2]; Library/UefiShellDriver1CommandsLib/DrvCfg.c:514: ConnectControllerConte= xtOverride[0] =3D DriverImageHandle; Library/UefiShellDriver1CommandsLib/DrvCfg.c:515: ConnectControllerConte= xtOverride[1] =3D NULL; Library/UefiShellDriver1CommandsLib/DrvCfg.c:516: gBS->ConnectController= (ControllerHandle, ConnectControllerContextOverride, NULL, TRUE); Library/UefiShellLevel2CommandsLib/Load.c:52: Status =3D gBS->ConnectCon= troller (HandleBuffer[Index], NULL, NULL, TRUE); Thanks, Andrew Fish _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel