From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in2.apple.com (mail-out2.apple.com [17.151.62.25]) (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 7D7A921A0483B for ; Fri, 31 Mar 2017 10:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1490980330; 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=sGaP6zHBLwWyxDyFC5I59HoyN7sAvKuwWE0ov/C85vM=; b=dIdqJmif/qpCJAYuTMXEM6uDDnkMmDzghXADUeYIDT39UjWSpHWVrAGcWNl9W89j CyVB58vltBf0jffK5/bzWWbUCeCRnPyCH2R1dBm2OxdcyWR0Vu1atHO7ikDkxLO8 YjupNqCvpY66cAmC76x47GHb68zP0gvG0ozO6yZvwEVM1ZNWNFhL2zpsmJefSULX /pBQ822q9rM7LlLy80gXzcGYwEQlNGNx7UELiYoFKX4obKOrxTZk52i6RNv8wiY/ 6e/+PomJInKT2sGTMsITF1uVncTo0euOJSjVptzwXYbtOp1T3Q6dHqQehmJKkqGo hU1kj7/upchwxKHuSFyjJg==; Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) by mail-in2.apple.com (Apple Secure Mail Relay) with SMTP id 56.4A.29388.AED8ED85; Fri, 31 Mar 2017 10:12:10 -0700 (PDT) X-AuditID: 11973e11-822329a0000072cc-e1-58de8deab41c Received: from nwk-mmpp-sz10.apple.com (nwk-mmpp-sz10.apple.com [17.128.115.122]) by relay6.apple.com (Apple SCV relay) with SMTP id CC.4F.31597.9ED8ED85; Fri, 31 Mar 2017 10:12:10 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.32.126] (unknown [17.153.32.126]) by nwk-mmpp-sz10.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0ONO00BAVVS8DO00@nwk-mmpp-sz10.apple.com>; Fri, 31 Mar 2017 10:12:09 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <37439A6C-0D5F-45E8-B634-1841B73268CE@apple.com> Date: Fri, 31 Mar 2017 10:12:08 -0700 In-reply-to: Cc: "edk2-devel@lists.01.org" To: Amit kumar References: X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsUi2FAYpfuq916EweoGbot9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDLe/X/JUjBnHWNF37s2pgbGb3MZuxg5OSQE TCSOr5nL3sXIxSEksJdRYuO570wwiZn7+lggEocYJS7NXQfWwSsgKPFj8j0WEJtZIEzi1par UN0TmSRm/FgClhAWEJd4d2YTM4jNJqAssWL+B3aIZhuJg73PWSFqrCQ6p60Cs1kEVCUmnmkF W8ApEC+xeMJBRogF5hIzLnwBu0gEqKa/fQrQHA6gZXES7Tc1IQ6Vlbg1+xIzyA0SAgfYJG79 +sUygVFoFpJbZyG5FcLWkvj+qBUozgFky0scPC8LEdaUeHbvE1SJtsSTdxdYFzCyrWIUyk3M zNHNzDPSSywoyEnVS87P3cQIiofpdoI7GI+vsjrEKMDBqMTDe8L7XoQQa2JZcWXuIUZpDhYl cd5HnXcjhATSE0tSs1NTC1KL4otKc1KLDzEycXBKNTCGcjJ1XmI70Ssn+2LZrUvKpV+3t+// V5Rx/Q+/vcPPC+XX26wtrr3m0Xhy7+jV3nWztknF+CecM9172p3zj8StgLT2MwmLO28/vZoh yhNi0x81J+LP3k3asvudeO+6qxuq5x13ly6bN12Py2T6uWBT68PtXzNOeqes1xY8Ouvaqoh1 2zh+G7oosRRnJBpqMRcVJwIA5iwvxGgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsUi2FBcpfuq916EwayJTBb7Xu9ksthz6Ciz A5PH454zbB7ds/+xBDBFcdmkpOZklqUW6dslcGW8+/+SpWDOOsaKvndtTA2M3+YydjFyckgI mEjM3NfH0sXIxSEkcIhR4tLcdWAJXgFBiR+T77GA2MwCYRK3tlxlhyiayCQx48cSsISwgLjE uzObmEFsNgFliRXzP7BDNNtIHOx9zgpRYyXROW0VmM0ioCox8Uwr2AJOgXiJxRMOMkIsMJeY ceELE4gtAlTT3z4FaA4H0LI4ifabmhCHykrcmn2JeQIj/ywk581Cch6ErSXx/VErUJwDyJaX OHheFiKsKfHs3ieoEm2JJ+8usC5gZFvFKFCUmpNYaaaXWFCQk6qXnJ+7iREcvoVROxgbllsd YhTgYFTi4VXwuxchxJpYVlyZCwwjDmYlEV6ZHKAQb0piZVVqUX58UWlOavEhxomMQD9OZJYS Tc4HRldeSbyhiYmBibGxmbGxuYk5LYWVxHlzyoEuEkhPLEnNTk0tSC2COYqJg1OqgbFlracc o4vP/CxO4TfXNgSvsTrYmnKQ9dfZ2YJz5G/mCs69cjiGTbHy7IReS7P2CtVVj3/tVnC9UqTD be/80et71briy5e58lQ0J2x+vbnrw0yrmDNPi2Vv3okNPxh57ervk4Lf53xhq97+LPnsRelj q3z/Pdj7SceRJZT7Z5SW5qRfh44+yLFVYinOSDTUYi4qTgQAG2PAINICAAA= 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: Fri, 31 Mar 2017 17:12:10 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > 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