diff options
| author | Noralf Trønnes <noralf@tronnes.org> | 2016-10-03 22:06:08 +0200 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2016-11-07 01:48:31 +0100 |
| commit | e2474541032db65d02bf88b6a8c2f954654b443f (patch) | |
| tree | 0c7239f4055505840b535d2141c32c4c398fe585 /net/lapb/lapb_timer.c | |
| parent | bc33b0ca11e3df467777a4fa7639ba488c9d4911 (diff) | |
i2c: bcm2835: Fix hang for writing messages larger than 16 bytes
Writing messages larger than the FIFO size results in a hang, rendering
the machine unusable. This is because the RXD status flag is set on the
first interrupt which results in bcm2835_drain_rxfifo() stealing bytes
from the buffer. The controller continues to trigger interrupts waiting
for the missing bytes, but bcm2835_fill_txfifo() has none to give.
In this situation wait_for_completion_timeout() apparently is unable to
stop the madness.
The BCM2835 ARM Peripherals datasheet has this to say about the flags:
TXD: is set when the FIFO has space for at least one byte of data.
RXD: is set when the FIFO contains at least one byte of data.
TXW: is set during a write transfer and the FIFO is less than full.
RXR: is set during a read transfer and the FIFO is or more full.
Implementing the logic from the downstream i2c-bcm2708 driver solved
the hang problem.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions
