aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJanusz Uzycki <j.uzycki@elproma.com.pl>2014-11-14 17:24:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-25 20:06:39 -0500
commit08f937f4bcbe156773834935018c9bf7874a42f3 (patch)
tree77613195d9f73a5a740e8115eea2584ada59505e /drivers/tty
parentf3006e44dd3dc0f2d0ce636585ed95d5b4ad6f35 (diff)
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 <j.uzycki@elproma.com.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mxs-auart.c3
1 files changed, 2 insertions, 1 deletions
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)
799{ 799{
800 u32 istat; 800 u32 istat;
801 struct mxs_auart_port *s = context; 801 struct mxs_auart_port *s = context;
802 u32 mctrl_temp = s->mctrl_prev;
802 u32 stat = readl(s->port.membase + AUART_STAT); 803 u32 stat = readl(s->port.membase + AUART_STAT);
803 804
804 istat = readl(s->port.membase + AUART_INTR); 805 istat = readl(s->port.membase + AUART_INTR);
@@ -818,7 +819,7 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
818 irq == s->gpio_irq[UART_GPIO_DSR] || 819 irq == s->gpio_irq[UART_GPIO_DSR] ||
819 irq == s->gpio_irq[UART_GPIO_RI]) 820 irq == s->gpio_irq[UART_GPIO_RI])
820 mxs_auart_modem_status(s, 821 mxs_auart_modem_status(s,
821 mctrl_gpio_get(s->gpios, &s->mctrl_prev)); 822 mctrl_gpio_get(s->gpios, &mctrl_temp));
822 823
823 if (istat & AUART_INTR_CTSMIS) { 824 if (istat & AUART_INTR_CTSMIS) {
824 if (CTS_AT_AUART() && s->ms_irq_enabled) 825 if (CTS_AT_AUART() && s->ms_irq_enabled)