From: Kelsey Skunberg <skunberg.kelsey@gmail.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
skhan@linuxfoundation.org, rafael.j.wysocki@intel.com,
keith.busch@intel.com
Subject: Re: [PATCH 2/2] PCI: Unify pci_dev_is_disconnected() and pci_dev_is_inaccessible()
Date: Thu, 5 Sep 2019 00:43:07 -0600 [thread overview]
Message-ID: <20190905064307.GA43579@JATN> (raw)
In-Reply-To: <20190904053523.7lmuoo5zempxtsdq@wunner.de>
On Wed, Sep 04, 2019 at 07:35:23AM +0200, Lukas Wunner wrote:
> On Tue, Sep 03, 2019 at 10:36:35PM -0600, Kelsey Skunberg wrote:
> > Change pci_dev_is_disconnected() call inside pci_dev_is_inaccessible() to:
> >
> > pdev->error_state == pci_channel_io_perm_failure
> >
> > Change remaining pci_dev_is_disconnected() calls to
> > pci_dev_is_inaccessible() calls.
>
> I don't think that's a good idea because it introduces a config space read
> (for the vendor ID) in places where we don't want that. E.g., after the
> check of pdev->error_state, a regular config space read may take place and
> if that returns all ones, we may already be able to determine that the
> device is inaccessible, obviating the need for a vendor ID check.
> Config space reads aren't for free.
>
> Thanks,
>
> Lukas
Good note. I definitely see why that would be undesirable. Thanks for
taking the time to point this out, Lukas. I'll look this over again to see
if a better solution can be done, or as Bjorn suggested, at least see if
clarification on when to use one vs. the other can be included.
Thanks again!
-Kelsey
prev parent reply other threads:[~2019-09-05 6:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 4:36 [PATCH 0/2] PCI: Change to using pci_dev_is_inaccessible() Kelsey Skunberg
2019-09-04 4:36 ` [PATCH 1/2] PCI: Change pci_device_is_present() to pci_dev_is_inaccessible() Kelsey Skunberg
2019-09-04 4:36 ` [PATCH 2/2] PCI: Unify pci_dev_is_disconnected() and pci_dev_is_inaccessible() Kelsey Skunberg
2019-09-04 5:35 ` Lukas Wunner
2019-09-04 18:45 ` Bjorn Helgaas
2019-09-05 6:43 ` Kelsey Skunberg [this message]
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=20190905064307.GA43579@JATN \
--to=skunberg.kelsey@gmail.com \
--cc=bhelgaas@google.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=rafael.j.wysocki@intel.com \
--cc=skhan@linuxfoundation.org \
/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).