diff options
author | Alberto Garcia <agarcia@igalia.com> | 2012-12-10 05:49:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 21:24:37 -0500 |
commit | cc83f833c77c1d233e3843af18c1abf8d561d1fa (patch) | |
tree | c0de5dbd0e39e02fb4eaacb5c3e20317bdae2152 /drivers/ipack/devices | |
parent | 8e9a4a9a5c8e8765417d54ed6917c7e1e4d09f4d (diff) |
ipack/devices/ipoctal: Fix race condition during Tx
In order to transmit data, the driver enables Tx and sleeps until
*board_write is set to 1 by the interrupt handler.
It can happen, though, that the data is sent even before the process
is asleep. In this case *board_write must be set to 1 anyway,
otherwise we will be waiting for a condition that will never be true.
Signed-off-by: Alberto Garcia <agarcia@igalia.com>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ipack/devices')
-rw-r--r-- | drivers/ipack/devices/ipoctal.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index 576d53d92677..e66135da63ce 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c | |||
@@ -195,13 +195,10 @@ static void ipoctal_irq_tx(struct ipoctal_channel *channel) | |||
195 | *pointer_write = *pointer_write % PAGE_SIZE; | 195 | *pointer_write = *pointer_write % PAGE_SIZE; |
196 | channel->nb_bytes--; | 196 | channel->nb_bytes--; |
197 | 197 | ||
198 | if ((channel->nb_bytes == 0) && | 198 | if (channel->nb_bytes == 0 && |
199 | (waitqueue_active(&channel->queue))) { | 199 | channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) { |
200 | 200 | *channel->board_write = 1; | |
201 | if (channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) { | 201 | wake_up_interruptible(&channel->queue); |
202 | *channel->board_write = 1; | ||
203 | wake_up_interruptible(&channel->queue); | ||
204 | } | ||
205 | } | 202 | } |
206 | } | 203 | } |
207 | 204 | ||