From: Yijing Wang Date: Mon, 9 Mar 2015 02:33:58 +0000 (+0800) Subject: PCI: Assign resources before drivers claim devices (pci_scan_bus()) X-Git-Tag: omap-for-v4.1/fixes-rc1~172^2~2^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c90570d9511d42421c85709b46bffd366185d835;p=pandora-kernel.git PCI: Assign resources before drivers claim devices (pci_scan_bus()) Previously, pci_scan_bus() created a root PCI bus, enumerated the devices on it, and called pci_bus_add_devices(), which made the devices available for drivers to claim them. Most callers assigned resources to devices after pci_scan_bus() returns, which may be after drivers have claimed the devices. This is incorrect; the PCI core should not change device resources while a driver is managing the device. Remove pci_bus_add_devices() from pci_scan_bus() and do it after any resource assignment in the callers. [bhelgaas: changelog, check for failure in mcf_pci_init()] Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas CC: "David S. Miller" CC: Geert Uytterhoeven CC: Guan Xuetao CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner --- Reading git-diff-tree failed