[Skiboot] [PATCH] hdata/i2c: warn on i2c devs marked as unknown in the hdat

Stewart Smith stewart at linux.vnet.ibm.com
Wed Sep 20 15:47:13 AEST 2017


From: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>

Some I2C devices are marked as unknown in the hdat.
Log the fact to see what/where/why.

Signed-off-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
Reviewed-by: Oliver O'Halloran <oohall at gmail.com>
[stewart at linux.vnet.ibm.com: warn rather than ignore]
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 hdata/i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hdata/i2c.c b/hdata/i2c.c
index cc127d5..e079756 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -226,6 +226,15 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		 */
 		i2c_addr = dev->i2c_addr >> 1;
 
+		/*
+		 * Some i2c devs are marked as unknown in the hdat.
+		 * Ignoring them.
+		 */
+		if (dev->type == 0xFF)
+			prlog(PR_WARN, "HDAT I2C: e%dp%d - unknown@%x "
+			      "(port 0x%x)\n", dev->i2cm_engine,
+			      dev->i2cm_port, i2c_addr, dev->i2c_port);
+
 		prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %x\n",
 			dev->i2cm_engine, dev->i2cm_port, i2c_addr);
 
-- 
2.7.4



More information about the Skiboot mailing list