From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8382621CB57A0 for ; Tue, 27 Jun 2017 15:53:20 -0700 (PDT) Received: by mail-yb0-x22c.google.com with SMTP id s9so13990656ybe.3 for ; Tue, 27 Jun 2017 15:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Szr2SRm933DHu0uNu2XLWTRUpSd6gp7TjeUt1+aguKY=; b=YUfqOUxFZq77wOnavCQL/Bkqy8tJPCi92o55M+np/eP4Vn058kQ6AcCRLMFHH3/JJ8 dAcjNh/WIA1Af5XwIndYP276PeHMMRkzGLsW2m5imrlhzlzfD8zNkzxAPWedmNf2eRpB wHXFROgjH0OT8UHEfokwtWwOzrFioF6tJnEf2VjKIW15V0jTjdqKajWG+qTWrtweD5pw LXznkUwANynBotEXZkhPuxmY97eFi5ziMPcClEEY9it4gJgxeIw5LCzPS8CLKw5UX7ml lJxe2/Rebt6VQXbUX+OjqF8I+I1vKoY9b8lYiM9444U4D0NL5nLIO5TPwa/BzZ0dSDQg W2Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Szr2SRm933DHu0uNu2XLWTRUpSd6gp7TjeUt1+aguKY=; b=WaJcDYwTgYi2nZm5K3DmAtUYFFXWdjmP/3XUvKFUuVft95eeXHfZeVWiRkFBzFpKsu N1g5canj6iZTp2rbchB2Tb1UPv1jWpO7j33XBbZQEbTExG3rpX8XF2VpVfMIm83x4fb3 Rr47Fw3JwwWGFoGKfzy6UbGa+8xkmIRYpxOiXZCZltPTpUEnWZpVHvH6Q/Vu5fQaRpy8 TmKdtf4hSSPrhVrdiVLDHTJ+G1fKGn1dhH11sECo2XE7fVuPg6Jr1HH7gm562cRoD6fE u5jd1hICzpejGRejZcI96M1XuV/Suv67qxTg37I92keUgcFlr1S4tlR1F5/4G1rSMEWn +b9Q== X-Gm-Message-State: AKS2vOxnLZsqMoQsAiEsORY0EZ9Gsyj75TnAcZfX0A3GFe6XpuE1upY2 GnKFfQAMrS2khC0YdmoFGWM5r6HhGrUo X-Received: by 10.37.52.140 with SMTP id b134mr6069577yba.30.1498604090560; Tue, 27 Jun 2017 15:54:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.209.86 with HTTP; Tue, 27 Jun 2017 15:54:30 -0700 (PDT) From: TVKR Date: Tue, 27 Jun 2017 17:54:30 -0500 Message-ID: To: edk2-devel@lists.01.org, akamit91@hotmail.com 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: Tue, 27 Jun 2017 22:53:20 -0000 Content-Type: text/plain; charset="UTF-8" Hi Amit, 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? Thanks -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces at lists.01.org ] On Behalf Of Amit kumar Sent: Tuesday, April 4, 2017 12:07 AM To: Tian, Feng > Cc: edk2-devel at lists.01.org Subject: Re: [edk2] DisconnectController API not working. No i am not trying to disconnect USB controller in use. ________________________________ From: Tian, Feng > Sent: Wednesday, April 5, 2017 8:21:36 AM To: Andrew Fish; Amit kumar Cc: edk2-devel at lists.01.org ; Tian, Feng Subject: RE: [edk2] DisconnectController API not working. Kumar, Do "map -r" at first please. 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. Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces at lists.01.org ] On Behalf Of Andrew Fish Sent: Tuesday, April 4, 2017 12:07 AM To: Amit kumar > Cc: edk2-devel at lists.01.org Subject: Re: [edk2] DisconnectController API not working. >* 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 at apple.com > on behalf of Andrew Fish *>* > *>* Sent: Friday, March 31, 2017 10:42:08 PM *>* To: Amit kumar *>* Cc: edk2-devel at 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:ConvertAndConnectCon *>* trollers ( *>* 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 at lists.01.org > *>* https://lists.01.org/mailman/listinfo/edk2-devel *>>* _______________________________________________ *>* edk2-devel mailing list *>* edk2-devel at lists.01.org *>* https://lists.01.org/mailman/listinfo/edk2-devel *