From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in6.apple.com (mail-out6.apple.com [17.151.62.28]) (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 5790821CB74A3 for ; Wed, 28 Jun 2017 12:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1498678459; 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=kvc1IsxNkWYIuvLd+pv5FiBICo502b4t3tmqWncea2c=; b=eZtxh+SZehfrf1eLBMDSnrwqdOPft8iWI3Lq/x0VFuFu0HcIGWgwBlB6iNgA06Ry 0om6fmyc2HCWnwCbR4mVt46Exiw+aHPBRbETD2p1AcLikdL56z4NNFJ+Q0rtWisg yqC/+fYkolyEh5Vh1srLtDPRxDZ6RzU5ktzSjHVWJIjlQLQguf9IDYni5/c/wBsK NGW9i+qdBFnwnfoedYbYXnGaeoGdql9/R2JmQs9c60MiwJc11DjrvD1WqF/2Nc7O EovMLX05v5NjCAJr00AfYcQXlVgTkldV6sFNEESdTnNDWJDI+EJc4FnZxI+/N93+ oGMERuvLirF9E8mkFkdXvg==; Received: from relay5.apple.com (relay5.apple.com [17.128.113.88]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in6.apple.com (Apple Secure Mail Relay) with SMTP id E5.37.06961.AB404595; Wed, 28 Jun 2017 12:34:18 -0700 (PDT) X-AuditID: 11973e15-9dace9c000001b31-39-595404bad0f6 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by relay5.apple.com (Apple SCV relay) with SMTP id FC.00.09344.AB404595; Wed, 28 Jun 2017 12:34:18 -0700 (PDT) MIME-version: 1.0 Received: from [17.114.154.244] by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0OS9007GKVP6PL20@nwk-mmpp-sz09.apple.com>; Wed, 28 Jun 2017 12:34:18 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Wed, 28 Jun 2017 12:34:18 -0700 Cc: Amit kumar , "edk2-devel@lists.01.org" Message-id: References: To: TVKR X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsUi2FAYobubJSTSoE3ZYt/rnUwWew4dZbZo fH+E1YHZY+esu+wej3vOsHl0z/7HEsAcxWWTkpqTWZZapG+XwJXReUOh4FwzY8WKUywNjD+z uxg5OSQETCSmb9rB3sXIxSEksJpJYv37vewwiavHe9lAbCGBg4wSBz6A2bwCghI/Jt9j6WLk 4GAWUJeYMiUXovcbo8T8FbOZQWqEBcQl3p3ZBGVbSjxe9xVsJpuAssSK+R/AbE6BYIm7E9cx gtgsAqoSy7/sZwWxmQViJE68/ssIYWtLPHl3gRVir43E3PWXoe55xy6xtDkFxBYRkJHY2D2N GeJmWYlbsy8xgxwkIbCGTWJm33rmCYzCs5DcPQvh7llIVixgZF7FKJSbmJmjm5lnppdYUJCT qpecn7uJERTo0+1EdzCeWWV1iFGAg1GJh3fFquBIIdbEsuLK3EOM0hwsSuK8BXMCI4UE0hNL UrNTUwtSi+KLSnNSiw8xMnFwSjUwrom+ZjbNTcU5fMnmera65fOW3vE9NO1EtVLoOQPLJxNb A/dUFZWlV/a+UklWPPq8Ttx+t3fntY0for4cvuSuyL7El6HO6NcJjWVOsd6uW28qti6J4f+o LpQ984C7czR/o4Cp4WrbGO72T6wb+qNOXOliMxM5YHPl74Pq3gtsuzbdMFxV83qhEktxRqKh FnNRcSIAuhKEglUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKIsWRmVeSWpSXmKPExsUi2FAcoLuLJSTSoPm/ucW+1zuZLPYcOsps 0fj+CKsDs8fOWXfZPR73nGHz6J79jyWAOYrLJiU1J7MstUjfLoEro/OGQsG5ZsaKFadYGhh/ ZncxcnJICJhIXD3eywZiCwkcZJQ48AHM5hUQlPgx+R5LFyMHB7OAusSUKbldjFxAJd8YJeav mM0MUiMsIC7x7swmKNtS4vG6r+wgNpuAssSK+R/AbE6BYIm7E9cxgtgsAqoSy7/sZwWxmQVi JE68/ssIYWtLPHl3gRVir43E3PWXoe55xy6xtDkFxBYRkJHY2D2NGeJmWYlbsy8xT2AUmIXk 1FkIp85CMnUBI/MqRoGi1JzESlO9xIKCnFS95PzcTYzg0CyM2MH4f5nVIUYBDkYlHt4Vq4Ij hVgTy4orcw8xSnAwK4nwVpwFCvGmJFZWpRblxxeV5qQWH2KsAvplIrOUaHI+MG7ySuINTUwM TIyNzYyNzU3MqSKsJM674jbQZoH0xJLU7NTUgtQimOVMHJxSDYy3VS+dPr/qxPyGGcWHvma6 FN9aKe+qkdqQfXuqaFNemZ7zednQqDfyUulhlU08vqabqy5cc437+aDeTVHksllfi9LlBgnD F9WBbDdPf3LRlZl6rlL+Uaa43qSqpa75C36s1HwrbGa/9swm32sc5QYqHSyp08NYRdtfnFUx KLZfvIYtob5fSomlOCPRUIu5qDgRAJN0lyCoAgAA 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: Wed, 28 Jun 2017 19:32:47 -0000 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable > On Jun 28, 2017, at 12:27 PM, TVKR wrote: >=20 > Tried it, still no luck :( >=20 > There is something in the Shell that makes the in-built disconnect = without > any issues but when the same DisconnectController is called from an > application is fails. >=20 It is more likely you are doing something wrong.=20 Using HandleIndex is risky as it is more about User Interface than = reality. Have you tried printing out the EFI_HANDLE values you are = passing into gBS->DisconnectController()? The should match the values = you get when you dump a specific handle in the shell. The EFI_HANDLE = value is not going to change, it is only going to get removed if all = protocols on that handle are uninstalled.=20 So for example. 176: 7219E798 If you used 178 at the Shell you would expect to see 7219E798 printed = out as the handle value.=20 Thanks, Andrew Fish > Thanks >=20 > On Wed, Jun 28, 2017 at 1:23 PM, Amit kumar = wrote: >=20 >>=20 >>=20 >> EFI_STATUS >> EFIAPI >> UefiMain ( >> IN EFI_HANDLE ImageHandle, >> IN EFI_SYSTEM_TABLE *SystemTable >> ) >> { >> EFI_STATUS Status; >>=20 >>=20 >> gBS->DisconnectController ( >> ConvertHandleIndexToHandle (0x175), >> ConvertHandleIndexToHandle (0x176), >> NULL); >> return (Status); >>=20 >> } >>=20 >>=20 >> ------------------------------ >> *From:* edk2-devel on behalf of = Amit >> kumar >> *Sent:* Wednesday, June 28, 2017 11:41:53 PM >> *To:* TVKR >> *Cc:* edk2-devel@lists.01.org >> *Subject:* Re: [edk2] DisconnectController API not working. >>=20 >> Try this; just a quick thing >>=20 >>=20 >>=20 >>=20 >> EFI_STATUS >> EFIAPI >> UefiMain ( >> IN EFI_HANDLE ImageHandle, >> IN EFI_SYSTEM_TABLE *SystemTable >> ) >> { >> EFI_STATUS Status; >>=20 >>=20 >> gBS->DisconnectController ( >> ConvertHandleIndexToHandle (175), >> ConvertHandleIndexToHandle (176), >> NULL); >> return (Status); >>=20 >> } >>=20 >>=20 >> ________________________________ >> From: TVKR >> Sent: Wednesday, June 28, 2017 11:31:46 PM >> To: Amit kumar >> Cc: edk2-devel@lists.01.org >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >> Yes, the shell's in-built command disconnect (disconnect 175 176) = worked >> but DisconnectController call from the application still did not = work. >>=20 >> On Wed, Jun 28, 2017 at 12:56 PM, Amit kumar = > akamit91@hotmail.com>> wrote: >>=20 >> okay, os tell me , did you try "disconnect 175 176" in UEFI shell ? >>=20 >> ________________________________ >> From: TVKR > >> Sent: Wednesday, June 28, 2017 11:21:34 PM >>=20 >> To: Amit kumar >> Cc: edk2-devel@lists.01.org >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >> Sorry, I wasn't clear in my last email. No it did not hang. The = 'reconnect >> -r' command completed successfully (no errors reported on screen). >>=20 >> On Wed, Jun 28, 2017 at 12:50 PM, Amit kumar = > akamit91@hotmail.com>> wrote: >>=20 >> Did it hang ? >>=20 >> ________________________________ >> From: TVKR > >> Sent: Wednesday, June 28, 2017 10:45:13 PM >> To: Amit kumar >> Cc: edk2-devel@lists.01.org >>=20 >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >> Thanks for the suggestion Amit. I tried the reconnect -r but it = doesn't >> seem to help. >>=20 >> On Wed, Jun 28, 2017 at 10:29 AM, Amit kumar = > akamit91@hotmail.com>> wrote: >> Hi Tresko, >> I looks like there is no problem with your implementation, as was the = case >> with me. >> I can suggest you a quick trick here, if it won=E2=80=99t work I will = help you >> further which might take a while. >> Follow the steps below. >> 1. Go to refi shell >> 2. Reconnect -r >> 3. If the sysytem hangs. >> 4. Try to update your BIOS/UEFI to latest (as I had noticed the = eariler >> BIOS/UEFI had some some problem which normally gets fixed with = updates). >> 5. After update once again try Reconnect -r. >> 6. If theres a no hang restart the system and now you can try your = app or >> just give disconnect in uefi shell. >> 7. If still I doesn=E2=80=99t work you can ping me I might suggest = the other way >> around. >>=20 >> Amit >>=20 >> On Jun 28, 2017, at 8:05 PM, TVKR > ko1@gmail.com>> wrote: >>=20 >> Hi Amit, >>=20 >> Here is the output. It is the call 'gBS->DisconnectController >> (ControllerHandle, NULL, NULL)' (where ControllerHandle=3D7219EA98) = that >> doesn't seem to correctly work. >>=20 >> FS0:\> drivers >> Output Truncated.. >> 176 07042200 B Y Y 1 1 Intel(R) PRO/1000 7.3.18 PCI-E >> PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)/Offset(0x1D200,0x3E9FF) >> 178 07042200 B Y Y 1 1 Intel(R) PRO/1000 7.3.18 PCI-E >> PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x1)/Offset(0x1D200,0x3E9FF) >>=20 >> FS0:\> dh 176 -d -v >> 176: 7219E798 >> DriverVersion >> 0x00020028 >> EfiDriverHealthProtocolGuid >> DriverConfiguration >> DriverDiagnostics2 >> ComponentName2 >> DriverDiagnostics >> ComponentName >> DriverBinding >> ImageDevicePath >> LoadedImage >> Revision......: 0x00001000 >> ParentHandle..: 72B70A18 >> SystemTable...: 788FEF18 >> DeviceHandle..: 7219EA98 >> FilePath......: 7219E998 >> OptionsSize...: 0 >> LoadOptions...: >> ImageBase.....: 776A0000 >> ImageSize.....: 555E0 >> CodeType......: EfiBootServicesCode >> DataType......: EfiBootServicesData >> Unload........: 776A0708 >>=20 >> Child[176] : Intel(R) PRO/1000 7.3.18 PCI-E >> Driver Image Name : Offset(0x1D200,0x3E9FF) >> Driver Version : 07031800 >> Driver Type : Bus >> Configuration : YES >> Diagnostics : YES >> Child Controllers : >> Ctrl[175] : PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0) >> Child[219] : Intel Ethernet Server Adapter I350-T2 >>=20 >>=20 >> FS0:\> dh 175 -d -v >> 175: 7219EA98 >> UnknownDevice >> UnknownDevice >> BusSpecificDriverOverride >> LoadFile2 >> PCIIO >> DevicePath >> PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0) >> Controller Name : PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0) >> Device Path : PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0) >> Controller Type : BUS >> Configuration : NO >> Diagnostics : NO >> Managed by : >> Drv[176] : Intel(R) PRO/1000 7.3.18 PCI-E >> Parent Controllers : >> Parent[75] : PciRoot(0x0) >> Child Controllers : >> Child[219] : Intel Ethernet Server Adapter I350-T2 >>=20 >>=20 >> Thanks >>=20 >> On Wed, Jun 28, 2017 at 9:07 AM, Amit kumar = > kamit91@hotmail.com>> wrote: >>=20 >> Hi Tresko, >>=20 >>> Hi Amit, >>=20 >>> I am seeing the exact same issue on my system with = DisconnectController. >> The shell command 'disconnect' works but when I use the >> gBS->DisconnectController >call from my application it doesn't seem = to >> really disconnect the same controller (even though the call returns >> SUCCESS) and it still appears to be managed by >driver. I even = checked the >> ControllerHandle passed and it looks correct. Were you able to = resolve this >> eventually? >>=20 >>=20 >> Yes i was able to resolve it. It might be helpful if you can tell me = the >> output of dh -d command. >>=20 >> Thanks >>=20 >> Amit >>=20 >>=20 >> ________________________________ >> From: TVKR > >> Sent: Wednesday, June 28, 2017 6:06:11 PM >> To: edk2-devel@lists.01.org; >> akamit91@hotmail.com >>=20 >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >> BTW, I ported the disconnect code (under = ShellPkg\Library\UefiShellDriver1CommandsLib) >> to a standalone application and it fails too. Looks like there is = something >> else in the shell app that is taking care of properly disconnecting = the >> controller. >>=20 >> Thanks >>=20 >> On Tue, Jun 27, 2017 at 5:54 PM, TVKR > ko1@gmail.com>> wrote: >> Hi Amit, >>=20 >> I am seeing the exact same issue on my system with = DisconnectController. >> The shell command 'disconnect' works but when I use the >> gBS->DisconnectController call from my application it doesn't seem to >> really disconnect the same controller (even though the call returns >> SUCCESS) and it still appears to be managed by driver. I even checked = the >> ControllerHandle passed and it looks correct. Were you able to = resolve this >> eventually? >>=20 >>=20 >> Thanks >>=20 >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces at lists.01.org< >> https://lists.01.org/mailman/listinfo/edk2-devel>] On Behalf Of Amit = kumar >> Sent: Tuesday, April 4, 2017 12:07 AM >> To: Tian, Feng > org/mailman/listinfo/edk2-devel>> >> Cc: edk2-devel at = lists.01.org> devel> >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >> No i am not trying to disconnect USB controller in use. >>=20 >> ________________________________ >> From: Tian, Feng > org/mailman/listinfo/edk2-devel>> >> Sent: Wednesday, April 5, 2017 8:21:36 AM >> To: Andrew Fish; Amit kumar >> Cc: edk2-devel at = lists.01.org> devel>; Tian, Feng >> Subject: RE: [edk2] DisconnectController API not working. >>=20 >> Kumar, >>=20 >> Do "map -r" at first please. >>=20 >>=20 >> PS: for the issue you encounter, are you trying to disconnect the usb >> controller in use? Please note at this time you are reading the file = from >> usb key. It means the disconnect will never succeed. >>=20 >> Thanks >> Feng >>=20 >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces at lists.01.org< >> https://lists.01.org/mailman/listinfo/edk2-devel>] On Behalf Of = Andrew >> Fish >> Sent: Tuesday, April 4, 2017 12:07 AM >> To: Amit kumar > org/mailman/listinfo/edk2-devel>> >> Cc: edk2-devel at = lists.01.org> devel> >> Subject: Re: [edk2] DisconnectController API not working. >>=20 >>=20 >>> On Apr 3, 2017, at 2:58 AM, Amit kumar > https://lists.01.org/mailman/listinfo/edk2-devel>> wrote: >>>=20 >>> Hi Andrew , >>>=20 >>> I did some testing and found out, same code works fine on Server = boards >> but it fails on desktop boards. >>>=20 >>=20 >> Servers tend to connect less things as it can take a long time. >>=20 >>> I Have double checked the ControllerHandle by printing its handle = index >> using ConvertHandleToHandleIndex(ControllerHandle), the = ControllerHandle >> looks correct. >>>=20 >>>=20 >>> I have one new query; >>>=20 >>> i have made a startup.nsh file in which i am issuing load driver.efi = , i >> am getting file not found. >>>=20 >>> 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. >>>=20 >>=20 >> Does that command work if you boot the shell? >>=20 >> Thanks, >>=20 >> Andrew Fish >>=20 >>>=20 >>> Regards >>>=20 >>> Amit Kumar >>>=20 >>> ________________________________ >>> From: afish at apple.com> devel> > devel>> on behalf of Andrew Fish >>> > >>> Sent: Friday, March 31, 2017 10:42:08 PM >>> To: Amit kumar >>> Cc: edk2-devel at lists.01.org> org/mailman/listinfo/edk2-devel> >>> Subject: Re: [edk2] DisconnectController API not working. >>>=20 >>>=20 >>> On Mar 31, 2017, at 5:26 AM, Amit kumar > https://lists.01.org/mailman/listinfo/edk2-devel>> hotmail.com>> = wrote: >>>=20 >>>=20 >>> Hi , >>>=20 >>> I am trying to disconnect a controller from the usb mass storage >>> driver, for which i am using >>>=20 >>> Status =3D gBS->DisconnectController ( >>> ControllerHandle, >>> NULL, >>> NULL >>> ); >>>=20 >>> 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 >>> ...output 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. >>>=20 >>> Amit, >>>=20 >>> It is always good to double check you are using the right >> ControllerHandle. >>>=20 >>> 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 =3D >> 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 =3D >> gBS->ConnectController(*HandleWalker, DriverHandleList, NULL, = Recursive); >>> Library/UefiShellDriver1CommandsLib/Connect.c:167: Status =3D >> gBS->ConnectController(ControllerHandle, DriverHandleList, NULL, >> Recursive); >>> Library/UefiShellDriver1CommandsLib/Connect.c:298: >> Status =3D gBS->ConnectController ( >>> = Library/UefiShellDriver1CommandsLib/Connect.c:354:ConvertAndConnectCon >>> trollers ( >>> Library/UefiShellDriver1CommandsLib/Connect.c:391: return >> (ConnectControllers(Handle1, Handle2, Recursive, Output, = (BOOLEAN)(Handle2 >> !=3D NULL && Handle1 !=3D NULL))); >>> Library/UefiShellDriver1CommandsLib/Connect.c:536: Status =3D= >> ConvertAndConnectControllers(Handle1, Handle2, = ShellCommandLineGetFlag(Package, >> L"-r"), (BOOLEAN)(Count!=3D0)); >>> Library/UefiShellDriver1CommandsLib/DrvCfg.c:492: EFI_HANDLE >> ConnectControllerContextOverride[2]; >>> Library/UefiShellDriver1CommandsLib/DrvCfg.c:514: >> ConnectControllerContextOverride[0] =3D DriverImageHandle; >>> Library/UefiShellDriver1CommandsLib/DrvCfg.c:515: >> ConnectControllerContextOverride[1] =3D NULL; >>> Library/UefiShellDriver1CommandsLib/DrvCfg.c:516: >> gBS->ConnectController (ControllerHandle, = ConnectControllerContextOverride, >> NULL, TRUE); >>> Library/UefiShellLevel2CommandsLib/Load.c:52: Status =3D >> gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); >>>=20 >>>=20 >>> Thanks, >>>=20 >>> Andrew Fish >>>=20 >>> _______________________________________________ >>> edk2-devel mailing list >>> edk2-devel at = lists.01.org> devel>> org/mailman/listinfo/edk2-devel>> >>> https://lists.01.org/mailman/listinfo/edk2-devel >>>=20 >>> _______________________________________________ >>> edk2-devel mailing list >>> edk2-devel at = lists.01.org> devel> >>> https://lists.01.org/mailman/listinfo/edk2-devel >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel >>=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel