powerpc/eeh: Add sysfs files in late probe
authorOliver O'Halloran <oohall@gmail.com>
Fri, 6 Mar 2020 07:38:59 +0000 (18:38 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Mar 2020 01:09:38 +0000 (12:09 +1100)
commit8645aaa87963439007773ed8862ae6a29ea15eae
treebfb6ff8490b586b1447f43ea3d32db83a6a57fe2
parent7053f80d96967d8e72e9f2a724bbfc3906ce2b07
powerpc/eeh: Add sysfs files in late probe

Move creating the EEH specific sysfs files into eeh_add_device_late()
rather than being open-coded all over the place. Calling the function is
generally done immediately after calling eeh_add_device_late() anyway. This
is also a correctness fix since currently the sysfs files will be added
even if the EEH probe happens to fail.

Similarly, on pseries we currently add the sysfs files before calling
eeh_add_device_late(). This is flat-out broken since the sysfs files
require the pci_dev->dev.archdata.edev pointer to be set, and that is done
in eeh_add_device_late().

Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200306073904.4737-1-oohall@gmail.com
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh.c
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/pseries/eeh_pseries.c