Re: [PATCH] PCI/sysfs: Check IORESOURCE_DISABLED in resource mmap handler
From: Krzysztof Wilczyński
Date: Wed May 13 2026 - 01:08:42 EST
Hello,
> Thank you, but as you suggested above, I will update the patch to use
> pci_dev_is_disconnected() instead.
There also exists pci_device_is_present() which would attempt an actual
read of a vendor/device IDs, so if this succeeds, then you have a more
solid assurance that the device should be working. However, this adds
latency, and there might be side-effects, potentially...
I wonder, if for you, you could forfeit setting any flags on a resource,
which drivers don't customarily do, such that we would only rely on
checking pci_dev_is_disconnected() on our side, so to speak.
We won't be setting any precedent here, as the helpers such as
pci_read_config_byte(), perform this check internally already.
Bjorn and Ilpo might have different take on this, though.
Thank you!
Krzysztof