[Skiboot] [PATCH 1/6] i2c: Add more info to debug trace

Frederic Barrat fbarrat at linux.ibm.com
Mon Oct 18 23:37:46 AEDT 2021


Add the bus ID and device address when showing the result of an i2c
request. It makes debug easier when several requests are flying
simultaneously.

Signed-off-by: Frederic Barrat <fbarrat at linux.ibm.com>
---
 core/i2c.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/i2c.c b/core/i2c.c
index b4313d43..8f4c01c5 100644
--- a/core/i2c.c
+++ b/core/i2c.c
@@ -215,10 +215,11 @@ int64_t i2c_request_sync(struct i2c_request *req)
 				*(unsigned char *)(req->rw_buf+i));
 	}
 
-	prlog(PR_DEBUG, "I2C: %s req op=%x offset=%x buf=%s buflen=%d "
-	      "delay=%lu/%lld rc=%lld\n",
-	      (rc) ? "!!!!" : "----", req->op, req->offset,
-	      buf, req->rw_len, tb_to_msecs(waited), req->timeout, rc);
+	/* print the device address shifted by one to match all hw docs */
+	prlog(PR_DEBUG, "I2C: %s bus=%x req op=%x dev_addr=%x offset=%x buf=%s buflen=%d delay=%lu/%lld rc=%lld\n",
+	      (rc) ? "!!!!" : "----", req->bus->opal_id, req->op,
+	      req->dev_addr << 1, req->offset, buf, req->rw_len,
+	      tb_to_msecs(waited), req->timeout, rc);
 
 	return rc;
 }
-- 
2.31.1



More information about the Skiboot mailing list