Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH 0/4] i3c: use adapter timeout value for I2C transfers
@ 2025-06-04 10:18 Wolfram Sang
  2025-06-04 10:18 ` [PATCH 4/4] i3c: master: svc: " Wolfram Sang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wolfram Sang @ 2025-06-04 10:18 UTC (permalink / raw)
  To: linux-i3c
  Cc: Wolfram Sang, Alexandre Belloni, Frank Li, imx, Miquel Raynal,
	Przemysław Gaj

All I3C adapters so far use a timeout of 1 second for I2C transfers. 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.

Found while finalizing the RFC for the upcoming Renesas I3C driver.
Looking forward to comments, tests...

Wolfram Sang (4):
  i3c: dw: use adapter timeout value for I2C transfers
  i3c: master: cdns: use adapter timeout value for I2C transfers
  i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers
  i3c: master: svc: use adapter timeout value for I2C transfers

 drivers/i3c/master/dw-i3c-master.c     | 2 +-
 drivers/i3c/master/i3c-master-cdns.c   | 2 +-
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 drivers/i3c/master/svc-i3c-master.c    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.47.2


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

* [PATCH 4/4] i3c: master: svc: use adapter timeout value for I2C transfers
  2025-06-04 10:18 [PATCH 0/4] i3c: use adapter timeout value for I2C transfers Wolfram Sang
@ 2025-06-04 10:18 ` Wolfram Sang
  2025-06-04 12:49   ` Miquel Raynal
  2025-06-04 14:53 ` [PATCH 0/4] i3c: " Frank Li
  2025-07-03 23:11 ` Alexandre Belloni
  2 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2025-06-04 10:18 UTC (permalink / raw)
  To: linux-i3c; +Cc: Wolfram Sang, Miquel Raynal, Frank Li, Alexandre Belloni, imx

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>
---
 drivers/i3c/master/svc-i3c-master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 7e1a7cb94b43..6d0eea80ea34 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -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);
 
-- 
2.47.2


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

* Re: [PATCH 4/4] i3c: master: svc: use adapter timeout value for I2C transfers
  2025-06-04 10:18 ` [PATCH 4/4] i3c: master: svc: " Wolfram Sang
@ 2025-06-04 12:49   ` Miquel Raynal
  0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2025-06-04 12:49 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i3c, Frank Li, Alexandre Belloni, imx

Hello Wolfram,

On 04/06/2025 at 12:18:30 +02, Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:

> 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>

Thanks,
Miquèl

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

* Re: [PATCH 0/4] i3c: use adapter timeout value for I2C transfers
  2025-06-04 10:18 [PATCH 0/4] i3c: use adapter timeout value for I2C transfers Wolfram Sang
  2025-06-04 10:18 ` [PATCH 4/4] i3c: master: svc: " Wolfram Sang
@ 2025-06-04 14:53 ` Frank Li
  2025-07-03 23:11 ` Alexandre Belloni
  2 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2025-06-04 14:53 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i3c, Alexandre Belloni, imx, Miquel Raynal,
	Przemysław Gaj

On Wed, Jun 04, 2025 at 12:18:26PM +0200, Wolfram Sang wrote:
> All I3C adapters so far use a timeout of 1 second for I2C transfers. 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.
>
> Found while finalizing the RFC for the upcoming Renesas I3C driver.
> Looking forward to comments, tests...

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>
> Wolfram Sang (4):
>   i3c: dw: use adapter timeout value for I2C transfers
>   i3c: master: cdns: use adapter timeout value for I2C transfers
>   i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers
>   i3c: master: svc: use adapter timeout value for I2C transfers
>
>  drivers/i3c/master/dw-i3c-master.c     | 2 +-
>  drivers/i3c/master/i3c-master-cdns.c   | 2 +-
>  drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
>  drivers/i3c/master/svc-i3c-master.c    | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
> --
> 2.47.2
>

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

* Re: [PATCH 0/4] i3c: use adapter timeout value for I2C transfers
  2025-06-04 10:18 [PATCH 0/4] i3c: use adapter timeout value for I2C transfers Wolfram Sang
  2025-06-04 10:18 ` [PATCH 4/4] i3c: master: svc: " Wolfram Sang
  2025-06-04 14:53 ` [PATCH 0/4] i3c: " Frank Li
@ 2025-07-03 23:11 ` Alexandre Belloni
  2 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2025-07-03 23:11 UTC (permalink / raw)
  To: linux-i3c, Wolfram Sang; +Cc: Frank Li, imx, Miquel Raynal, Przemysław Gaj

On Wed, 04 Jun 2025 12:18:26 +0200, Wolfram Sang wrote:
> All I3C adapters so far use a timeout of 1 second for I2C transfers. 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.
> 
> Found while finalizing the RFC for the upcoming Renesas I3C driver.
> Looking forward to comments, tests...
> 
> [...]

Applied, thanks!

[1/4] i3c: dw: use adapter timeout value for I2C transfers
      https://git.kernel.org/abelloni/c/1b84691e7870
[2/4] i3c: master: cdns: use adapter timeout value for I2C transfers
      https://git.kernel.org/abelloni/c/be27ed672878
[3/4] i3c: mipi-i3c-hci: use adapter timeout value for I2C transfers
      https://git.kernel.org/abelloni/c/c0a90eb55a69
[4/4] i3c: master: svc: use adapter timeout value for I2C transfers
      https://git.kernel.org/abelloni/c/a747e01adad2

Best regards,

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

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

end of thread, other threads:[~2025-07-03 23:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-04 10:18 [PATCH 0/4] i3c: use adapter timeout value for I2C transfers Wolfram Sang
2025-06-04 10:18 ` [PATCH 4/4] i3c: master: svc: " Wolfram Sang
2025-06-04 12:49   ` Miquel Raynal
2025-06-04 14:53 ` [PATCH 0/4] i3c: " Frank Li
2025-07-03 23:11 ` Alexandre Belloni

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