lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240506154520.3886867-1-marc.ferland@sonatest.com>
Date: Mon,  6 May 2024 11:45:20 -0400
From: marc.ferland@...il.com
To: michal.simek@....com
Cc: andi.shyti@...nel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-i2c@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Marc Ferland <marc.ferland@...atest.com>
Subject: [PATCH] i2c: xiic: print error code when xiic_start_xfer fails

From: Marc Ferland <marc.ferland@...atest.com>

xiic_start_xfer can fail for different reasons:

- EBUSY: bus is busy or i2c messages still in tx_msg or rx_msg
- ETIMEDOUT: timed-out trying to clear the RX fifo
- EINVAL: wrong clock settings

Printing the error code helps identifying the root cause.

Signed-off-by: Marc Ferland <marc.ferland@...atest.com>
---
 drivers/i2c/busses/i2c-xiic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 71391b590ada..73729f0180a1 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1165,7 +1165,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 
 	err = xiic_start_xfer(i2c, msgs, num);
 	if (err < 0) {
-		dev_err(adap->dev.parent, "Error xiic_start_xfer\n");
+		dev_err(adap->dev.parent, "Error xiic_start_xfer: %d\n", err);
 		goto out;
 	}
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