> On Dec 15, 2016, at 3:15 AM, Arka Sharma <arka.sw1...@gmail.com> 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 <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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel