Skip to contentSkip to conversation

powerpc/eeh: Create PHB PEs after EEH is initialized

PATCH In review Benjamin Herrenschmidt 4 participants 7 messages Sep 7, 2017 – Sep 22, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 powerpc/eeh: Create PHB PEs after EEH is initialized

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

---
 arch/powerpc/kernel/eeh.c     |  4 ++++
 arch/powerpc/kernel/eeh_dev.c | 18 ------------------
 2 files changed, 4 insertions(+), 18 deletions(-)
arch/powerpc/kernel/eeh.c +4 -0
index 63992b2d8e15..f27eecd5ec7f 100644
@@ -1018,6 +1018,10 @@ int eeh_init(void)
 	} else if ((ret = eeh_ops->init()))
 		return ret;
 
+	/* Initialize PHB PEs */
+	list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
+		eeh_dev_phb_init_dynamic(hose);
+
 	/* Initialize EEH event */
 	ret = eeh_event_init();
 	if (ret)
arch/powerpc/kernel/eeh_dev.c +0 -18
index d6b2ca70d14d..0820b73288c0 100644
@@ -83,21 +83,3 @@ void eeh_dev_phb_init_dynamic(struct pci_controller *phb)
 	/* EEH PE for PHB */
 	eeh_phb_pe_create(phb);
 }
-
-/**
- * eeh_dev_phb_init - Create EEH devices for devices included in existing PHBs
- *
- * Scan all the existing PHBs and create EEH devices for their OF
- * nodes and their children OF nodes
- */
-static int __init eeh_dev_phb_init(void)
-{
-	struct pci_controller *phb, *tmp;
-
-	list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
-		eeh_dev_phb_init_dynamic(phb);
-
-	return 0;
-}
-
-core_initcall(eeh_dev_phb_init);
#2 lore raw
In reply to Benjamin Herrenschmidt
Quoted 4 lines · Benjamin Herrenschmidt

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

When did this break? Do we have a commit we can tag with Fixes: ? Stable?

I assume we want to merge this ASAP as a fix, I think I can safely take this without patch 2?

cheers

#3 lore raw
Quoted 7 lines · Michael Ellerman
Quoted 4 lines · Benjamin Herrenschmidt

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

Quoted 5 lines

When did this break? Do we have a commit we can tag with Fixes: ? Stable?

I assume we want to merge this ASAP as a fix, I think I can safely take this without patch 2?

Russell, can you help Michael with that ? I don't even remember what's in patch 2 :)

Cheers,
Ben.

#4 lore raw
In reply to Michael Ellerman
Quoted 7 lines · Michael Ellerman
Quoted 4 lines · Benjamin Herrenschmidt

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

Quoted 7 lines

When did this break? Do we have a commit we can tag with Fixes: ? Stable?

I assume we want to merge this ASAP as a fix, I think I can safely take this without patch 2?

cheers

Yes it should be merged ASAP as a fix, and fixes
5cb1f8fdddb7475f38ea9fba48da17c002eec90b.

#5 lore raw
Quoted 11 lines · Russell Currey
Quoted 10 lines · Michael Ellerman
Quoted 4 lines · Benjamin Herrenschmidt

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

When did this break? Do we have a commit we can tag with Fixes: ? Stable?

Quoted 7 lines
Quoted 4 lines

I assume we want to merge this ASAP as a fix, I think I can safely take this without patch 2?

cheers

Yes it should be merged ASAP as a fix, and fixes
5cb1f8fdddb7475f38ea9fba48da17c002eec90b.

Thanks. I've put patch 1 in fixes-test.

cheers

#6 lore raw
In reply to Benjamin Herrenschmidt
Quoted 7 lines · Benjamin Herrenschmidt

Otherwise we end up not yet having computed the right diag data size on powernv where EEH initialization is delayed, thus causing memory corruption later on when calling OPAL.

Patch 1 applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/3e77adeea3c5393c9b624832f65441

cheers