aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJan Andersson <jan@gaisler.com>2007-09-11 18:23:30 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-11 20:21:19 -0400
commit65e213cdb2e52ba03e61c4d855293054bd8de632 (patch)
tree0cb89fc9b4609734e783e0c0d1cf4299a0878e92 /drivers
parent9c3013e9b91ad23ecae88e45405e98208cce455d (diff)
spi_mpc83xx: hang fix
When the spi_mpc83xx driver receives a tx_buf pointer which is NULL, it only writes one zero filled word to the transmit register. If the driver expects to receive more than one word it will wait forever for a second receive interrupt. With this patch the controller will shift out zeroes until all words have been received. Signed-off-by: Jan Andersson <jan@gaisler.com> Tested-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi_mpc83xx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index fcbf1b8a5264..32cda77b31cd 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
384 384
385 mpc83xx_spi->count -= 1; 385 mpc83xx_spi->count -= 1;
386 if (mpc83xx_spi->count) { 386 if (mpc83xx_spi->count) {
387 if (mpc83xx_spi->tx) { 387 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
388 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); 388 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
389 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit,
390 word);
391 }
392 } else { 389 } else {
393 complete(&mpc83xx_spi->done); 390 complete(&mpc83xx_spi->done);
394 } 391 }