Skip to content

Commit

Permalink
serial: mxs-auart: fix gpio change detection on interrupt
Browse files Browse the repository at this point in the history
mxs_auart_modem_status() did't detect gpio's state change
because s->mctrl_prev was modified before by mctrl_gpio_get().
The patch introduces mctrl_temp variable to fix the bug.

Signed-off-by: Janusz Uzycki <j.uzycki@elproma.com.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Janusz Uzycki authored and Greg Kroah-Hartman committed Nov 26, 2014
1 parent f3006e4 commit 08f937f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/mxs-auart.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
{
u32 istat;
struct mxs_auart_port *s = context;
u32 mctrl_temp = s->mctrl_prev;
u32 stat = readl(s->port.membase + AUART_STAT);

istat = readl(s->port.membase + AUART_INTR);
Expand All @@ -818,7 +819,7 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
irq == s->gpio_irq[UART_GPIO_DSR] ||
irq == s->gpio_irq[UART_GPIO_RI])
mxs_auart_modem_status(s,
mctrl_gpio_get(s->gpios, &s->mctrl_prev));
mctrl_gpio_get(s->gpios, &mctrl_temp));

if (istat & AUART_INTR_CTSMIS) {
if (CTS_AT_AUART() && s->ms_irq_enabled)
Expand Down

0 comments on commit 08f937f

Please sign in to comment.