Kernel panic when reading mtd device

Shawn J. Goff shawn7400 at gmail.com
Thu Jan 19 19:16:52 EST 2012


I believe the problem is in drivers/spi/atmel_spi.c. It looks like it
needs to break the transfer down into chunks that can fit in the
buffer. It seems that this driver as it exists in the Linux4SAM tree (
https://github.com/linux4sam/linux-at91/tree/linus2639_5series_1.x )
is unfinished(?) As a quick workaround, I did the following, which
allows me to function for now.

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index ca9dab5..825371f 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -463,7 +463,7 @@ static void atmel_spi_next_xfer(struct spi_master *master,

        as->current_transfer = xfer;

-       if (atmel_spi_use_dma(xfer)) {
+       if (atmel_spi_use_dma(xfer) && xfer->len <= BUFFER_SIZE) {
                if (!atmel_spi_next_xfer_dma(master, xfer))
                        return;
                else



More information about the linux-mtd mailing list