Skip to contentSkip to conversation

i2c-omap: Double clear of ARDY status in IRQ handler

PATCH In review Keerthy 2 participants 3 messages Feb 16, 2011 – Feb 18, 2011 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH v2 1/1 i2c-omap: Double clear of ARDY status in IRQ handler

From: Richard woodruff <[email protected]>

This errata occurs when the ARDY interrupt generation is enabled. At the begining of every new transaction the ARDY interrupt is cleared.

On continuous i2c transactions where after clearing the ARDY bit from I2C_STAT register (clearing the interrupt), the IRQ line is reasserted and the I2C_STAT[ARDY] bit set again on 1. In fact, the ARDY status bit is not cleared at the write access to I2C_STAT[ARDY] and only the IRQ line is deasserted and then reasserted. This is not captured in the usual errata documents.

The workaround is to have a double clear of ARDY status in irq handler.

---
 drivers/i2c/busses/i2c-omap.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +5 -1
index b605ff3..5b35cf4 100644
@@ -847,11 +847,15 @@ complete:
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
 		}
+		/* 
+		 * ProDB0017052: Clear ARDY bit twice
+		 */ 
 		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
 					OMAP_I2C_STAT_AL)) {
 			omap_i2c_ack_stat(dev, stat &
 				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
-				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
+				OMAP_I2C_STAT_ARDY));
 			omap_i2c_complete_cmd(dev, err);
 			return IRQ_HANDLED;
 		}
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 5 lines · Keerthy

From: Richard woodruff <[email protected]>

This errata occurs when the ARDY interrupt generation is enabled. At the begining of every new transaction the ARDY interrupt is cleared.

Quoted 7 lines

On continuous i2c transactions where after clearing the ARDY bit from I2C_STAT register (clearing the interrupt), the IRQ line is reasserted and the I2C_STAT[ARDY] bit set again on 1. In fact, the ARDY status bit is not cleared at the write access to I2C_STAT[ARDY] and only the IRQ line is deasserted and then reasserted. This is not captured in the usual errata documents.

The workaround is to have a double clear of ARDY status in irq handler.

I'll add this to omap-testing for few days and then if no issue Ben can merge this.

Regards,

Tony

Quoted 34 lines
---
 drivers/i2c/busses/i2c-omap.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +5 -1
index b605ff3..5b35cf4 100644
@@ -847,11 +847,15 @@ complete:
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
 		}
+		/* 
+		 * ProDB0017052: Clear ARDY bit twice
+		 */ 
 		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
 					OMAP_I2C_STAT_AL)) {
 			omap_i2c_ack_stat(dev, stat &
 				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
-				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
+				OMAP_I2C_STAT_ARDY));
 			omap_i2c_complete_cmd(dev, err);
 			return IRQ_HANDLED;
 		}
Signature · 6 lines
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#3 lore raw
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Keerthy

From: Richard woodruff <[email protected]>

This errata occurs when the ARDY interrupt generation is enabled. At the begining of every new transaction the ARDY interrupt is cleared.

On continuous i2c transactions where after clearing the ARDY bit from I2C_STAT register (clearing the interrupt), the IRQ line is reasserted and the I2C_STAT[ARDY] bit set again on 1. In fact, the ARDY status bit is not cleared at the write access to I2C_STAT[ARDY] and only the IRQ line is deasserted and then reasserted. This is not captured in the usual errata documents.

Quoted 4 lines
Quoted 1 line

The workaround is to have a double clear of ARDY status in irq handler.

I'll add this to omap-testing for few days and then if no issue Ben can merge this.

Thanks Tony.

Quoted 40 lines

Regards,

Tony

Quoted 34 lines

---
 drivers/i2c/busses/i2c-omap.c |    6 +++++-

 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +3 -0
index b605ff3..5b35cf4 100644
@@ -847,11 +847,15 @@ complete:
                       dev_err(dev->dev, "Arbitration lost\n");
                       err |= OMAP_I2C_STAT_AL;
               }
+             /*
+              * ProDB0017052: Clear ARDY bit twice
+              */

              if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) { omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
-                             OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+                             OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
+                             OMAP_I2C_STAT_ARDY)); omap_i2c_complete_cmd(dev, err); return IRQ_HANDLED;
              }
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Regards and Thanks,
Keerthy