Skip to contentSkip to conversation

Possible bug in 8250.c

DISCUSSION Ivica Mikec 2 participants 2 messages Aug 20, 2011

lore
Share & tools
lore
#0 lore raw

I traced the function using jtag debugger.

UART is not sharing interrupts:
========================================= Console ========================
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0xae023400 (irq = 53) is a 16550A console [ttyS0] enabled, bootconsole disabled
=========================================================================
And /proc/interrupts:

=========================================================================
cat /proc/interrupts
CPU0
53: 4534 XXXXX serial
56: 12 XXXXX phy_interrupt
153: 20262068 XXXXX timer
ERR: 0
=========================================================================

So in first iteration, interrupt is cleared, and in second, function will execute:

          } else if (end == NULL)
                        end = l;

which will terminate the loop, but the return code will be IRQ_RETVAL(0).

Quoted 32 lines · Jiri Slaby
Quoted 7 lines · Ivica Mikec

Hi!

I noticed a problem in 8250.c.

My board has only one UART port, and is 16550 compatible, so in function

serial8250_interrupt I see that serial_in function is called twice. Second time, code "else if (end == NULL)" is executed and function return IRQ_NONE. This causes an entry in /proc/irq/spurious:

Quoted 6 lines

count 239
unhandled 1
last_unhandled 4294700846 ms

But this is not a spurious interrupt.

How did you find out? Have you checked that the port signals that it raised an interrupt? I.e. does it go through the 'if (!(iir & UART_IIR_NO_INT))' branch?

What other devices are bound to the same interrupt? Attach /proc/interrupts.

regards,

Signature · 2 lines
js
suse labs
#1 lore raw
Quoted 6 lines

So in first iteration, interrupt is cleared, and in second, function will execute:

          } else if (end == NULL)
                        end = l;

which will terminate the loop, but the return code will be IRQ_RETVAL(0).

If you are getting an extra IRQ when then chip itself is indicating no IRQ then the IRQ is spurious. That probably means you have a problem elsewhere - eg the IRQ controller being misconfigured between level/edge triggered.

Alan