lkml.org 
[lkml]   [2012]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[DEBUG PATCH] Print a message when a spurious i2c SCL timeout occurs.
Date
A quick hack to verify that the fix works as intended...

Do not apply.

---
drivers/i2c/algos/i2c-algo-bit.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index d25112e..3f547b5 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -89,6 +89,7 @@ static inline void scllo(struct i2c_algo_bit_data *adap)
static int sclhi(struct i2c_algo_bit_data *adap)
{
unsigned long start;
+ bool timeout = false;

setscl(adap, 1);

@@ -104,11 +105,16 @@ static int sclhi(struct i2c_algo_bit_data *adap)
* are processing data internally.
*/
if (time_after(jiffies, start + adap->timeout))
+ {
+ timeout = true;
break;
+ }
cond_resched();
}
if (!getscl(adap))
return -ETIMEDOUT;
+ if (timeout)
+ printk(KERN_CRIT "spurious i2c scl timeout\n");
#ifdef DEBUG
if (jiffies != start && i2c_debug >= 3)
pr_debug("i2c-algo-bit: needed %ld jiffies for SCL to go "
--
1.7.3.4


\
 
 \ /
  Last update: 2012-03-14 09:35    [W:0.043 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site