mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
serial: mctrl_gpio: add IRQ locking
uart_handle_cts_change should be called with port->lock held. And for this to be save you must also disable irqs. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fa01e2ca9f
commit
d11df61853
@ -125,9 +125,12 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context)
|
||||
struct uart_port *port = gpios->port;
|
||||
u32 mctrl = gpios->mctrl_prev;
|
||||
u32 mctrl_diff;
|
||||
unsigned long flags;
|
||||
|
||||
mctrl_gpio_get(gpios, &mctrl);
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
mctrl_diff = mctrl ^ gpios->mctrl_prev;
|
||||
gpios->mctrl_prev = mctrl;
|
||||
|
||||
@ -147,6 +150,8 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context)
|
||||
wake_up_interruptible(&port->state->port.delta_msr_wait);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user