[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331713973-7711-2-git-send-email-syrjala@sci.fi>
Date: Wed, 14 Mar 2012 10:32:53 +0200
From: Ville Syrjälä <syrjala@....fi>
To: linux-i2c@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
khali@...ux-fr.org, ben-linux@...ff.org,
Ville Syrjälä <syrjala@....fi>
Subject: [DEBUG PATCH] Print a message when a spurious i2c SCL timeout occurs.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists