Thread (1 message) read the whole thread 1 message, 1 author, 2019-09-05

Re: [PATCH 0/2] Fix IOMMU setup for hotplugged devices on pseries

From: Shawn Anastasio <hidden>
Date: 2019-09-05 18:44:51
Also in: linux-pci

On 9/5/19 4:38 AM, Lukas Wunner wrote:
On Wed, Sep 04, 2019 at 11:22:13PM -0500, Shawn Anastasio wrote:
quoted
If anybody has more insight or a better way to fix this, please let me know.
Have you considered moving the invocation of pcibios_setup_device()
to pcibios_bus_add_device()?

The latter is called from pci_bus_add_device() in drivers/pci/bus.c.
At this point device_add() has been called, so the device exists in
sysfs.

Basically when adding a PCI device, the order is:

* pci_device_add() populates struct pci_dev, calls device_add(),
   binding the device to a driver is prevented
* after pci_device_add() has been called for all discovered devices,
   resources are allocated
* pci_bus_add_device() is called for each device,
   calls pcibios_bus_add_device() and binds the device to a driver
Thank you, this is exactly what I was looking for! Just tested and
this seems to work perfectly. I'll go ahead and submit a v2 that
does this instead.

Thanks again,
Shawn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help