linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: rk3x: fix interrupt handling issue
@ 2014-08-08  9:41 Addy Ke
  2014-08-08 10:15 ` Heiko Stübner
  2014-08-08 16:34 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Addy Ke @ 2014-08-08  9:41 UTC (permalink / raw)
  To: wsa-z923LK4zBo2bacvFa/9K2g, max.schwarz-BGeptl67XyCzQB+pC5nmwQ,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, olof-nZhT3qVonbNeoWH0uzbU5w,
	dianders-F7+t8E8rja9g9hUCZPvPmw
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, cf-TNX95d0MmH7DzftRWevZcw,
	xjq-TNX95d0MmH7DzftRWevZcw, huangtao-TNX95d0MmH7DzftRWevZcw,
	zyw-TNX95d0MmH7DzftRWevZcw, yzq-TNX95d0MmH7DzftRWevZcw,
	hj-TNX95d0MmH7DzftRWevZcw, kever.yang-TNX95d0MmH7DzftRWevZcw,
	hl-TNX95d0MmH7DzftRWevZcw, caesar.wang-TNX95d0MmH7DzftRWevZcw,
	zhengsq-TNX95d0MmH7DzftRWevZcw, Addy Ke

If slave holds scl, I2C_IPD[7] will be set 1 by controller
for debugging. Driver must ignore it.

[    5.752391] rk3x-i2c ff160000.i2c: unexpected irq in WRITE: 0x80
[    5.939027] rk3x-i2c ff160000.i2c: timeout, ipd: 0x80, state: 4

Signed-off-by: Addy Ke <addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 drivers/i2c/busses/i2c-rk3x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 9e3084c..eab49e6 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -399,7 +399,7 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
 	}
 
 	/* is there anything left to handle? */
-	if (unlikely(ipd == 0))
+	if (unlikely((ipd & REG_INT_ALL) == 0))
 		goto out;
 
 	switch (i2c->state) {
-- 
1.8.3.2

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

* Re: [PATCH] i2c: rk3x: fix interrupt handling issue
  2014-08-08  9:41 [PATCH] i2c: rk3x: fix interrupt handling issue Addy Ke
@ 2014-08-08 10:15 ` Heiko Stübner
  2014-08-08 16:34 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2014-08-08 10:15 UTC (permalink / raw)
  To: Addy Ke
  Cc: wsa, max.schwarz, olof, dianders, linux-i2c, linux-kernel, cf,
	xjq, huangtao, zyw, yzq, hj, kever.yang, hl, caesar.wang, zhengsq

Am Freitag, 8. August 2014, 17:41:40 schrieb Addy Ke:
> If slave holds scl, I2C_IPD[7] will be set 1 by controller
> for debugging. Driver must ignore it.
> 
> [    5.752391] rk3x-i2c ff160000.i2c: unexpected irq in WRITE: 0x80
> [    5.939027] rk3x-i2c ff160000.i2c: timeout, ipd: 0x80, state: 4
> 
> Signed-off-by: Addy Ke <addy.ke@rock-chips.com>

I checked the manuals, bits [31:7] are marked as reserved in all of them, so

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/i2c/busses/i2c-rk3x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index 9e3084c..eab49e6 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -399,7 +399,7 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
> }
> 
>  	/* is there anything left to handle? */
> -	if (unlikely(ipd == 0))
> +	if (unlikely((ipd & REG_INT_ALL) == 0))
>  		goto out;
> 
>  	switch (i2c->state) {

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

* Re: [PATCH] i2c: rk3x: fix interrupt handling issue
  2014-08-08  9:41 [PATCH] i2c: rk3x: fix interrupt handling issue Addy Ke
  2014-08-08 10:15 ` Heiko Stübner
@ 2014-08-08 16:34 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-08-08 16:34 UTC (permalink / raw)
  To: Addy Ke
  Cc: max.schwarz, heiko, olof, dianders, linux-i2c, linux-kernel, cf,
	xjq, huangtao, zyw, yzq, hj, kever.yang, hl, caesar.wang, zhengsq

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

On Fri, Aug 08, 2014 at 05:41:40PM +0800, Addy Ke wrote:
> If slave holds scl, I2C_IPD[7] will be set 1 by controller
> for debugging. Driver must ignore it.
> 
> [    5.752391] rk3x-i2c ff160000.i2c: unexpected irq in WRITE: 0x80
> [    5.939027] rk3x-i2c ff160000.i2c: timeout, ipd: 0x80, state: 4
> 
> Signed-off-by: Addy Ke <addy.ke@rock-chips.com>

Applied to for-next and added stable, thanks!


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

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

end of thread, other threads:[~2014-08-08 16:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08  9:41 [PATCH] i2c: rk3x: fix interrupt handling issue Addy Ke
2014-08-08 10:15 ` Heiko Stübner
2014-08-08 16:34 ` 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).