public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] i3c: Fix default I2C adapter timeout value
@ 2025-09-05 10:03 Jarkko Nikula
  2025-09-14 20:31 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Nikula @ 2025-09-05 10:03 UTC (permalink / raw)
  To: linux-i3c
  Cc: Alexandre Belloni, Frank Li, Boris Brezillon, Jarkko Nikula,
	stable, Wolfram Sang

Commit 3a379bbcea0a ("i3c: Add core I3C infrastructure") set the default
adapter timeout for I2C transfers as 1000 (ms). However that parameter
is defined in jiffies not in milliseconds.

With mipi-i3c-hci driver this wasn't visible until commit c0a90eb55a69
("i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers").

Fix this by setting the default timeout as HZ (CONFIG_HZ) not 1000.

Fixes: 1b84691e7870 ("i3c: dw: use adapter timeout value for I2C transfers")
Fixes: be27ed672878 ("i3c: master: cdns: use adapter timeout value for I2C transfers")
Fixes: c0a90eb55a69 ("i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers")
Fixes: a747e01adad2 ("i3c: master: svc: use adapter timeout value for I2C transfers")
Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Cc: <stable@vger.kernel.org> # 6.17
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v2:
- Stable Cc'ed just in case. While the incorrect default timeout value was
  introduced back in v5.0 it became visible only due to commits in
  v6.17-rc1 and if CONFIG_HZ != 1000.
- Added Fixes tag for the Renesas I3C controller. Thanks to
  Wolfram Sang <wsa+renesas@sang-engineering.com> for noticing.
- Added Reviewed-by tags from Frank and Wolfram.
---
 drivers/i3c/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 2ef898a8fd80..67a18e437f83 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2492,7 +2492,7 @@ static int i3c_master_i2c_adapter_init(struct i3c_master_controller *master)
 	strscpy(adap->name, dev_name(master->dev.parent), sizeof(adap->name));
 
 	/* FIXME: Should we allow i3c masters to override these values? */
-	adap->timeout = 1000;
+	adap->timeout = HZ;
 	adap->retries = 3;
 
 	id = of_alias_get_id(master->dev.of_node, "i2c");
-- 
2.47.2


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] i3c: Fix default I2C adapter timeout value
  2025-09-05 10:03 [PATCH v2] i3c: Fix default I2C adapter timeout value Jarkko Nikula
@ 2025-09-14 20:31 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2025-09-14 20:31 UTC (permalink / raw)
  To: linux-i3c, Jarkko Nikula; +Cc: Frank Li, Boris Brezillon, stable, Wolfram Sang

On Fri, 05 Sep 2025 13:03:20 +0300, Jarkko Nikula wrote:
> Commit 3a379bbcea0a ("i3c: Add core I3C infrastructure") set the default
> adapter timeout for I2C transfers as 1000 (ms). However that parameter
> is defined in jiffies not in milliseconds.
> 
> With mipi-i3c-hci driver this wasn't visible until commit c0a90eb55a69
> ("i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers").
> 
> [...]

Applied, thanks!

[1/1] i3c: Fix default I2C adapter timeout value
      https://git.kernel.org/i3c/c/f6fecd2759be

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-14 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 10:03 [PATCH v2] i3c: Fix default I2C adapter timeout value Jarkko Nikula
2025-09-14 20:31 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox