]> 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)
commitc4a5cdd73f3375581e4370c0321b460ec739a44c
treef23b1d184eb90d1eb2124c235e306cc8331597b5
parentde38ec23e1266e2dce063f3a8519d3686643eeaa
powerpc/powernv/pci: Drop pnv_phb->initialized

The pnv_phb->initialized flag is an odd beast. It was added back in 2012 in
commit 74e133566fb0 ("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 4a4563a23383
("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