Commit e7e664fd authored by Samuel Iglesias Gonsalvez's avatar Samuel Iglesias Gonsalvez Committed by Greg Kroah-Hartman

ipack/devices/ipoctal: protect the channel data processing with a spinlock

We protect important data such as TX buffer pointer, nb_bytes counter and status
registers of the device, from accessing several times at the same time.
Signed-off-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 21d27ed4
...@@ -191,6 +191,8 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) ...@@ -191,6 +191,8 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
tty = tty_port_tty_get(&channel->tty_port); tty = tty_port_tty_get(&channel->tty_port);
if (!tty) if (!tty)
return; return;
spin_lock(&channel->lock);
/* The HW is organized in pair of channels. See which register we need /* The HW is organized in pair of channels. See which register we need
* to read from */ * to read from */
isr = ioread8(&channel->block_regs->r.isr); isr = ioread8(&channel->block_regs->r.isr);
...@@ -216,6 +218,7 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) ...@@ -216,6 +218,7 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
tty_kref_put(tty); tty_kref_put(tty);
spin_unlock(&channel->lock);
} }
static irqreturn_t ipoctal_irq_handler(void *arg) static irqreturn_t ipoctal_irq_handler(void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment