From 08f937f4bcbe156773834935018c9bf7874a42f3 Mon Sep 17 00:00:00 2001 From: Janusz Uzycki Date: Fri, 14 Nov 2014 23:24:33 +0100 Subject: [PATCH] serial: mxs-auart: fix gpio change detection on interrupt 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 Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mxs-auart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 0262a6a50834..21b3b3569461 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -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); @@ -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) -- 2.39.5