[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9be9d4bef9fd6d0b66534a3731b4bc6b86cc79ab.1759838476.git.matthias.schiffer@ew.tq-group.com>
Date: Tue, 7 Oct 2025 14:09:25 +0200
From: Matthias Schiffer <matthias.schiffer@...tq-group.com>
To: Peter Korsgaard <peter@...sgaard.com>,
Andrew Lunn <andrew@...n.ch>,
Andi Shyti <andi.shyti@...nel.org>
Cc: linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux@...tq-group.com,
Matthias Schiffer <matthias.schiffer@...tq-group.com>
Subject: [PATCH 2/2] i2c: ocores: respect adapter timeout in IRQ mode
While the timeout field of the i2c_adapter defaults to 1s, it can be
changed, for example using the I2C_TIMEOUT ioctl. Change the ocores
driver to use this timeout instead of hardcoding 1s, also making it
consistent with polling mode.
Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
---
drivers/i2c/busses/i2c-ocores.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 1746c8821a149..518e4cf821a7a 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -380,7 +380,8 @@ static int ocores_xfer_core(struct ocores_i2c *i2c,
} else {
if (wait_event_timeout(i2c->wait,
(i2c->state == STATE_ERROR) ||
- (i2c->state == STATE_DONE), HZ) == 0)
+ (i2c->state == STATE_DONE),
+ i2c->adap.timeout) == 0)
ret = -ETIMEDOUT;
}
if (ret) {
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
Powered by blists - more mailing lists