Commit 65e213cd authored by Jan Andersson's avatar Jan Andersson Committed by Linus Torvalds

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: default avatarJan Andersson <jan@gaisler.com>
Tested-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9c3013e9
...@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data) ...@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
mpc83xx_spi->count -= 1; mpc83xx_spi->count -= 1;
if (mpc83xx_spi->count) { if (mpc83xx_spi->count) {
if (mpc83xx_spi->tx) {
u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
word);
}
} else { } else {
complete(&mpc83xx_spi->done); complete(&mpc83xx_spi->done);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment