2013-10-07 10:42:40

by Taras Kondratiuk

[permalink] [raw]
Subject: [PATCH] i2c: omap: Clear ARDY bit twice

Initially commit cb527ede1bf6ff2008a025606f25344b8ed7b4ac
"i2c-omap: Double clear of ARDY status in IRQ handler"
added a workaround for undocumented errata ProDB0017052.
But then commit 1d7afc95946487945cc7f5019b41255b72224b70
"i2c: omap: ack IRQ in parts" refactored code and missed
one of ARDY clearings. So current code violates errata.
It causes often i2c bus timeouts on my Pandaboard.

This patch adds a second clearing in place.

Signed-off-by: Grygorii Strashko <[email protected]>
Signed-off-by: Taras Kondratiuk <[email protected]>
---
Cc: Felipe Balbi <[email protected]>
Cc: Richard woodruff <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/i2c/busses/i2c-omap.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index f5d6de0..d69826e 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -939,6 +939,9 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
/*
* ProDB0017052: Clear ARDY bit twice
*/
+ if (stat & OMAP_I2C_STAT_ARDY)
+ omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ARDY);
+
if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
OMAP_I2C_STAT_AL)) {
omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY |
--
1.7.9.5


2013-10-10 07:55:36

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: omap: Clear ARDY bit twice

On Mon, Oct 07, 2013 at 01:41:59PM +0300, Taras Kondratiuk wrote:
> Initially commit cb527ede1bf6ff2008a025606f25344b8ed7b4ac
> "i2c-omap: Double clear of ARDY status in IRQ handler"
> added a workaround for undocumented errata ProDB0017052.
> But then commit 1d7afc95946487945cc7f5019b41255b72224b70
> "i2c: omap: ack IRQ in parts" refactored code and missed
> one of ARDY clearings. So current code violates errata.
> It causes often i2c bus timeouts on my Pandaboard.
>
> This patch adds a second clearing in place.
>
> Signed-off-by: Grygorii Strashko <[email protected]>
> Signed-off-by: Taras Kondratiuk <[email protected]>

Applied to for-current with stable tag, thanks!


Attachments:
(No filename) (699.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments