Skip to contentSkip to conversation

i2c: i2c-omap: Reliablity and register fixes

PATCH New Ari Kauppi 12 participants 23 messages Mar 6, 2009 – Mar 13, 2009 5 messages not in the archive

Subsystems (4)
lore
Share & tools
lore

Ari Kauppi

author
#0 lore raw

cover i2c: i2c-omap: Reliablity and register fixes

Two patches for i2c-omap driver.

Ari Kauppi (1):
i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Eero Nurkkala (1):
i2c: i2c-omap: Fix BUFSTAT_REG reading

 drivers/i2c/busses/i2c-omap.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

A message that is not in the archive (sent off-list or not yet received): cover.1236345858.git.Ext-Ari.Kauppi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org

author
#2 lore raw

PATCH 1/2 i2c: i2c-omap: Fix BUFSTAT_REG reading

From: Eero Nurkkala <[email protected]>

The number of bytes to be received is read from wrong place with all OMAPs with highspeed I2C support, which involves a FIFO and BUFSTAT_REG. It is the 6 bits starting from the bit 8 in the BUFSTAT_REG that indicate this amount of bytes to be read. Moreover, only the 6 LSB:s are relevant for the TXSTAT field.

---
 drivers/i2c/busses/i2c-omap.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-omap.c +6 -4
index be8ee2c..0c3ed41 100644
@@ -675,8 +675,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
 				if (stat & OMAP_I2C_STAT_RRDY)
 					num_bytes = dev->fifo_size;
 				else
