From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-oln040092007083.outbound.protection.outlook.com [40.92.7.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 691B12095A6C4 for ; Wed, 28 Jun 2017 11:21:45 -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=BwoW/rV4B7gHbtt/8188qQxbiIZmdYlWzHwdaPENbyw=; b=b2nJrTZXs0tCuYmQ6PKutKStoIRcjvBBTkDjsi1KH+d8qHyvp3Ke30Umx1sMhcBxps7PM9kOiST9llzXgufoRXkw4mVbAVHqCoYcI/7utdTbx7NDF82RcTD65tvtmYN7pK8PQWLUU+vzp3dkuTxPRaUeTcvxUu3ZwZQkstCfy/vjVXM+TjYt8tZ56Qr6Te94xNTIYy4UXTeo9OntKzAbxQXdvLWoDAivGBDvsLK/wVREWJCPOXgOyJxKkreYLPyhf5PXRhByJxNatHKM9EMAeWOBotufjwNJwf6OR7kvS8mK+D3xnBChSOm1+cof5MUj4vbiolQ2rVrxideOhPMS4A== Received: from DM3NAM03FT037.eop-NAM03.prod.protection.outlook.com (10.152.82.54) by DM3NAM03HT177.eop-NAM03.prod.protection.outlook.com (10.152.82.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1220.9; Wed, 28 Jun 2017 18:23:16 +0000 Received: from DM5PR11MB1578.namprd11.prod.outlook.com (10.152.82.53) by DM3NAM03FT037.mail.protection.outlook.com (10.152.83.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.9 via Frontend Transport; Wed, 28 Jun 2017 18:23:16 +0000 Received: from DM5PR11MB1578.namprd11.prod.outlook.com ([10.172.37.22]) by DM5PR11MB1578.namprd11.prod.outlook.com ([10.172.37.22]) with mapi id 15.01.1220.014; Wed, 28 Jun 2017 18:23:16 +0000 From: Amit kumar To: TVKR CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] DisconnectController API not working. Thread-Index: AQHS75hjMKsTgloZWkq+l7R4P4v3bKI6Nw6AgAAYw1KAAAibgIAADuSAgAAdtICAAAmhzYAAAIcAgAAAudGAAAIgAIAAAq+LgAADOMI= Date: Wed, 28 Jun 2017 18:23:16 +0000 Message-ID: References: , , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:3A1CDE0105FED1AA25682AE0198E60916FDA4F42A77F9274F3363A5C45ADB20D; UpperCasedChecksum:85A205A6C09EDFE47EDB5039757E905C3020176FF558CD3C7DE552B8D756A39C; SizeAsReceived:8106; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [D+djlxdLTmtXfTY8MGepOZFOAVIW5lNp] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM3NAM03HT177; 7:t33bFE4cz0b00BIcsYe7+/9fkzJyfiacY8HSAk84KzxxBeR/PP++SZe4J3bNcU+8NTfyb5OAhy+H1JCpjwCDCqFfhF8ZHnR6JzJ9308CRgvSmKymnyysqono/0kxfCoWySjfdScIkLdvpXfAm05m+mWJscQ55lHdJnCPs8PrOaeQ8UUMVtxJ+WzJsnlhHmRuE9iIyUGz4pFPXaewMH9VN1AM08XUv5MG1AlxxUpqWebbZTnMlDCXUNyZf9nwoTJo984gm3OJNnmJp0WMAiwPLFNGidV0sPMJVw8k9RH9dgYbqUWfPmbISGdU4hK26vd98BIuN/oa4svWzm+uHq8FY9y7jiS8Nempsz63Qwd77stdilIjvbLsEd3lOxZY5jdMXqvDCWRi3Kxhp+ryHV6PSpjZdARCQlTocBccfiNW12Pn94dEY9Cd1GPH5UBV/STdZNGMQgqAcfUbr/3W+XVpjc2/rlrDOG83sfMA1jSxlyb/C4LDAF11UZ5ir8G7XcCtZRJHDaqrs0nBAXON9BdxLCELThubmOfgM+10HHFNCNS3o2ERk6g6c+u4K0oesONZo1TD8BbbvDOJ+nccxGIC3IHOQyGHNEv5okA5LWXeVWhBqWgdoHBmfl7llQu0RwynnTR9J2s+3hUuntXhxEM2BeHMKXYLhPKEW15eQcPAfsYd+dlUm1lhWYttkrsuHdouSfdIE0VJErixROoOay/ZrVrcHuSVZjY2BC1z0aPIE/fnZ7wPc/Fw49I8s28Z75D7eb7ewBT+MK97Qw/5KYgHUQ== x-incomingheadercount: 46 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:DM3NAM03HT177; H:DM5PR11MB1578.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: d780769c-2feb-4dc7-1679-08d4be52bed0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322274)(1603101448)(1601125374)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM3NAM03HT177; x-ms-traffictypediagnostic: DM3NAM03HT177: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031); SRVR:DM3NAM03HT177; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM3NAM03HT177; x-forefront-prvs: 03524FBD26 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2017 18:23:16.1644 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3NAM03HT177 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: Wed, 28 Jun 2017 18:21:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable EFI_STATUS EFIAPI UefiMain ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; gBS->DisconnectController ( ConvertHandleIndexToHandle (0x175), ConvertHandleIndexToHandle (0x176), NULL); return (Status); } ________________________________ 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. Try this; just a quick thing EFI_STATUS EFIAPI UefiMain ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; gBS->DisconnectController ( ConvertHandleIndexToHandle (175), ConvertHandleIndexToHandle (176), NULL); return (Status); } ________________________________ 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. Yes, the shell's in-built command disconnect (disconnect 175 176) worked bu= t DisconnectController call from the application still did not work. On Wed, Jun 28, 2017 at 12:56 PM, Amit kumar > wrote: okay, os tell me , did you try "disconnect 175 176" in UEFI shell ? ________________________________ From: TVKR > Sent: Wednesday, June 28, 2017 11:21:34 PM To: Amit kumar Cc: edk2-devel@lists.01.org Subject: Re: [edk2] DisconnectController API not working. 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). On Wed, Jun 28, 2017 at 12:50 PM, Amit kumar > wrote: Did it hang ? ________________________________ From: TVKR > Sent: Wednesday, June 28, 2017 10:45:13 PM To: Amit kumar Cc: edk2-devel@lists.01.org Subject: Re: [edk2] DisconnectController API not working. Thanks for the suggestion Amit. I tried the reconnect -r but it doesn't see= m to help. On Wed, Jun 28, 2017 at 10:29 AM, Amit kumar > 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=92t work I will help you fu= rther 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 BIO= S/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 j= ust give disconnect in uefi shell. 7. If still I doesn=92t work you can ping me I might suggest the other way = around. Amit On Jun 28, 2017, at 8:05 PM, TVKR > wrote: Hi Amit, Here is the output. It is the call 'gBS->DisconnectController (ControllerHa= ndle, NULL, NULL)' (where ControllerHandle=3D7219EA98) that doesn't seem to= correctly work. 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) 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 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 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 Thanks On Wed, Jun 28, 2017 at 9:07 AM, Amit kumar > wrote: Hi Tresko, >Hi Amit, >I am seeing the exact same issue on my system with DisconnectController. T= he shell command 'disconnect' works but when I use the gBS->DisconnectContr= oller >call from my application it doesn't seem to really disconnect the sa= me controller (even though the call returns SUCCESS) and it still appears t= o be managed by >driver. I even checked the ControllerHandle passed and it = looks correct. Were you able to resolve this eventually? Yes i was able to resolve it. It might be helpful if you can tell me the ou= tput of dh -d command. Thanks Amit ________________________________ From: TVKR > Sent: Wednesday, June 28, 2017 6:06:11 PM To: edk2-devel@lists.01.org; akamit91@hotma= il.com Subject: Re: [edk2] DisconnectController API not working. BTW, I ported the disconnect code (under ShellPkg\Library\UefiShellDriver1C= ommandsLib) to a standalone application and it fails too. Looks like there = is something else in the shell app that is taking care of properly disconne= cting the controller. Thanks On Tue, Jun 27, 2017 at 5:54 PM, TVKR > wrote: Hi Amit, I am seeing the exact same issue on my system with DisconnectController. Th= e shell command 'disconnect' works but when I use the gBS->DisconnectContro= ller 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 loo= ks 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 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. 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 b= ut 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 u= sing ConvertHandleToHandleIndex(ControllerHandle), the ControllerHandle lo= oks 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 fo= und. 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 =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 > ...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. > > Amit, > > It is always good to double check you are using the right ControllerHandl= e. > > 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); > > > 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel