Re: [PATCH v2 1/5] PCI: Add disconnected device checks to user config reads
From: Keith Busch
Date: Tue Nov 03 2026 - 13:30:02 EST
On Thu, Oct 29, 2026 at 12:20:25PM -0700, Matthew Wood wrote:
> Since commit 4b1038834739 ("PCI: Don't attempt config access to
> disconnected devices") the kernel config read accessors skip devices
> marked disconnected, returning PCIBIOS_DEVICE_NOT_FOUND and ~0 data.
> The user config read accessors still issue the read, and if the host
> bridge completes it with ~0 data and no error, they report success.
>
> Check pci_dev_is_disconnected() in pci_user_read_config_*() as well,
> failing with -ENODEV and ~0 data. Do the check after waiting for any
> pci_cfg_access_lock() holder so a reader blocked behind a reset also
> sees a device that was disconnected while it waited.
Looks good.
Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>