-					num_bytes = omap_i2c_read_reg(dev,
-							OMAP_I2C_BUFSTAT_REG);
+					num_bytes = (omap_i2c_read_reg(dev,
+							OMAP_I2C_BUFSTAT_REG)
+							>> 8) & 0x3F;
 			}
 			while (num_bytes) {
 				num_bytes--;
@@ -714,8 +715,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
 				if (stat & OMAP_I2C_STAT_XRDY)
 					num_bytes = dev->fifo_size;
 				else
-					num_bytes = omap_i2c_read_reg(dev,
-							OMAP_I2C_BUFSTAT_REG);
+					num_bytes = (omap_i2c_read_reg(dev,
+							OMAP_I2C_BUFSTAT_REG))
+							& 0x3F;
 			}
 			while (num_bytes) {
 				num_bytes--;
Signature · 1 line
1.5.6.5
#3 lore raw

PATCH 2/2 i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Ari Kauppi

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Applying Richard Woodruff's 'I2C bug fixes for L-O and L-Z' seems to help but IRQF_DISABLED is needed for proper behaviour.

---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +1 -1
index 0c3ed41..18af43f 100644
@@ -847,7 +847,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	omap_i2c_init(dev);
 
 	isr = (dev->rev < OMAP_I2C_REV_2) ? omap_i2c_rev1_isr : omap_i2c_isr;
-	r = request_irq(dev->irq, isr, 0, pdev->name, dev);
+	r = request_irq(dev->irq, isr, IRQF_DISABLED, pdev->name, dev);
 
 	if (r) {
 		dev_err(dev->dev, "failure requesting irq %i\n", dev->irq);
Signature · 1 line
1.5.6.5

A message that is not in the archive (sent off-list or not yet received): 7d7e7dd1a4c64c732a21bdfcf2bd42556be708c3.1236345858.git.Ext-Ari.Kauppi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org

#5 lore raw

RE: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 5 lines

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Applying Richard Woodruff's 'I2C bug fixes for L-O and L-Z' seems to help but IRQF_DISABLED is needed for proper behaviour.

I only submitted on l-o list for information and comment.

They need to be submitted on i2c list and to Ben to get added.

Thanks for the additional positive feed back and fix.

Regards,
Richard W.

#6 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to a message not in the archive
Quoted 17 lines · Ari Kauppi

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Applying Richard Woodruff's 'I2C bug fixes for L-O and L-Z' seems to help but IRQF_DISABLED is needed for proper behaviour.

---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +0 -0
index 0c3ed41..18af43f 100644

drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 850

Quoted 5 lines
drivers/i2c/busses/i2c-omap.c +1 -1
@@ -847,7 +847,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	omap_i2c_init(dev);
 
 	isr = (dev->rev < OMAP_I2C_REV_2) ? omap_i2c_rev1_isr : omap_i2c_isr;
-	r = request_irq(dev->irq, isr, 0, pdev->name, dev);
+	r = request_irq(dev->irq, isr, IRQF_DISABLED, pdev->name, dev);

Is disabling all IRQs on the system the right thing to do?

Quoted 9 lines
drivers/i2c/busses/i2c-omap.c +0 -0
 	if (r) {
 		dev_err(dev->dev, "failure requesting irq %i\n", dev->irq);
Signature · 6 lines
1.5.6.5

--
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 · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#7 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 20 lines · Ben Dooks
Quoted 19 lines · Ari Kauppi

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Applying Richard Woodruff's 'I2C bug fixes for L-O and L-Z' seems to help but IRQF_DISABLED is needed for proper behaviour.

---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +0 -0
index 0c3ed41..18af43f 100644
@@ -847,7 +847,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	omap_i2c_init(dev);
 
Quoted 5 lines

drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 850

Quoted 3 lines
drivers/i2c/busses/i2c-omap.c +1 -1
 	isr = (dev->rev < OMAP_I2C_REV_2) ? omap_i2c_rev1_isr : omap_i2c_isr;
-	r = request_irq(dev->irq, isr, 0, pdev->name, dev);
+	r = request_irq(dev->irq, isr, IRQF_DISABLED, pdev->name, dev);

Is disabling all IRQs on the system the right thing to do?

if not we could fall into stack overflow, right ?

Signature · 1 line
balbi
#8 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Ben Dooks

Hello Ari et al.,

Quoted 20 lines · Ben Dooks
Quoted 19 lines · Ari Kauppi

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Applying Richard Woodruff's 'I2C bug fixes for L-O and L-Z' seems to help but IRQF_DISABLED is needed for proper behaviour.

---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-omap.c +0 -0
index 0c3ed41..18af43f 100644
@@ -847,7 +847,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	omap_i2c_init(dev);
 
Quoted 5 lines

drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 850

Quoted 3 lines
drivers/i2c/busses/i2c-omap.c +1 -1
 	isr = (dev->rev < OMAP_I2C_REV_2) ? omap_i2c_rev1_isr : omap_i2c_isr;
-	r = request_irq(dev->irq, isr, 0, pdev->name, dev);
+	r = request_irq(dev->irq, isr, IRQF_DISABLED, pdev->name, dev);

Is disabling all IRQs on the system the right thing to do?

Ben's right, there shouldn't be any need for this. This patch could cause some unnecessary interrupt service latency.

Ari, are you seeing "Spurious irq XX: XXXXXXXX, please flush posted write for irq" messages? If so, the correct fix for this is to read from the device interrupt status register immediately after writing to it. This forces the ARM to wait until the write to the device is complete. Ari, could you make this change to i2c-omap.c:omap_i2c_isr() instead, and test whether this fixes the problem?

+ u32 tmp;

...

omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+ tmp = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); /* OCP barrier */

- Paul

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.00.0903111741270.26959-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org

#10 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 2 lines · Paul Walmsley

Ben's right, there shouldn't be any need for this. This patch could cause some unnecessary interrupt service latency.

That's not what Thomas Gleixner thinks. How about the possibility of stack overflow ?

According to Thomas (and Ingo, I'd say) all drivers should call request_irq() with IRQF_DISABLED and that's gonna be true as soon as the threaded irq handler support gets merged, if I'm not wrong.

Signature · 1 line
balbi
#11 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Hi Felipe,

Quoted 6 lines · Felipe Balbi
Quoted 2 lines · Paul Walmsley

Ben's right, there shouldn't be any need for this. This patch could cause some unnecessary interrupt service latency.

That's not what Thomas Gleixner thinks. How about the possibility of stack overflow ?

That sounds like a separate issue from the spurious IRQ problem that the patch was intended to fix.

I'm not familiar with the discussion on the stack overflow issue. Could you send a link?

Quoted 3 lines

According to Thomas (and Ingo, I'd say) all drivers should call request_irq() with IRQF_DISABLED and that's gonna be true as soon as the threaded irq handler support gets merged, if I'm not wrong.

- Paul

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.00.0903111804510.26959-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org

#13 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 5 lines · Paul Walmsley

Hi Felipe,

Quoted 1 line · Felipe Balbi

On Wed, Mar 11, 2009 at 05:55:50PM -0600, Paul Walmsley wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Ben's right, there shouldn't be any need for this. This patch could cause some unnecessary interrupt service latency.

That's not what Thomas Gleixner thinks. How about the possibility of stack overflow ?

That sounds like a separate issue from the spurious IRQ problem that the patch was intended to fix.

I agree. The IRQF_DISABLED happens to fix this issue, but it may be masking the real spurious issue as Paul suggested.

Quoted 3 lines

I'm not familiar with the discussion on the stack overflow issue. Could you send a link?

Here's one:

http://marc.info/?l=linux-kernel&m=123607359500596&w=2

Kevin

#14 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Paul Walmsley
Quoted 8 lines · Paul Walmsley

Hi Felipe,

Quoted 4 lines · Felipe Balbi
Quoted 2 lines · Paul Walmsley

Ben's right, there shouldn't be any need for this. This patch could cause some unnecessary interrupt service latency.

Quoted 8 lines
Quoted 2 lines

That's not what Thomas Gleixner thinks. How about the possibility of stack overflow ?

That sounds like a separate issue from the spurious IRQ problem that the patch was intended to fix.

I'm not familiar with the discussion on the stack overflow issue. Could you send a link?

This is the link where Ingo discusses why !IRQF_DISABLED could cause stack overflow:

http://lkml.org/lkml/2009/3/3/71

You probably wanna take a look at the whole thread to figure out the discussion, but basically Ingo and Peter (Zijlstra) believe !IRQF_DISABLED is a bug and drivers needing that probably should be using threaded irqs (which is not yet merged) or the hw is broken, and for those an IRQF_ENABLED flag will be created and a TAINT will also be placed.

Once that gets merged, all drivers will be forced (at some point) to IRQF_DISABLED and those which don't want that will be moved gradually to threaded irq.

This patch is also interesting:

http://lkml.org/lkml/2009/3/2/33

Signature · 1 line
balbi
#15 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Hi Felipe,

Quoted 12 lines · Felipe Balbi

This is the link where Ingo discusses why !IRQF_DISABLED could cause stack overflow:

http://lkml.org/lkml/2009/3/3/71

You probably wanna take a look at the whole thread to figure out the discussion, but basically Ingo and Peter (Zijlstra) believe !IRQF_DISABLED is a bug and drivers needing that probably should be using threaded irqs (which is not yet merged) or the hw is broken, and for those an IRQF_ENABLED flag will be created and a TAINT will also be placed.

Quoted 7 lines

Once that gets merged, all drivers will be forced (at some point) to IRQF_DISABLED and those which don't want that will be moved gradually to threaded irq.

This patch is also interesting:

http://lkml.org/lkml/2009/3/2/33

Thanks for the links. Those issues are indeed distinct from the spurious IRQ problem that Ari is reporting.

- Paul

#16 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Felipe Balbi
Quoted 10 lines · Felipe Balbi
Quoted 2 lines · Paul Walmsley

Ben's right, there shouldn't be any need for this.  This patch could cause some unnecessary interrupt service latency.

That's not what Thomas Gleixner thinks. How about the possibility of stack overflow ?

According to Thomas (and Ingo, I'd say) all drivers should call request_irq() with IRQF_DISABLED and that's gonna be true as soon as the threaded irq handler support gets merged, if I'm not wrong.

That's my understanding too, but I think it has always been true:
http://marc.info/?l=linux-kernel&m=123607685804562&w=2

Signature · 1 line
Felipe Contreras
#17 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 2 lines · Felipe Contreras

That's my understanding too, but I think it has always been true:
http://marc.info/?l=linux-kernel&m=123607685804562&w=2

sure, not merged yet though. And still the threaded irq support can't handle twl4030 where the irq demuxing logic has to run in a thread due to the need of communicating via i2c.

Signature · 1 line
balbi
#18 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Felipe Balbi
Quoted 3 lines · Felipe Balbi

According to Thomas (and Ingo, I'd say) all drivers should call request_irq() with IRQF_DISABLED and that's gonna be true as soon as the threaded irq handler support gets merged, if I'm not wrong.

Well, they're wrong.

Folk like Dave Miller, Andrew Morton, Benjamin Herrenschmdit, and Alan Cox have come out on the saner side of that.

#19 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to a message not in the archive

Hi Ari,

One thing that I missed -

Quoted 11 lines · Paul Walmsley
Quoted 3 lines · Ari Kauppi
Quoted 2 lines

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Ari, are you seeing "Spurious irq XX: XXXXXXXX, please flush posted write for irq" messages? If so, the correct fix for this is to read from the device interrupt status register immediately after writing to it. This forces the ARM to wait until the write to the device is complete. Ari, could you make this change to i2c-omap.c:omap_i2c_isr() instead, and test whether this fixes the problem?

Quoted 6 lines

+ u32 tmp;

...

omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+ tmp = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); /* OCP barrier */

You'll also want to make a similar change in omap_i2c_ack_stat(), to add a read immediately after that write.

- Paul

#20 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

On Thu, 2009-03-12 at 01:04 +0100, ext Paul Walmsley wrote:
Hi Paul,

Quoted 15 lines · Paul Walmsley
Quoted 14 lines
Quoted 4 lines · Ari Kauppi
Quoted 2 lines

I have observed some Spurious IRQ's for I2C1 when all kernel hacking options (and thus LOCKDEP) are disabled.

Ari, are you seeing "Spurious irq XX: XXXXXXXX, please flush posted write for irq" messages? If so, the correct fix for this is to read from the device interrupt status register immediately after writing to it. This forces the ARM to wait until the write to the device is complete. Ari, could you make this change to i2c-omap.c:omap_i2c_isr() instead, and test whether this fixes the problem?

+ u32 tmp;

Quoted 7 lines
Quoted 4 lines

...

omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+ tmp = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); /* OCP barrier */

You'll also want to make a similar change in omap_i2c_ack_stat(), to add a read immediately after that write.

I was seeing some Spurious irq's for the I2C1 (IRQ 56).

I'm aware of flushing posted write and the very first thing I tried was to use read-after-write for OMAP_I2C_STAT_REG (in all applicable places). However, it didn't make any difference.

Applying Richard Woodruff's patch (mentioned earlier in thread) that disables dev->b_hw hack for 3430 (STT/STP bits written together) and double clears ARDY fixed the spurious IRQ issues for I2C1.

However, with the STT/STP+ARDY patch I was seeing Spurious interrupts all over the place and the IRQF_DISABLED in i2c-omap seemed to tame them quite well. I do agree that my approach might not be the proper one in long term.

Best regards,

--
Ari

#21 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Hello Ari,

Quoted 5 lines · Kauppi Ari (EXT-Ixonos/Oulu)

I was seeing some Spurious irq's for the I2C1 (IRQ 56).

I'm aware of flushing posted write and the very first thing I tried was to use read-after-write for OMAP_I2C_STAT_REG (in all applicable places). However, it didn't make any difference.

Strange.

Quoted 8 lines

Applying Richard Woodruff's patch (mentioned earlier in thread) that disables dev->b_hw hack for 3430 (STT/STP bits written together) and double clears ARDY fixed the spurious IRQ issues for I2C1.

However, with the STT/STP+ARDY patch I was seeing Spurious interrupts all over the place and the IRQF_DISABLED in i2c-omap seemed to tame them quite well. I do agree that my approach might not be the proper one in long term.

Could you clarify this? Do Richard's patches fix the spurious IRQs, or cause spurious interrupts to appear?

regards,

- Paul

#22 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 11 lines · ext Paul Walmsley

Hello Ari,

Quoted 5 lines · Kauppi Ari (EXT-Ixonos/Oulu)

I was seeing some Spurious irq's for the I2C1 (IRQ 56).

I'm aware of flushing posted write and the very first thing I tried was to use read-after-write for OMAP_I2C_STAT_REG (in all applicable places). However, it didn't make any difference.

Strange.

I agree.

Quoted 11 lines
Quoted 8 lines

Applying Richard Woodruff's patch (mentioned earlier in thread) that disables dev->b_hw hack for 3430 (STT/STP bits written together) and double clears ARDY fixed the spurious IRQ issues for I2C1.

However, with the STT/STP+ARDY patch I was seeing Spurious interrupts all over the place and the IRQF_DISABLED in i2c-omap seemed to tame them quite well. I do agree that my approach might not be the proper one in long term.

Could you clarify this? Do Richard's patches fix the spurious IRQs, or cause spurious interrupts to appear?

My process was:

1) Take 2.6.28-based kernel on custom OMAP3430ES3.0 hardware with CONFIG_DEBUG_LOCKDEP enabled. There are no spurious interrupts and everything works.

2) Disable CONFIG_DEBUG_LOCKDEP and all other kernel debugging options. Spurious interrupts start to appear on several IRQs, especially with IRQ 56 (I2C1).

3) Apply Richard's patch. All spurious interrupts for IRQ 56 are gone but frequency of others increase.

4) Set IRQF_DISABLED in i2c-omap and the frequency of other spurious interrupts decreases considerably. However, I'm starting to realize that the real problem is probably elsewhere.

