From: Lambert Wang <lambert.q.wang@gmail.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: "Krzysztof Wilczy??ski" <kw@linux.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: add pci_dev_is_alive API
Date: Thu, 27 May 2021 11:52:30 +0800 [thread overview]
Message-ID: <CAATamazbYRnTJuPKVt_ypu_PVPXN407dSmo1EyExXHH0aHeyaQ@mail.gmail.com> (raw)
In-Reply-To: <20210526181810.GA13052@wunner.de>
On Thu, May 27, 2021 at 2:18 AM Lukas Wunner <lukas@wunner.de> wrote:
>
> On Wed, May 26, 2021 at 02:12:38PM +0800, Lambert Wang wrote:
> > The user is our new PCI driver under development for WWAN devices .
> > Surprise removal could happen under multiple circumstances.
> > e.g. Exception, Link Failure, etc.
> >
> > We wanted this API to detect surprise removal or check device recovery
> > when AER and Hotplug are disabled.
>
> You may want to take a look at pci_dev_is_disconnected().
>
> Be aware of its limitations, which Bjorn has already pointed out
> and which are discussed in more detail under the following link
> in the "Surprise removal" section:
>
> https://lwn.net/Articles/767885/
>
Thanks for the suggestion and the article. Currently I prefer
pci_device_is_present() for my scenario.
e.g. pci_dev_is_disconnected() seems to use a cached value. If the
driver wants to check the device's absence
after it *senses* something abnormal, pci_device_is_present() is more suitable.
> Thanks,
>
> Lukas
next prev parent reply other threads:[~2021-05-27 3:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 12:59 [PATCH] pci: add pci_dev_is_alive API Lambert Wang
2021-05-25 13:20 ` Krzysztof Wilczyński
2021-05-26 6:12 ` Lambert Wang
2021-05-26 16:23 ` Bjorn Helgaas
2021-05-27 3:43 ` Lambert Wang
2021-05-26 18:18 ` Lukas Wunner
2021-05-27 3:52 ` Lambert Wang [this message]
2021-05-25 14:08 ` Bjorn Helgaas
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-all 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=CAATamazbYRnTJuPKVt_ypu_PVPXN407dSmo1EyExXHH0aHeyaQ@mail.gmail.com \
--to=lambert.q.wang@gmail.com \
--cc=bhelgaas@google.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
/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;
as well as URLs for NNTP newsgroup(s).