diff mbox series

[Very,RFC,27/46] powernv/pci: Clear reserved PE freezes

Message ID 20191120012859.23300-28-oohall@gmail.com (mailing list archive)
State RFC
Headers show
Series [Very,RFC,01/46] powerpc/eeh: Don't attempt to restore VF config space after reset | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/merge (784eee1cc44801366d4f197e0ade7739ee8e1e83)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/next (0695f8bca93ea0c57f0e8e21b4b4db70183b3d1c)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch linus/master (c74386d50fbaf4a54fd3fe560f1abc709c0cff4b)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/fixes (7d6475051fb3d9339c5c760ed9883bc0a9048b21)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch linux-next (5d1131b4d61e52e5702e0fa4bcbec81ac7d6ef52)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Oliver O'Halloran Nov. 20, 2019, 1:28 a.m. UTC
When we scan an empty slot the PHB gets an Unsupported Request from the
downstream bridge when there's no device present at that BDFN.  Some older
PHBs (p7-IOC) don't allow further config space accesses while the PE is
frozen, so clear it here without bothering with the diagnostic log.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/platforms/powernv/pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Alexey Kardashevskiy Nov. 27, 2019, 3 a.m. UTC | #1
On 20/11/2019 12:28, Oliver O'Halloran wrote:
> When we scan an empty slot the PHB gets an Unsupported Request from the
> downstream bridge when there's no device present at that BDFN.  Some older
> PHBs (p7-IOC) don't allow further config space accesses while the PE is
> frozen, so clear it here without bothering with the diagnostic log.


This executes when EEH is not enabled (rather unsupported case) and the
patch allegedly extends support of some P7 none of which was ever
supported by the powernv platform, or was/is it? Thanks,


> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  arch/powerpc/platforms/powernv/pci.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
> index 36eea4bb514c..5b1f4677cdce 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -642,6 +642,19 @@ static void pnv_pci_config_check_eeh(struct pnv_phb *phb, u16 bdfn)
>  	if (fstate == OPAL_EEH_STOPPED_MMIO_FREEZE ||
>  	    fstate == OPAL_EEH_STOPPED_DMA_FREEZE  ||
>  	    fstate == OPAL_EEH_STOPPED_MMIO_DMA_FREEZE) {
> +
> +		/*
> +		 * Scanning an empty slot will result in a freeze on the reserved PE.
> +		 *
> +		 * Some old and bad PHBs block config space access to frozen PEs in
> +		 * addition to MMIOs, so unfreeze it here.
> +		 */
> +		if (pe_no == phb->ioda.reserved_pe_idx) {
> +			phb->unfreeze_pe(phb, phb->ioda.reserved_pe_idx,
> +					 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
> +			return;
> +		}
> +
>  		/*
>  		 * If PHB supports compound PE, freeze it for
>  		 * consistency.
>
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 36eea4bb514c..5b1f4677cdce 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -642,6 +642,19 @@  static void pnv_pci_config_check_eeh(struct pnv_phb *phb, u16 bdfn)
 	if (fstate == OPAL_EEH_STOPPED_MMIO_FREEZE ||
 	    fstate == OPAL_EEH_STOPPED_DMA_FREEZE  ||
 	    fstate == OPAL_EEH_STOPPED_MMIO_DMA_FREEZE) {
+
+		/*
+		 * Scanning an empty slot will result in a freeze on the reserved PE.
+		 *
+		 * Some old and bad PHBs block config space access to frozen PEs in
+		 * addition to MMIOs, so unfreeze it here.
+		 */
+		if (pe_no == phb->ioda.reserved_pe_idx) {
+			phb->unfreeze_pe(phb, phb->ioda.reserved_pe_idx,
+					 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
+			return;
+		}
+
 		/*
 		 * If PHB supports compound PE, freeze it for
 		 * consistency.