My test setup is pretty systematic, it does not have any user interaction in it. I have a relay controlling the power to the device and have taken logs of about 12000 boots with different kernel options and patches applied.

Best regards,

--
Ari

#23 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 13 lines · Kauppi Ari (EXT-Ixonos/Oulu)

My process was:

1) Take 2.6.28-based kernel on custom OMAP3430ES3.0 hardware with CONFIG_DEBUG_LOCKDEP enabled. There are no spurious interrupts and everything works.

2) Disable CONFIG_DEBUG_LOCKDEP and all other kernel debugging options. Spurious interrupts start to appear on several IRQs, especially with IRQ 56 (I2C1).

3) Apply Richard's patch. All spurious interrupts for IRQ 56 are gone but frequency of others increase.

Quoted 8 lines

4) Set IRQF_DISABLED in i2c-omap and the frequency of other spurious interrupts decreases considerably. However, I'm starting to realize that the real problem is probably elsewhere.

My test setup is pretty systematic, it does not have any user interaction in it. I have a relay controlling the power to the device and have taken logs of about 12000 boots with different kernel options and patches applied.

Thanks for the details. Can you extract the list of spurious IRQ warnings that you're getting, and post them? I suspect that, like I2C, many of the driver ISRs are not reading back the device interrupt status registers after they clear them.

