linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] generic timeout handling for Renesas drivers
@ 2015-06-20 18:48 Wolfram Sang
  2015-06-20 18:48 ` [PATCH 1/2] i2c: rcar: use adapter default for timeout Wolfram Sang
       [not found] ` <1434826104-16346-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-06-20 18:48 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-sh-u79uwXL29TY76Z2rM5mHXA, Magnus Damm, Simon Horman,
	Laurent Pinchart, Geert Uytterhoeven, Wolfram Sang

Here is a small patch series to make I2C timeout handling easier for users. It
is not so amazingly huge anymore and it can be modified via i2c-dev if wanted.

Wolfram Sang (2):
  i2c: rcar: use adapter default for timeout
  i2c: sh_mobile: use adapter default for timeout

 drivers/i2c/busses/i2c-rcar.c      | 2 +-
 drivers/i2c/busses/i2c-sh_mobile.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in

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

* [PATCH 1/2] i2c: rcar: use adapter default for timeout
  2015-06-20 18:48 [PATCH 0/2] generic timeout handling for Renesas drivers Wolfram Sang
@ 2015-06-20 18:48 ` Wolfram Sang
       [not found] ` <1434826104-16346-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-06-20 18:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-sh, Magnus Damm, Simon Horman, Laurent Pinchart,
	Geert Uytterhoeven, Wolfram Sang

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

5 seconds is a very large timeout, and it is hardcoded. Use the default
timeout from 'struct adapter' which is 1 second. It can also be modified
from userspace for specific workloads.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 9eef46254369b3..e57e520b4756a9 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -532,7 +532,7 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
 
 		timeout = wait_event_timeout(priv->wait,
 					     rcar_i2c_flags_has(priv, ID_DONE),
-					     5 * HZ);
+					     adap->timeout);
 		if (!timeout) {
 			ret = -ETIMEDOUT;
 			break;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in

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

* [PATCH 2/2] i2c: sh_mobile: use adapter default for timeout
       [not found] ` <1434826104-16346-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
@ 2015-06-20 18:48   ` Wolfram Sang
       [not found]     ` <1434826104-16346-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2015-06-20 18:48 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-sh-u79uwXL29TY76Z2rM5mHXA, Magnus Damm, Simon Horman,
	Laurent Pinchart, Geert Uytterhoeven, Wolfram Sang

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

5 seconds is a very large timeout, and it is hardcoded. Use the default
timeout from 'struct adapter' which is 1 second. It can also be modified
from userspace for specific workloads.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-sh_mobile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 7193bcfdd94013..67eb8d8256ca5d 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -751,7 +751,7 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
 		/* The interrupt handler takes care of the rest... */
 		k = wait_event_timeout(pd->wait,
 				       pd->sr & (ICSR_TACK | SW_DONE),
-				       5 * HZ);
+				       adap->timeout);
 		if (!k) {
 			dev_err(pd->dev, "Transfer request timed out\n");
 			if (pd->dma_direction != DMA_NONE)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in

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

* Re: [PATCH 2/2] i2c: sh_mobile: use adapter default for timeout
       [not found]     ` <1434826104-16346-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
@ 2015-06-20 18:53       ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-06-20 18:53 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-sh-u79uwXL29TY76Z2rM5mHXA, Magnus Damm, Simon Horman,
	Laurent Pinchart, Geert Uytterhoeven

[-- Attachment #1: Type: text/plain, Size: 90 bytes --]

> -				       5 * HZ);
> +				       adap->timeout);

This should be adapter->timeout :(


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-06-20 18:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-20 18:48 [PATCH 0/2] generic timeout handling for Renesas drivers Wolfram Sang
2015-06-20 18:48 ` [PATCH 1/2] i2c: rcar: use adapter default for timeout Wolfram Sang
     [not found] ` <1434826104-16346-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-06-20 18:48   ` [PATCH 2/2] i2c: sh_mobile: " Wolfram Sang
     [not found]     ` <1434826104-16346-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-06-20 18:53       ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).