diff mbox series

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

Message ID 20211018123751.72794-2-fbarrat@linux.ibm.com
State Superseded
Headers show
Series PCI hotplug on Rainier (and ZZ) | expand

Commit Message

Frederic Barrat Oct. 18, 2021, 12:37 p.m. UTC
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@linux.ibm.com>
---
 core/i2c.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

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;
 }