- Paul

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.00.0903120356230.26959-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org

#25 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 24 lines · ext Paul Walmsley
Quoted 13 lines · Kauppi Ari (EXT-Ixonos/Oulu)

My process was:

1) Take 2.6.28-based kernel on custom OMAP3430ES3.0 hardware with CONFIG_DEBUG_LOCKDEP enabled. There are no spurious interrupts and everything works.

2) Disable CONFIG_DEBUG_LOCKDEP and all other kernel debugging options. Spurious interrupts start to appear on several IRQs, especially with IRQ 56 (I2C1).

3) Apply Richard's patch. All spurious interrupts for IRQ 56 are gone but frequency of others increase.

Quoted 8 lines

4) Set IRQF_DISABLED in i2c-omap and the frequency of other spurious interrupts decreases considerably. However, I'm starting to realize that the real problem is probably elsewhere.

My test setup is pretty systematic, it does not have any user interaction in it. I have a relay controlling the power to the device and have taken logs of about 12000 boots with different kernel options and patches applied.

Quoted 4 lines

Thanks for the details. Can you extract the list of spurious IRQ warnings that you're getting, and post them? I suspect that, like I2C, many of the driver ISRs are not reading back the device interrupt status registers after they clear them.

Sure,

Here is "grep -hoa 'write for irq.*' *.log | sort | uniq -c" from the most problematic case (step 2 in above process). It should be noted that the messages are always in pairs, ie. there are two consecutive messages in the logs with only microseconds between them. I have divided the counts reported by uniq -c by two in the list below.

