提交 44e18e9e 编写于 作者: M Magnus Damm 提交者: Paul Mundt

sh-sci: update receive error handling for muxed irqs

This patch updates the receive error code for muxed
interrupts in the sh-sci driver.

Receive error interrupts may be generated by the hardware
if RE or REIE bits in SCSCR are set. Update the muxed
interrupt handling code to acknowledge error interrupts
if RE or REIE is set, instead of only acknowledging if
REIE is set.

Without this patch error interrupts may be generated but
never acked resulting in a "nobody cared" crash.
Signed-off-by: NMagnus Damm <damm@igel.co.jp>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 47220f62
...@@ -707,12 +707,13 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) ...@@ -707,12 +707,13 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr)
static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
{ {
unsigned short ssr_status, scr_status; unsigned short ssr_status, scr_status, err_enabled;
struct uart_port *port = ptr; struct uart_port *port = ptr;
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
ssr_status = sci_in(port, SCxSR); ssr_status = sci_in(port, SCxSR);
scr_status = sci_in(port, SCSCR); scr_status = sci_in(port, SCSCR);
err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE);
/* Tx Interrupt */ /* Tx Interrupt */
if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE)) if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE))
...@@ -721,10 +722,10 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) ...@@ -721,10 +722,10 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE)) if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE))
ret = sci_rx_interrupt(irq, ptr); ret = sci_rx_interrupt(irq, ptr);
/* Error Interrupt */ /* Error Interrupt */
if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE)) if ((ssr_status & 0x0080) && err_enabled)
ret = sci_er_interrupt(irq, ptr); ret = sci_er_interrupt(irq, ptr);
/* Break Interrupt */ /* Break Interrupt */
if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE)) if ((ssr_status & 0x0010) && err_enabled)
ret = sci_br_interrupt(irq, ptr); ret = sci_br_interrupt(irq, ptr);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册