Re: [PATCH v3 2/2] PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV

From: Lukas Wunner

Date: Mon Oct 12 2026 - 06:23:53 EST


On Sun, Oct 11, 2026 at 09:01:45PM +0200, Alexander Gruhlke wrote:
> @@ -1235,8 +1237,12 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
>
> if (root && root->config_rrs_sv) {
> pci_read_config_dword(dev, PCI_VENDOR_ID, &id);
> - if (!pci_bus_rrs_vendor_id(id))
> - break;
> + if (!pci_bus_rrs_vendor_id(id)) {
> + if (PCI_POSSIBLE_ERROR(id) && dev->is_virtfn)
> + pci_read_config_dword(dev, PCI_COMMAND, &id);
> + if (!PCI_POSSIBLE_ERROR(id))
> + break;
> + }
> } else {
> pci_read_config_dword(dev, PCI_COMMAND, &id);
> if (!PCI_POSSIBLE_ERROR(id))

Lean and clean, thank you. The additional pci_read_config_dword()
exceeds 80 chars, but I guess Bjorn can fix that up when applying
if he dislikes it.

Reviewed-by: Lukas Wunner <lukas@xxxxxxxxx>