public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Arka Sharma <arka.sw1988@gmail.com>
To: Andrew Fish <afish@apple.com>
Cc: edk2-devel@lists.01.org
Subject: Re: Closing PciIo protocol inside Stop()
Date: Fri, 16 Dec 2016 14:52:09 +0530	[thread overview]
Message-ID: <CAPO=kN0iNmq8ww4jxAu1oJz1Y69gkGvBx-OTwhDTekz0xGxFaQ@mail.gmail.com> (raw)
In-Reply-To: <744508F7-BA9E-4DEA-B065-010B01515EEC@apple.com>

Actually I am thinking if it will be possible to use PciIo from a
driver on a ControllerHandle which managed by another driver which has
been stopped. So is it possible that driver which wants to access it
restarts the ControllerHandle with it's own DriverBindingHandle, or it
is that as soon as the driver closes PciIo and DevicePath on the
ControllerHandle inside Stop() function, the ControllerHandle is
destroyed.

On Thu, Dec 15, 2016 at 11:38 PM, Andrew Fish <afish@apple.com> wrote:
>
> On Dec 15, 2016, at 3:15 AM, Arka Sharma <arka.sw1988@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
>
> 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
>
>


  reply	other threads:[~2016-12-16  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 11:15 Closing PciIo protocol inside Stop() Arka Sharma
2016-12-15 18:08 ` Andrew Fish
2016-12-16  9:22   ` Arka Sharma [this message]
2016-12-16 18:57     ` Andrew Fish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPO=kN0iNmq8ww4jxAu1oJz1Y69gkGvBx-OTwhDTekz0xGxFaQ@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox