powerpc/eeh: Add eeh_dev to the cache during boot

commit f8f7d63fd96ead101415a1302035137a866f8998 ("powerpc/eeh: Trace eeh
device from I/O cache") broke EEH on pseries for devices that were
present during boot and have not been hotplugged/DLPARed.

eeh_check_failure will get the eeh_dev from the cache, and will get
NULL. eeh_addr_cache_build adds the addresses to the cache, but eeh_dev
for the giving pci_device is not set yet. Just reordering the call to
eeh_addr_cache_insert_dev works fine. The ordering is similar to the one
in eeh_add_device_late.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by Thadeu Lima de Souza Cascardo and committed by Benjamin Herrenschmidt 1abd6018 b37e1613

Changed files
+2 -2
arch
powerpc
platforms
pseries
+2 -2
arch/powerpc/platforms/pseries/eeh_cache.c
··· 294 294 spin_lock_init(&pci_io_addr_cache_root.piar_lock); 295 295 296 296 for_each_pci_dev(dev) { 297 - eeh_addr_cache_insert_dev(dev); 298 - 299 297 dn = pci_device_to_OF_node(dev); 300 298 if (!dn) 301 299 continue; ··· 305 307 pci_dev_get(dev); /* matching put is in eeh_remove_device() */ 306 308 dev->dev.archdata.edev = edev; 307 309 edev->pdev = dev; 310 + 311 + eeh_addr_cache_insert_dev(dev); 308 312 309 313 eeh_sysfs_add_device(dev); 310 314 }