diff mbox series

[v3,5/5] phb4: Update some comments

Message ID 20190201035746.14029-5-oohall@gmail.com
State Accepted
Headers show
Series [v3,1/5] phb4: Rework BDFN filtering in phb4_set_pe() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master

Commit Message

Oliver O'Halloran Feb. 1, 2019, 3:57 a.m. UTC
I now know what an IODA cache is and I'm not happy about it. With
the power of Comments™ you too can share the misery.

Remove the big WARNING about the P8 specific hardware bug while
we're here. That seems to have been copied over from phb3.c and
no one thought about it too hard.

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
v3: Elaborated a bit on what phb4_init_ioda_cache() does.
---
 hw/phb4.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index 9ece0f05cd41..48969fa187e1 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -898,30 +898,24 @@  static uint64_t phb4_default_mbt0(struct phb4 *p, unsigned int bar_idx)
 	return mbt0;
 }
 
-/* Clear IODA cache tables */
+/*
+ * Clear the saved (cached) IODA state.
+ *
+ * The caches here are used to save the configuration of the IODA tables
+ * done by the OS. When the PHB is reset it loses all of its internal state
+ * so we need to keep a copy to restore from. This function re-initialises
+ * the saved state to sane defaults.
+ */
 static void phb4_init_ioda_cache(struct phb4 *p)
 {
 	uint32_t i;
 
 	/*
-	 * RTT and PELTV. RTE should be 0xFF's to indicate
-	 * invalid PE# for the corresponding RID.
-	 *
-	 * Note: Instead we set all RTE entries to 0x00 to
-	 * work around a problem where PE lookups might be
-	 * done before Linux has established valid PE's
-	 * (during PCI probing). We can revisit that once/if
-	 * Linux has been fixed to always setup valid PEs.
-	 *
-	 * The value 0x00 corresponds to the default PE# Linux
-	 * uses to check for config space freezes before it
-	 * has assigned PE# to busses.
-	 *
-	 * WARNING: Additionally, we need to be careful, there's
-	 * a HW issue, if we get an MSI on an RTT entry that is
-	 * FF, things will go bad. We need to ensure we don't
-	 * ever let a live FF RTT even temporarily when resetting
-	 * for EEH etc... (HW278969).
+	 * The RTT entries (RTE) are supposed to be initialised to
+	 * 0xFF which indicates an invalid PE# for that RTT index
+	 * (the bdfn). However, we set them to 0x00 since Linux
+	 * needs to find the devices first by scanning config space
+	 * and this occurs before PEs have been assigned.
 	 */
 	for (i = 0; i < RTT_TABLE_ENTRIES; i++)
 		p->tbl_rtt[i] = PHB4_RESERVED_PE_NUM(p);