]> Git Repo - linux.git/commit
PCI: Fix devres regression in pci_intx()
authorPhilipp Stanner <[email protected]>
Thu, 25 Jul 2024 12:07:30 +0000 (14:07 +0200)
committerBjorn Helgaas <[email protected]>
Thu, 1 Aug 2024 17:56:06 +0000 (12:56 -0500)
commit00f89ae4e759a7eef07e4188e1534af7dd2c7e9c
treecf9339bed0f280f7fb2e4843ded6137b36c39c2a
parent8400291e289ee6b2bf9779ff1c83a291501f017b
PCI: Fix devres regression in pci_intx()

pci_intx() becomes managed if pcim_enable_device() has been called in
advance. Commit 25216afc9db5 ("PCI: Add managed pcim_intx()") changed this
behavior so that pci_intx() always leads to creation of a separate device
resource for itself, whereas earlier, a shared resource was used for all
PCI devres operations.

Unfortunately, pci_intx() seems to be used in some drivers' remove() paths;
in the managed case this causes a device resource to be created on driver
detach, which causes .probe() to fail if the driver is reloaded:

  pci 0000:00:1f.2: Resources present before probing

Fix the regression by only redirecting pci_intx() to its managed twin
pcim_intx() if the pci_command changes.

Link: https://lore.kernel.org/r/[email protected]
Fixes: 25216afc9db5 ("PCI: Add managed pcim_intx()")
Reported-by: Damien Le Moal <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Philipp Stanner <[email protected]>
[bhelgaas: add error message to commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Tested-by: Damien Le Moal <[email protected]>
drivers/pci/pci.c
This page took 0.043556 seconds and 4 git commands to generate.