Boot count: 6628
1 write for irq 12
1 write for irq 25
1 write for irq 33
10 write for irq 37
29532 write for irq 56
12 write for irq 67
1 write for irq 71
281 write for irq 73
114 write for irq 83
407 write for irq 86

I have also heard that with other use cases irq 17 and 21 should be in the list, too. The single ones from 12,25,33,71 are probably just one-offs and should not be taken too seriously, 37/67 are corner cases but 73/83/86 are definitely valid measurements.

Best regards,

--
Ari

#26 lore raw

RE: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

Quoted 7 lines

From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Kauppi Ari (EXT-Ixonos/Oulu)
Sent: Thursday, March 12, 2009 6:34 AM

Quoted 2 lines
Quoted 2 lines

3) Apply Richard's patch. All spurious interrupts for IRQ 56 are gone but frequency of others increase.

The bugs fixed in my patch are function violation bugs. The TRM clearly requires the changes I made. In of themselves they don't have anything to do with spurious interrupts. Though if the FSM is messed up, there is no telling what will happen for interrupts.

In our reference code and code other customers are using. Applying fixes resulted in I2C flakiness going away.

Quoted 12 lines

Boot count: 6628
1 write for irq 12
1 write for irq 25
1 write for irq 33
10 write for irq 37
29532 write for irq 56
12 write for irq 67
1 write for irq 71
281 write for irq 73
114 write for irq 83
407 write for irq 86

