]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv/pci: Drop pnv_phb->initialized
authorOliver O'Halloran <oohall@gmail.com>
Wed, 2 Sep 2020 01:36:57 +0000 (11:36 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 31 Jan 2021 11:35:51 +0000 (22:35 +1100)
commit80ba65d6f2ac3236a9b3a442c3369a32e6586607
treef23b1d184eb90d1eb2124c235e306cc8331597b5
parent40841f81516bea2596d599f9614492956f2d6694
powerpc/powernv/pci: Drop pnv_phb->initialized

The pnv_phb->initialized flag is an odd beast. It was added back in 2012 in
commit 153441a99c25 ("powerpc/powernv: Skip check on PE if necessary") to
allow devices to be enabled even if the device had not yet been assigned to
a PE. Allowing the device to be enabled before the PE is configured may
cause spurious EEH events since none of the IOMMU context has been setup.

I'm not entirely sure why this was ever necessary. My best guess is that it
was an workaround for a bug or some other undesireable behaviour from the
PCI core. Either way, it's unnecessary now since as of commit 8f96e5765535
("powerpc/powernv/pci: Re-work bus PE configuration") we can guarantee that
the PE will be configured before the PCI core will allow drivers to bind to
the device.

It's also worth pointing out that the ->initialized flag is only set in
pnv_pci_ioda_create_dbgfs(). That function has its entire body wrapped
in #ifdef CONFIG_DEBUG_FS. As a result, for kernels built without debugfs
(i.e. petitboot) the other checks in pnv_pci_enable_device_hook() are
bypassed entirely.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200902013657.1753830-1-oohall@gmail.com
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.h