]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: master: svc: use adapter timeout value for I2C transfers
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 4 Jun 2025 10:18:30 +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: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250604101831.56585-5-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/svc-i3c-master.c

index 7e1a7cb94b4361131837b995316e9ebab1ca67d2..6d0eea80ea34885f6b740a158a7d60ab7666b368 100644 (file)
@@ -1708,7 +1708,7 @@ static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
 
        mutex_lock(&master->lock);
        svc_i3c_master_enqueue_xfer(master, xfer);
-       if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
+       if (!wait_for_completion_timeout(&xfer->comp, m->i2c.timeout))
                svc_i3c_master_dequeue_xfer(master, xfer);
        mutex_unlock(&master->lock);