From: "Yury M." <yurypm@arista.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
James Sewart <jamessewart@arista.com>
Subject: Re: [PATCH] PCI: Stop waiting for link status after config read failure
Date: Mon, 21 Sep 2026 18:08:02 +0100 [thread overview]
Message-ID: <c52cc96e-b40a-45be-be9d-775ed3dfe3dd@arista.com> (raw)
In-Reply-To: <apvpr5Q6gu_3MODj@wunner.de>
On 9/5/26 11:06, Lukas Wunner wrote:
> It's repetitive because pcie_capability_read_word() already checks
> internally for pci_dev_is_disconnected():
>
> pcie_capability_read_word()
> pci_read_config_word()
> pci_dev_is_disconnected()
>
> I just thought that since you specifically want to bail out in the
> hot-removal case, it might be clearer to check pci_dev_is_disconnected()
> in pcie_wait_for_link_status() before performing the config space read.
>
> But I don't feel strongly either way and checking the return value of
> pcie_capability_read_word() is a viable approach as well.
I've sent v3 of the patch, returning to validating the
|pcie_capability_read_word()| return value.
Reasoning:
1.
I don't see any benefit to using |pci_dev_is_disconnected()|, other
than your point that it makes the code clearer or more readable.
2.
I checked how we set |pci_dev_is_disconnected()| now, and it looks
like failed reads don't guarantee that the device will immediately
be marked as disconnected. I assume that eventually we will receive
a link-status-changed interrupt and the device will then be marked
as disconnected.
3.
On the other hand, |pcie_capability_read_word()| internally performs
a |pci_dev_is_disconnected()| check. So in our context, validating
the |pcie_capability_read_word()| return value is more robust,
allowing us to react to device disappearance (for any reason) faster
and more reliably.
Thanks
next prev parent reply other threads:[~2026-09-21 17:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 11:13 Yury Murashka
2026-09-04 11:59 ` Ilpo Järvinen
2026-09-21 17:07 ` Yury M.
2026-09-04 12:20 ` Lukas Wunner
2026-09-04 15:36 ` Yury M.
2026-09-04 20:20 ` Ilpo Järvinen
2026-09-05 10:06 ` Lukas Wunner
2026-09-09 13:15 ` Yury M.
2026-09-21 17:08 ` Yury M. [this message]
2026-09-07 12:38 ` [PATCH v2] " Yury Murashka
2026-09-21 17:06 ` [PATCH v3] " Yury Murashka
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=c52cc96e-b40a-45be-be9d-775ed3dfe3dd@arista.com \
--to=yurypm@arista.com \
--cc=bhelgaas@google.com \
--cc=jamessewart@arista.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
all inboxes | Powered by JetHome®