From: Jan Andersson Date: Tue, 11 Sep 2007 22:23:30 +0000 (-0700) Subject: spi_mpc83xx: hang fix X-Git-Tag: v2.6.23-rc7~93 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=65e213cdb2e52ba03e61c4d855293054bd8de632;p=~shefty%2Frdma-dev.git 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 Tested-by: Anton Vorontsov Signed-off-by: David Brownell Acked-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index fcbf1b8a526..32cda77b31c 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) mpc83xx_spi->count -= 1; if (mpc83xx_spi->count) { - if (mpc83xx_spi->tx) { - u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); - mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, - word); - } + u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); + mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word); } else { complete(&mpc83xx_spi->done); }