From: Yuanquan Chen Date: Tue, 2 Apr 2013 01:26:54 +0000 (+0000) Subject: powerpc/pci: fix PCI-e devices rescan issue on powerpc platform X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~66^2~72^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37f02195bee9c25ce44e25204f40b7961a6d7c9d;p=pandora-kernel.git powerpc/pci: fix PCI-e devices rescan issue on powerpc platform Powerpc initializes the DMA and IRQ information in pci_scan_child_bus()-> pcibios_fixup_bus()->pcibios_setup_bus_devices(). But for the devices which are hotpluged, bus->is added has been set for the first scan of the PCI-e bus, so the initialization code won't be called. Then the hotpluged devices' driver will fail to load. For example : The PCI-e device 0001:03:00.0 is the Intel PCI-e e1000e network card, remove it from the system: # echo 1 > /sys/bus/pci/devices/0001\:03\:00.0/remove # e1000e 0001:03:00.0 eth0: removed PHC Rescan it from it's bus: # echo 1 > /sys/bus/pci/devices/0001\:02\:00.0/rescan ... e1000e 0001:03:00.0: Disabling ASPM L0s L1 e1000e 0001:03:00.0: No usable DMA configuration, aborting e1000e: probe of 0001:03:00.0 failed with error -5 So we move the DMA & IRQ initialization code from pcibios_setup_devices() and construct a new function pcibios_enable_device. We call this function in pcibios_enable_device, which will be called by PCI-e rescan code. At the meanwhile, we avoid the the impact on cardbus. I also validate this patch with silicon's PCIe-sata which encounters the IRQ issue. Signed-off-by: Yuanquan Chen Cc: Benjamin Herrenschmidt Cc: Hiroo Matsumoto Signed-off-by: Michael Ellerman --- Reading git-diff-tree failed