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 bytes have been transferred. Applies to 2.6.23-rc4.

This patch has not been tested with a MPC83xx device.

Signed-off-by: Jan Andersson <[EMAIL PROTECTED]>
--
I discovered this while working with a port of the mpc83xx driver from 2.6.21.1. It looks like the issue remains in 2.6.23-rc4. When performing a read from a M25P80 device the driver waits forever for a receive (Not Empty) interrupt that never occurs since the transmit register is not written when the first NE IRQ is handled. Please test or comment.

I do not own a MPC83xx device and can not test this with the original hardware.
--- linux-2.6/drivers/spi/spi_mpc83xx.orig      2007-08-28 16:01:59.000000000 
+0200
+++ linux-2.6/drivers/spi/spi_mpc83xx.c 2007-08-28 16:04:35.000000000 +0200
@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, voi
 
        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);
        }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to