From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in4.apple.com (mail-out4.apple.com [17.151.62.26]) (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 B37DE81EE6 for ; Thu, 15 Dec 2016 10:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1481825287; 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=v0t+rOwjfTVAvlC/1xuW/clpUmFqdWSh3F4hLSX84tQ=; b=0bX5fyiqqDVnEbLLPe/PdXbMr3u8tzQechZ0WyfaI2K5/XRm0+lIgf9+iRjNzGAP i5Y6NYq0jG/LpmhvOK9PujzBo1QZFpnaimgiXrWNK7UD8qJDImjWBsfRuvK8ZoN+ jUgubL68dn+QAi1ly92Ddt4C23CRdXHCTv074WoYqPwDwcfmWo2HGXYVUJYTWewj jD5WApqisqyZ/66jL7iRCk7SKHRNbU3v2jW/nRqz+fgYJp7FLyAwpwhhGl9tmJJ2 8EWTnIJfnKOWt7amYKPu9A6vvcVvmvqXd4mHWQbz1eNPdbUmPtXB7328f0ctMSCX jT4FCTHkpavM56+blEQKzw==; Received: from relay3.apple.com (relay3.apple.com [17.128.113.83]) by mail-in4.apple.com (Apple Secure Mail Relay) with SMTP id DE.0F.06020.70CD2585; Thu, 15 Dec 2016 10:08:07 -0800 (PST) X-AuditID: 11973e12-a7d449a000001784-69-5852dc070773 Received: from nwk-mmpp-sz08.apple.com (nwk-mmpp-sz08.apple.com [17.128.115.25]) by relay3.apple.com (Apple SCV relay) with SMTP id 68.BE.13773.70CD2585; Thu, 15 Dec 2016 10:08:07 -0800 (PST) MIME-version: 1.0 Received: from [17.153.87.84] by nwk-mmpp-sz08.apple.com (Oracle Communications Messaging Server 8.0.1.1.0 64bit (built Jun 15 2016)) with ESMTPSA id <0OI800JDUNPHO210@nwk-mmpp-sz08.apple.com>; Thu, 15 Dec 2016 10:08:07 -0800 (PST) Sender: afish@apple.com From: Andrew Fish Message-id: <744508F7-BA9E-4DEA-B065-010B01515EEC@apple.com> Date: Thu, 15 Dec 2016 10:08:05 -0800 In-reply-to: Cc: edk2-devel@lists.01.org To: Arka Sharma References: X-Mailer: Apple Mail (2.3226) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsUi2FAYrMt+JyjCYPIFfovNPT3sFnsOHWV2 YPLYOesuu0f37H8sAUxRXDYpqTmZZalF+nYJXBmLVn5hKvijVtHw4ztTA+MbxS5GTg4JAROJ 9Zd72bsYuTiEBPYySkyb/IgJJvHpajsTROIgo8T2V8/ZQRK8AoISPybfY+li5OBgFgiTuHDV D6LmLaNE14ZzrCA1wgLiEu/ObGIGsdkElCVWzP/ADlLPK2AjsflPCkSJhcSdh6vBdrEIqEqs PrSGDcTmFAiWePtmOZjNLCAt8XDicbCRIgLqEv13ZzGC2EICARIbuo+DnSAhICsx+5cXyAkS ApfZJO7c3sE8gVFoFpJLZyFcOgtsqpbE90etUGF5iYPnZSHCmhLP7n1ih7C1JZ68u8C6gJFt FaNQbmJmjm5mnoleYkFBTqpecn7uJkZQFEy3E9rBeGqV1SFGAQ5GJR7eBVuCIoRYE8uKK3MP MUpzsCiJ8644GBghJJCeWJKanZpakFoUX1Sak1p8iJGJg1OqgbHg5o19Hz7Y1x6au+HR6oC7 /36qPbJmimnmesjv4yzp+6JVePfPNQV3Hk6Qltvn/ffsQdME28UOF6RfScwsqWbZnZL99r3F ufyN11ze8Mz9svik8u2NS3O2/NvzunLfpsRevTa1CSvzHt7uWb9v674zHF8b+nU/phxT3Hp1 5qOQtz37v9VJH31srMRSnJFoqMVcVJwIAOEpdYhjAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUi2FAsqct+JyjCYPZvTovNPT3sFnsOHWV2 YPLYOesuu0f37H8sAUxRXDYpqTmZZalF+nYJXBmLVn5hKvijVtHw4ztTA+MbxS5GTg4JAROJ T1fbmSBsMYkL99azdTFycQgJHGSU2P7qOTtIgldAUOLH5HssXYwcHMwCYRIXrvpB1LxllOja cI4VpEZYQFzi3ZlNzCA2m4CyxIr5H9hB6nkFbCQ2/0mBKLGQuPNwNdguFgFVidWH1rCB2JwC wRJv3ywHs5kFpCUeTjwONlJEQF2i/+4sRhBbSCBAYkP3cbATJARkJWb/8prAKDALyXGzEI6b BTZIS+L7o1aosLzEwfOyEGFNiWf3PrFD2NoST95dYF3AyLaKUaAoNSex0lgvsaAgJ1UvOT93 EyM4mAuDdzD+WWZ1iFGAg1GJh3fBlqAIIdbEsuLK3EOMEhzMSiK82jeBQrwpiZVVqUX58UWl OanFhxgnMgK9OJFZSjQ5HxhreSXxhiYmBibGxmbGxuYm5rQUVhLn5XAOiBASSE8sSc1OTS1I LYI5iomDU6qBUftYzO4A25Wb7neY/XC2uCm2SPxOkHtWSNihrV/XLpb86qt6kmvm0+Z6/uZJ h/W+fyjn+bxfr1vv4wGN3Tnlfm/4cjR1J5i+887YsrXSgYf7iXTj3Yw9EzVmfA6dzzo166tM 3DH2tStelV8o7+5bonVlNn/MrapOOcHXByYsuiU3LY3r9SbR60osxRmJhlrMRcWJAKQ1kZPZ AgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: Closing PciIo protocol inside Stop() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2016 18:08:07 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Dec 15, 2016, at 3:15 AM, Arka Sharma wrote: > > I am wondering if the PciIo protocol instance for a PCI driver, is > opened with _BY_DRIVER | EXCLUSIVE in Start() function, is not closed > in the Stop() will the instance be uninstalled and the > ControllerHandle removed ? > Don't do that. The Start() and Stop() need to be symmetric. If you don't Stop() properly I think your Stop() function could get called again, and that would be really bad if you your driver was unloaded or something like that. > Also is it possible to Close() the PciIo in Stop() and reopen the > PciIo instance on the same controller handle from some other driver > image with _BY_DRIVER attribute and accessing Pci resources on the > ControllerHandle even after Stop() is called. I know it is not > recommended way but curious about it. Or it could be specific to the > implementation ? Maybe you should just ask what you want to do? If you just want to dump out PCI info you can use gEfiPciRootBridgeIoProtocolGuid ByProtocol. There is an example in the Shell PCI command: https://github.com/tianocore/edk2/blob/master/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c#L2537 Note: On a large server, or exotic SoC there could be multiple gEfiPciRootBridgeIoProtocolGuid instances, and the Shell command deals with that. Thanks, Andrew Fish > > Thanks & Regards, > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel