From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in21.apple.com (mail-out21.apple.com [17.171.2.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 99EF3219392E7 for ; Mon, 3 Apr 2017 09:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1491235608; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+nGAnSWeB9qpUW0wzrDic1ZN/LeOTfvdDRB/KYVkS0k=; b=as/ef9hYz246PCwnXE8F0s2qlnkE1lHtdiE6cMDLrEqa0h9rRJKTabYoRLB+EC7J bZUXEFaBX2eLCmBv1aTeE7CX1VQ6Ip3UDZgp69GA79yX0Was1ZjIi3q+dLQ5ZPjH C8elIoCm/Ze1z3hiWmIgD1ZKN8nVdPOeVdZbmZLK18hiZubCSAODC2RteeB3dMPL vzpQaq0mqJzq6L3pMuxwh1IFmOBtrAoCCnMaYtDenGEGe3O1BT/WRG1qU7b8lmdx LzqnUxZLn+nP0s/yyxz/+mJpXkGPqDdfjq9R76JkHyuRtSVWvENrZSbdsqIkJb54 OidXnMtKgSCFLNxefjFdrg==; Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) by mail-in21.apple.com (Apple Secure Mail Relay) with SMTP id 0F.52.24065.81372E85; Mon, 3 Apr 2017 09:06:48 -0700 (PDT) X-AuditID: 11ab0215-f3f9b9a000005e01-1f-58e273180d13 Received: from nwk-mmpp-sz13.apple.com (nwk-mmpp-sz13.apple.com [17.128.115.216]) by relay2.apple.com (Apple SCV relay) with SMTP id 57.AD.06512.71372E85; Mon, 3 Apr 2017 09:06:48 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.38.195] (unknown [17.153.38.195]) by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0ONU00K9FCRAQ010@nwk-mmpp-sz13.apple.com>; Mon, 03 Apr 2017 09:06:47 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Mon, 03 Apr 2017 09:07:04 -0700 Cc: "edk2-devel@lists.01.org" Message-id: References: <37439A6C-0D5F-45E8-B634-1841B73268CE@apple.com> To: Amit kumar X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsUi2FDorCtR/CjC4PFcNYt9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDLmXTrAWrBGuWLahVeMDYzPZbsYOTkkBEwk ll+cxt7FyMUhJLCPUeLc9C0sXYwcYIkfM9Qg4ocYJeZ2LGQBaeAVEJT4MfkeWA2zgLzEwfNg c5gFtCS+P2plgaifyCQx7+EhsHphAXGJd2c2MUPYlhKP131lB7HZBJQlVsz/AGZzCsRLnD71 EcxmEVCVmDdhCSvEUHOJGRe+MEHstZH4seQt2BwhgSeMEqum14LYIkD1/e1T2CGekZW4NfsS M8gREgJL2CQ273zFNIFReBaSu2ch3D0Lyd0LGJlXMQrnJmbm6GbmGRnqJRYU5KTqJefnbmIE hfZqJtEdjPNfGR5iFOBgVOLhjfB7FCHEmlhWXJl7iFGag0VJnFfi7r0IIYH0xJLU7NTUgtSi +KLSnNTiQ4xMHJxSDYyzXc8w5On2pE/eMHuXkQSL1ncr00f++lfVVH2szdYeas9iEdB8L7Jv /VrtS+mdS0KnuWY75NyrD2zW+FpxUe97Vq56TF7wwhsdvi8FLc/FX3191TPHzkLuj+OphRON +8Szn873mxbq9oR5koffN3vnorSGHwVMO9tiLFY93nHcz+T3PLejR5VYijMSDbWYi4oTAffl y1tOAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42IRbCi+oStR/CjC4MkxTot9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDLmXTrAWrBGuWLahVeMDYzPZbsYOTgkBEwk fsxQ62Lk4hASOMQoMbdjIUsXIycHr4CgxI/J91hAapgF5CUOnpcFCTMLaEl8f9TKAlE/kUli 3sNDYPXCAuIS785sYoawLSUer/vKDmKzCShLrJj/AczmFIiXOH3qI5jNIqAqMW/CElaIoeYS My58YYLYayPxY8lbsDlCAk8YJVZNrwWxRYDq+9ungPVKCMhK3Jp9iXkCo8AsJKfOQjh1FpJT FzAyr2IUKErNSaw00kssKMhJ1UvOz93ECA7EQucdjMeWWR1iFOBgVOLhXeD0KEKINbGsuDIX GBYczEoivBzxQCHelMTKqtSi/Pii0pzU4kOMVUD3T2SWEk3OB0ZJXkm8oYmJgYmxsZmxsbmJ OVWElcR5c8rvRQgJpCeWpGanphakFsEsZ+LglGpg5F9huZnpXqT8j5uB2kwJq50NPirtVUls eWOgwGrauqh3elBuDJ+tvRTTywnW1kJ2VT5HNDfVep9ffXi7d3bwLt6W1T5dCr0tM9oU7dN/ cMyfu9xL+mabWVObXjubpcj2u5uC49eKntk858C6f3wcixWL5Xxflon9+scz7cBh7+KvDFOW P+pQYinOSDTUYi4qTgQAhRT43Z8CAAA= 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 16:06:49 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Apr 3, 2017, at 2:58 AM, Amit kumar wrote: > > Hi Andrew , > > I did some testing and found out, same code works fine on Server boards but it fails on desktop boards. > Servers tend to connect less things as it can take a long time. > I Have double checked the ControllerHandle by printing its handle index using ConvertHandleToHandleIndex(ControllerHandle), the ControllerHandle looks 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 found. I have been trying to run this script from internal shell as well as usb shell. > Does that command work if you boot the shell? Thanks, Andrew Fish > > 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, for which i am using > > Status = gBS->DisconnectController ( > ControllerHandle, > NULL, > NULL > ); > > after the call i get Status = 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 ...output disconnect(163,0,0):Status = 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->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); > Library/UefiShellDriver1CommandsLib/Connect.c:54: Status = gBS->ConnectController (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 call the gBS->ConnectController function. > Library/UefiShellDriver1CommandsLib/Connect.c:158: Status = gBS->ConnectController(*HandleWalker, DriverHandleList, NULL, Recursive); > Library/UefiShellDriver1CommandsLib/Connect.c:167: Status = gBS->ConnectController(ControllerHandle, DriverHandleList, NULL, Recursive); > Library/UefiShellDriver1CommandsLib/Connect.c:298: Status = gBS->ConnectController ( > Library/UefiShellDriver1CommandsLib/Connect.c:354:ConvertAndConnectControllers ( > Library/UefiShellDriver1CommandsLib/Connect.c:391: return (ConnectControllers(Handle1, Handle2, Recursive, Output, (BOOLEAN)(Handle2 != NULL && Handle1 != NULL))); > Library/UefiShellDriver1CommandsLib/Connect.c:536: Status = ConvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package, L"-r"), (BOOLEAN)(Count!=0)); > Library/UefiShellDriver1CommandsLib/DrvCfg.c:492: EFI_HANDLE ConnectControllerContextOverride[2]; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:514: ConnectControllerContextOverride[0] = DriverImageHandle; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:515: ConnectControllerContextOverride[1] = NULL; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:516: gBS->ConnectController (ControllerHandle, ConnectControllerContextOverride, NULL, TRUE); > Library/UefiShellLevel2CommandsLib/Load.c:52: Status = gBS->ConnectController (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 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel