Skip to contentSkip to conversation

i2c:OMAP3:Errata workaround for spurious RDR event

PATCH Superseded Ulrik Bech Hald 3 participants 5 messages Jun 22, 2009 – Jun 23, 2009

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c:OMAP3:Errata workaround for spurious RDR event

Under certain rare conditions, I2C_STAT[13].RDR bit may be set, and the corresponding interrupt fire, even when there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software.

A check for OMAP_I2C_STAT_BB is introduced in the ISR to prevent further processing of RDR interrupt, if the bus is busy.

---
 drivers/i2c/busses/i2c-omap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-omap.c +9 -0
index ece0125..88feea1 100644
@@ -668,6 +668,15 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			omap_i2c_complete_cmd(dev, err);
 		if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
 			u8 num_bytes = 1;
+			/* 3430 I2C Errata 1.15
+			 * RDR could be set when the bus is busy, then
+			 * ignore the interrupt, and clear the bit.
+			 */
+			u8 stat2 = 0;
+			stat2 = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+			if (stat2 & OMAP_I2C_STAT_BB)
+				return IRQ_HANDLED;
+
 			if (dev->fifo_size) {
 				if (stat & OMAP_I2C_STAT_RRDY)
 					num_bytes = dev->fifo_size;
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 49 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Ulrik Bech Hald
Sent: Monday, June 22, 2009 3:25 PM
To: [email protected]
Cc: Hald, Ulrik Bech
Subject: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

Under certain rare conditions, I2C_STAT[13].RDR bit may be set, and the corresponding interrupt fire, even when there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software.

A check for OMAP_I2C_STAT_BB is introduced in the ISR to prevent further processing of RDR interrupt, if the bus is busy.

---
 drivers/i2c/busses/i2c-omap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-omap.c +9 -1
index ece0125..88feea1 100644
@@ -668,6 +668,15 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			omap_i2c_complete_cmd(dev, err);
 		if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
 			u8 num_bytes = 1;
+			/* 3430 I2C Errata 1.15
+			 * RDR could be set when the bus is busy, then
+			 * ignore the interrupt, and clear the bit.
+			 */
+			u8 stat2 = 0;
+			stat2 = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+			if (stat2 & OMAP_I2C_STAT_BB)
+				return IRQ_HANDLED;
+
 			if (dev->fifo_size) {
 				if (stat & OMAP_I2C_STAT_RRDY)
 					num_bytes = dev->fifo_size;
--

1.5.4.3

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

#2 lore raw

Sorry about that Jagadeesh, your name should definitely be in there. I was too quick on the "send" trigger :(

BR
Ulrik Bech Hald

Quoted 60 lines

-----Original Message-----
From: Pakaravoor, Jagadeesh
Sent: Monday, June 22, 2009 3:23 PM
To: Hald, Ulrik Bech; [email protected]
Cc: Hald, Ulrik Bech
Subject: RE: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

drivers/i2c/busses/i2c-

Quoted 23 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Ulrik Bech Hald
Sent: Monday, June 22, 2009 3:25 PM
To: [email protected]
Cc: Hald, Ulrik Bech
Subject: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

Under certain rare conditions, I2C_STAT[13].RDR bit may be set, and the corresponding interrupt fire, even when there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software.

A check for OMAP_I2C_STAT_BB is introduced in the ISR to prevent further processing of RDR interrupt, if the bus is busy.

---
 drivers/i2c/busses/i2c-omap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c- renamed from drivers/i2c/busses/i2c-omap.c +0 -0

omap.c

Quoted 26 lines

index ece0125..88feea1 100644

drivers/i2c/busses/i2c-omap.c +9 -1
@@ -668,6 +668,15 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			omap_i2c_complete_cmd(dev, err);
 		if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
 			u8 num_bytes = 1;
+			/* 3430 I2C Errata 1.15
+			 * RDR could be set when the bus is busy, then
+			 * ignore the interrupt, and clear the bit.
+			 */
+			u8 stat2 = 0;
+			stat2 = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+			if (stat2 & OMAP_I2C_STAT_BB)
+				return IRQ_HANDLED;
+
 			if (dev->fifo_size) {
 				if (stat & OMAP_I2C_STAT_RRDY)
 					num_bytes = dev->fifo_size;
--

1.5.4.3

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

#3 lore raw
In reply to Ulrik Bech Hald
Quoted 9 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Ulrik Bech Hald
Sent: Monday, June 22, 2009 11:25 PM
To: [email protected]
Cc: Hald, Ulrik Bech
Subject: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

Quoted 5 lines

Under certain rare conditions, I2C_STAT[13].RDR bit may be set, and the corresponding interrupt fire, even when there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software.

Is this workaround valid for omap2430 also?

Regards,
Nishanth Menon

#4 lore raw
Quoted 17 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Monday, June 22, 2009 11:21 PM
To: Hald, Ulrik Bech; [email protected]
Cc: Hald, Ulrik Bech
Subject: RE: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Ulrik Bech Hald
Sent: Monday, June 22, 2009 11:25 PM
To: [email protected]
Cc: Hald, Ulrik Bech
Subject: [PATCH 1/1] i2c:OMAP3:Errata workaround for spurious RDR event

Quoted 7 lines
Quoted 5 lines

Under certain rare conditions, I2C_STAT[13].RDR bit may be set, and the corresponding interrupt fire, even when there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software.

Is this workaround valid for omap2430 also?

Yes, this workaround should also be valid for OMAP2430 errata 1.67 (equivalent errata).

Quoted 2 lines

Regards,
Nishanth Menon

BR Ulrik