[Skiboot] [PATCH 1/5] xscom: Initialize the data to a known value in xscom_read

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Sep 13 14:45:24 AEST 2016


In case of error, don't leave the data random. It helps debugging when
the user fails to check the error code. This happens due to a bug in the
PRD wrapper app.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xscom.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/xscom.c b/hw/xscom.c
index 1b7e896..4220312 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -415,6 +415,13 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
 	uint32_t gcid;
 	int64_t rc;
 
+	/* Due to a bug in some versions of the PRD wrapper app, errors
+	 * might not be properly forwarded to PRD, in which case the data
+	 * set here will be used. Rather than a random value let's thus
+	 * initialize the data to a known clean state.
+	 */
+	*val = 0xdeadbeefdeadbeefull;
+
 	/* Handle part ID decoding */
 	switch(partid >> 28) {
 	case 0: /* Normal processor chip */
-- 
2.7.4



More information about the Skiboot mailing list