diff options
| author | Samuel Iglesias Gonsalvez <siglesias@igalia.com> | 2012-12-10 05:50:05 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 21:24:38 -0500 |
| commit | e7e664fd688a4a882ce571575ad721203f0cd584 (patch) | |
| tree | 4acbf6cde6898c71af252673db206ca12658f4fe /drivers/ipack | |
| parent | 21d27ed4616c9a7f2886c4159b4c409f73f96e76 (diff) | |
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: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ipack')
| -rw-r--r-- | drivers/ipack/devices/ipoctal.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index 9cd5572457ff..5ce2c4c5bb32 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c | |||
| @@ -191,6 +191,8 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) | |||
| 191 | tty = tty_port_tty_get(&channel->tty_port); | 191 | tty = tty_port_tty_get(&channel->tty_port); |
| 192 | if (!tty) | 192 | if (!tty) |
| 193 | return; | 193 | return; |
| 194 | |||
| 195 | spin_lock(&channel->lock); | ||
| 194 | /* The HW is organized in pair of channels. See which register we need | 196 | /* The HW is organized in pair of channels. See which register we need |
| 195 | * to read from */ | 197 | * to read from */ |
| 196 | isr = ioread8(&channel->block_regs->r.isr); | 198 | isr = ioread8(&channel->block_regs->r.isr); |
| @@ -216,6 +218,7 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) | |||
| 216 | 218 | ||
| 217 | tty_flip_buffer_push(tty); | 219 | tty_flip_buffer_push(tty); |
| 218 | tty_kref_put(tty); | 220 | tty_kref_put(tty); |
| 221 | spin_unlock(&channel->lock); | ||
| 219 | } | 222 | } |
| 220 | 223 | ||
| 221 | static irqreturn_t ipoctal_irq_handler(void *arg) | 224 | static irqreturn_t ipoctal_irq_handler(void *arg) |