Quoted 4 lines

I have also heard that with other use cases irq 17 and 21 should be in the list, too. The single ones from 12,25,33,71 are probably just one-offs and should not be taken too seriously, 37/67 are corner cases but 73/83/86 are definitely valid measurements.

If you apply the bus posting patch I sent a while back they will likely all go away. There are a number of subtle effects posting and resulting bursting will have on register ranges.

http://www.mail-archive.com/[email protected]/msg08363.html

It is quite noble that people want to experience and hunt down subtle system wide errors for a potential small performance gain. I'm tired of the weeks if not months of cumulative time wasted here. It would be more fun to play with a broken alpha version of gcc and look for subtle errors. I might eventually get some benefit.

Regards,
Richard W.

#27 lore raw

Re: [PATCH 2/2] i2c: i2c-omap: Call request_irq with IRQF_DISABLED

In reply to Kauppi Ari (EXT-Ixonos/Oulu)

(cc's trimmed to drop Ben, i2c list)

Hello Ari,

Quoted 26 lines · Kauppi Ari (EXT-Ixonos/Oulu)
Quoted 4 lines · ext Paul Walmsley

Thanks for the details. Can you extract the list of spurious IRQ warnings that you're getting, and post them? I suspect that, like I2C, many of the driver ISRs are not reading back the device interrupt status registers after they clear them.

Sure,

Here is "grep -hoa 'write for irq.*' *.log | sort | uniq -c" from the most problematic case (step 2 in above process). It should be noted that the messages are always in pairs, ie. there are two consecutive messages in the logs with only microseconds between them. I have divided the counts reported by uniq -c by two in the list below.

Boot count: 6628
1 write for irq 12
1 write for irq 25
1 write for irq 33
10 write for irq 37
29532 write for irq 56
12 write for irq 67
1 write for irq 71
281 write for irq 73
114 write for irq 83
407 write for irq 86

Quoted 4 lines

I have also heard that with other use cases irq 17 and 21 should be in the list, too. The single ones from 12,25,33,71 are probably just one-offs and should not be taken too seriously, 37/67 are corner cases but 73/83/86 are definitely valid measurements.

Would you be willing to test some patches that might resolve most of these spurious IRQs? They are here:

http://www.pwsan.com/omap/spurious-irq-fix.tar.gz

They at least boot okay on a 3430SDP, but since I don't have a test case to reproduce the spurious IRQs, I haven't done any further testing.

Thanks for your help with this -

- Paul