Re: [PATCH 2/5] PCI/sysfs: Use user config accessors for bus number attributes
From: Keith Busch
Date: Mon Oct 26 2026 - 11:07:28 EST
On Sat, Oct 24, 2026 at 05:08:30PM -0700, Matthew Wood wrote:
> secondary_bus_number and subordinate_bus_number read config space with
> pci_read_config_byte(). The kernel config accessors don't check
> block_cfg_access, so a read that races with a reset goes to the device
> mid-reset and can fail or return a bogus bus number.
>
> Use pci_user_read_config_byte() instead, as the "config" attribute does,
> so the read waits for any pci_cfg_access_lock() holder (e.g.
> pci_reset_function()) to finish.
Looks good.
Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>