linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] i2c: busses: i2c-omap: Increase timeout for i2c interrupt
@ 2015-07-10  5:09 Vignesh R
       [not found] ` <1436504994-31137-1-git-send-email-vigneshr-l0cyMroinI0@public.gmane.org>
  2015-07-10  8:46 ` Alexander Sverdlin
  0 siblings, 2 replies; 9+ messages in thread
From: Vignesh R @ 2015-07-10  5:09 UTC (permalink / raw)
  To: Tony Lindgren, Wolfram Sang
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Vignesh R

When system is under load and there is an i2c transaction running
following warning appears on the console:

[  730.003617] omap_i2c 48070000.i2c: controller timed out
[  731.023643] omap_i2c 48070000.i2c: controller timed out

This is because, the completion() call, which is done in bottom half of
the interrupt handler, happens after the timeout period(1s) has elapsed
for the wait_for_completion_timeout() in omap_i2c_xfer_msg(). The
interrupt is raised within a second but due to system load (or other
interrupts), the bottom half does not get scheduled within a second.
Hence even though the interrupt has happened within required time frame,
due to delayed scheduling of bottom half, spurious timeout errors are
reported on the console and i2c controller is reset.

i2c timeout is a rare condition, hence increase timeout to 60s in order
to avoid reporting false timeout events under load.

Signed-off-by: Vignesh R <vigneshr-l0cyMroinI0@public.gmane.org>
---

I reproduced this while running i2cdump in a loop and reading from flash
using dd command.

 drivers/i2c/busses/i2c-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index d1c22e3fdd14..fa7758f0302c 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -50,7 +50,7 @@
 #define OMAP_I2C_REV_ON_4430_PLUS	0x50400002
 
 /* timeout waiting for the controller to respond */
-#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(1000))
+#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(60 * 1000))
 
 /* timeout for pm runtime autosuspend */
 #define OMAP_I2C_PM_TIMEOUT		1000	/* ms */
-- 
2.4.5

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

end of thread, other threads:[~2015-07-10 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10  5:09 [RFC PATCH] i2c: busses: i2c-omap: Increase timeout for i2c interrupt Vignesh R
     [not found] ` <1436504994-31137-1-git-send-email-vigneshr-l0cyMroinI0@public.gmane.org>
2015-07-10  8:09   ` Roger Quadros
2015-07-10  8:46 ` Alexander Sverdlin
2015-07-10  9:09   ` Wolfram Sang
2015-07-10 13:17     ` Vignesh R
     [not found]       ` <559FC5D7.3000108-l0cyMroinI0@public.gmane.org>
2015-07-10 13:26         ` Alexander Sverdlin
2015-07-10 13:44           ` Vignesh R
     [not found]           ` <559FC7E9.1060003-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2015-07-10 13:48             ` Grygorii Strashko
2015-07-10 14:02     ` Grygorii Strashko

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