On Thu, Nov 20, 2025 at 01:21:47PM +0000, Shameer Kolothum wrote: > During PCI hotplug, in do_pci_register_device(), pci_init_bus_master() > is called before storing the pci_dev pointer in bus->devices[devfn]. > > This causes a problem if pci_init_bus_master() (via its > get_address_space() callback) attempts to retrieve the device using > pci_find_device(), since the PCI device is not yet visible on the bus. > > Fix this by moving the pci_init_bus_master() call to after the device > has been added to bus->devices[devfn]. > > This prepares for a subsequent patch where the accel SMMUv3 > get_address_space() callback retrieves the pci_dev to identify the > attached device type. > > No functional change intended. > > Cc: Michael S. Tsirkin <[email protected]> > Reviewed-by: Jonathan Cameron <[email protected]> > Reviewed-by: Eric Auger <[email protected]> > Signed-off-by: Shameer Kolothum <[email protected]>
Reviewed-by: Nicolin Chen <[email protected]>
