]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 4 Jun 2025 10:18:29 +0000 (12:18 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 3 Jul 2025 23:10:07 +0000 (01:10 +0200)
I2C adapters have their own timeout value which can be changed by
userspace if desired. Use it for I2C transfers. The default is 1Hz, so
the default behaviour is unchanged.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250604101831.56585-4-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/mipi-i3c-hci/core.c

index bc453869454082b5340f5f20a094baadd4398f74..60f1175f1f37ccc25f26c1924c433882ab677caa 100644 (file)
@@ -395,7 +395,7 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
        ret = hci->io->queue_xfer(hci, xfer, nxfers);
        if (ret)
                goto out;
-       if (!wait_for_completion_timeout(&done, HZ) &&
+       if (!wait_for_completion_timeout(&done, m->i2c.timeout) &&
            hci->io->dequeue_xfer(hci, xfer, nxfers)) {
                ret = -ETIME;
                goto out;