mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
serial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq()
commit ed647256e8f226241ecff7baaecdb8632ffc7ec1 upstream. Commit8344498721("sc16is7xx: Fix for multi-channel stall") changed sc16is7xx_port_irq() from looping multiple times when there was still interrupts to serve. It simply changed the do {} while(1) loop to a do {} while(0) loop, which makes the loop itself now obsolete. Clean the code by removing this obsolete do {} while(0) loop. Fixes:8344498721("sc16is7xx: Fix for multi-channel stall") Cc: <stable@vger.kernel.org> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20231221231823.2327894-5-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
de8e41f78f
commit
80beb4424d
@@ -726,58 +726,55 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one)
|
|||||||
static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
|
static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
|
||||||
{
|
{
|
||||||
bool rc = true;
|
bool rc = true;
|
||||||
|
unsigned int iir, rxlen;
|
||||||
struct uart_port *port = &s->p[portno].port;
|
struct uart_port *port = &s->p[portno].port;
|
||||||
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
|
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
|
||||||
|
|
||||||
mutex_lock(&one->efr_lock);
|
mutex_lock(&one->efr_lock);
|
||||||
|
|
||||||
do {
|
iir = sc16is7xx_port_read(port, SC16IS7XX_IIR_REG);
|
||||||
unsigned int iir, rxlen;
|
if (iir & SC16IS7XX_IIR_NO_INT_BIT) {
|
||||||
|
rc = false;
|
||||||
|
goto out_port_irq;
|
||||||
|
}
|
||||||
|
|
||||||
iir = sc16is7xx_port_read(port, SC16IS7XX_IIR_REG);
|
iir &= SC16IS7XX_IIR_ID_MASK;
|
||||||
if (iir & SC16IS7XX_IIR_NO_INT_BIT) {
|
|
||||||
rc = false;
|
|
||||||
goto out_port_irq;
|
|
||||||
}
|
|
||||||
|
|
||||||
iir &= SC16IS7XX_IIR_ID_MASK;
|
switch (iir) {
|
||||||
|
case SC16IS7XX_IIR_RDI_SRC:
|
||||||
|
case SC16IS7XX_IIR_RLSE_SRC:
|
||||||
|
case SC16IS7XX_IIR_RTOI_SRC:
|
||||||
|
case SC16IS7XX_IIR_XOFFI_SRC:
|
||||||
|
rxlen = sc16is7xx_port_read(port, SC16IS7XX_RXLVL_REG);
|
||||||
|
|
||||||
switch (iir) {
|
/*
|
||||||
case SC16IS7XX_IIR_RDI_SRC:
|
* There is a silicon bug that makes the chip report a
|
||||||
case SC16IS7XX_IIR_RLSE_SRC:
|
* time-out interrupt but no data in the FIFO. This is
|
||||||
case SC16IS7XX_IIR_RTOI_SRC:
|
* described in errata section 18.1.4.
|
||||||
case SC16IS7XX_IIR_XOFFI_SRC:
|
*
|
||||||
rxlen = sc16is7xx_port_read(port, SC16IS7XX_RXLVL_REG);
|
* When this happens, read one byte from the FIFO to
|
||||||
|
* clear the interrupt.
|
||||||
|
*/
|
||||||
|
if (iir == SC16IS7XX_IIR_RTOI_SRC && !rxlen)
|
||||||
|
rxlen = 1;
|
||||||
|
|
||||||
/*
|
if (rxlen)
|
||||||
* There is a silicon bug that makes the chip report a
|
sc16is7xx_handle_rx(port, rxlen, iir);
|
||||||
* time-out interrupt but no data in the FIFO. This is
|
break;
|
||||||
* described in errata section 18.1.4.
|
|
||||||
*
|
|
||||||
* When this happens, read one byte from the FIFO to
|
|
||||||
* clear the interrupt.
|
|
||||||
*/
|
|
||||||
if (iir == SC16IS7XX_IIR_RTOI_SRC && !rxlen)
|
|
||||||
rxlen = 1;
|
|
||||||
|
|
||||||
if (rxlen)
|
|
||||||
sc16is7xx_handle_rx(port, rxlen, iir);
|
|
||||||
break;
|
|
||||||
/* CTSRTS interrupt comes only when CTS goes inactive */
|
/* CTSRTS interrupt comes only when CTS goes inactive */
|
||||||
case SC16IS7XX_IIR_CTSRTS_SRC:
|
case SC16IS7XX_IIR_CTSRTS_SRC:
|
||||||
case SC16IS7XX_IIR_MSI_SRC:
|
case SC16IS7XX_IIR_MSI_SRC:
|
||||||
sc16is7xx_update_mlines(one);
|
sc16is7xx_update_mlines(one);
|
||||||
break;
|
break;
|
||||||
case SC16IS7XX_IIR_THRI_SRC:
|
case SC16IS7XX_IIR_THRI_SRC:
|
||||||
sc16is7xx_handle_tx(port);
|
sc16is7xx_handle_tx(port);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err_ratelimited(port->dev,
|
dev_err_ratelimited(port->dev,
|
||||||
"ttySC%i: Unexpected interrupt: %x",
|
"ttySC%i: Unexpected interrupt: %x",
|
||||||
port->line, iir);
|
port->line, iir);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (0);
|
|
||||||
|
|
||||||
out_port_irq:
|
out_port_irq:
|
||||||
mutex_unlock(&one->efr_lock);
|
mutex_unlock(&one->efr_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user