Files
linux/drivers
Simon Lindgren d5a6d0a4da i2c: at91: Fix a race condition during signal handling in at91_do_twi_xfer.
commit 6721f28a26 upstream.

There is a race condition in at91_do_twi_xfer when signals arrive.
If a signal is recieved while waiting for a transfer to complete
wait_for_completion_interruptible_timeout() will return -ERESTARTSYS.
This is not handled correctly resulting in interrupts still being
enabled and a transfer being in flight when we return.

Symptoms include a range of oopses and bus lockups. Oopses can happen
when the transfer completes because the interrupt handler will corrupt
the stack. If a new transfer is started before the interrupt fires
the controller will start a new transfer in the middle of the old one,
resulting in confused slaves and a locked bus.

To avoid this, use wait_for_completion_io_timeout instead so that we
don't have to deal with gracefully shutting down the transfer and
disabling the interrupts.

Signed-off-by: Simon Lindgren <simon@aqwary.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-05 14:54:07 -07:00
..
2013-12-08 07:29:25 -08:00
2013-05-17 14:31:05 -04:00
2014-03-06 21:30:14 -08:00
2014-09-05 16:28:34 -07:00
2014-08-07 14:30:26 -07:00
2014-07-31 12:53:50 -07:00
2014-04-14 06:42:18 -07:00
2014-02-22 12:41:27 -08:00
2014-02-20 11:06:11 -08:00
2014-04-03 12:01:05 -07:00