From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 15C8521A04812 for ; Tue, 4 Apr 2017 19:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491360700; x=1522896700; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=D00mH5zgh7ej5NFpF2CUaqtcdt0OttU7Q/aY8IimRjc=; b=QTIubtssxgXiq1SE5bqPUf/y/B33DhXpseEhaf2VHmfkpMvqfPxDXP1x ReNHN4bEZ2MtdJgmT41oZST+wE4BEw==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 19:51:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,276,1486454400"; d="scan'208";a="951966721" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 04 Apr 2017 19:51:39 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Apr 2017 19:51:39 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Apr 2017 19:51:39 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Wed, 5 Apr 2017 10:51:36 +0800 From: "Tian, Feng" To: Andrew Fish , Amit kumar CC: "edk2-devel@lists.01.org" , "Tian, Feng" Thread-Topic: [edk2] DisconnectController API not working. Thread-Index: AQHSqkH81x+mXPq8NEqYBctQW8YUqaGy5vWAgABnFgCAAstocA== Date: Wed, 5 Apr 2017 02:51:36 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699DD64D@SHSMSX101.ccr.corp.intel.com> References: <37439A6C-0D5F-45E8-B634-1841B73268CE@apple.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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, 05 Apr 2017 02:51:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Kumar, Do "map -r" at first please. PS: for the issue you encounter, are you trying to disconnect the usb contr= oller in use? Please note at this time you are reading the file from usb ke= y. It means the disconnect will never succeed.=20 Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Andr= ew Fish Sent: Tuesday, April 4, 2017 12:07 AM To: Amit kumar Cc: edk2-devel@lists.01.org Subject: Re: [edk2] DisconnectController API not working. > On Apr 3, 2017, at 2:58 AM, Amit kumar wrote: >=20 > Hi Andrew , >=20 > I did some testing and found out, same code works fine on Server boards b= ut it fails on desktop boards. >=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 u= sing ConvertHandleToHandleIndex(ControllerHandle), the ControllerHandle lo= oks 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 fo= und. I have been trying to run this script from internal shell as well as = usb shell. >=20 Does that command work if you boot the shell?=20 Thanks, Andrew Fish >=20 > Regards >=20 > Amit Kumar >=20 > ________________________________ > From: afish@apple.com on behalf of Andrew Fish=20 > > 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. >=20 >=20 > On Mar 31, 2017, at 5:26 AM, Amit kumar > wrote: >=20 >=20 > Hi , >=20 > I am trying to disconnect a controller from the usb mass storage=20 > 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=20 > ...output disconnect(163,0,0):Status =3D SUCCESS) it works as expected an= d 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 ControllerHandl= e. >=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->ConnectContr= oller (HandleBuffer[Index], NULL, NULL, TRUE); > Library/UefiShellDriver1CommandsLib/Connect.c:54: Status =3D gBS->= ConnectController (Handle, NULL, RemainingDevicePath, FALSE); > Library/UefiShellDriver1CommandsLib/Connect.c:95: gBS->ConnectControll= er (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE); > Library/UefiShellDriver1CommandsLib/Connect.c:116:ConnectControllers ( > Library/UefiShellDriver1CommandsLib/Connect.c:150: // This is where we c= all the gBS->ConnectController function. > Library/UefiShellDriver1CommandsLib/Connect.c:158: Status =3D gBS->C= onnectController(*HandleWalker, DriverHandleList, NULL, Recursive); > Library/UefiShellDriver1CommandsLib/Connect.c:167: Status =3D gBS->Con= nectController(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 (ConnectContro= llers(Handle1, Handle2, Recursive, Output, (BOOLEAN)(Handle2 !=3D NULL && H= andle1 !=3D NULL))); > Library/UefiShellDriver1CommandsLib/Connect.c:536: Status =3D Co= nvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Packag= e, L"-r"), (BOOLEAN)(Count!=3D0)); > Library/UefiShellDriver1CommandsLib/DrvCfg.c:492: EFI_HANDLE ConnectCon= trollerContextOverride[2]; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:514: ConnectControllerCon= textOverride[0] =3D DriverImageHandle; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:515: ConnectControllerCon= textOverride[1] =3D NULL; > Library/UefiShellDriver1CommandsLib/DrvCfg.c:516: gBS->ConnectControll= er (ControllerHandle, ConnectControllerContextOverride, NULL, TRUE); > Library/UefiShellLevel2CommandsLib/Load.c:52: Status =3D gBS->ConnectC= ontroller (HandleBuffer[Index], NULL, NULL, TRUE); >=20 >=20 > Thanks, >=20 > Andrew Fish >=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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel