On 9/22/25 12:53 PM, Geert Uytterhoeven wrote:
Hello Geert,
My only worry is that PCI_LOCKLESS_CONFIG may be selected on non-x86 one day, breaking your assumptions. IMHO, the mechanism behind this config option, introduced in commit 714fe383d6c9bd95 ("PCI: Provide Kconfig option for lockless config space accessors") looks very fragile to me: it is intended to be selected by an architecture, if "all" low level PCI configuration space accessors use their own serialization or can operate completely lockless. Usually we use the safer, inverted approach (PCI_NOLOCKLESS_CONFIG), to be selected by all drivers that do not adhere to the assumption. But perhaps I am missing something, and this does not depend on individual PCIe host drivers?
Regardless, improving that is clearly out-of-scope for this patch...
I could send a follow up patch which would add build-time assertion that PCI_LOCKLESS_CONFIG must not be selected for this driver to work. Would that be an option ?
Or simply just "depends on !CONFIG_PCI_LOCKLESS_CONFIG"? What do the PCIe maintainers think?
I send a patch in the meantime:
[PATCH] PCI: rcar-host: Add static assertion to check !PCI_LOCKLESS_CONFIG