Patchwork Kernel panic when reading mtd device

login
register
mail settings
Submitter Shawn J. Goff
Date Jan. 20, 2012, 12:16 a.m.
Message ID <CAGiDA6KjJKQcho9aiqA2KSe30tvU0JZnMgv86zSE_Pt2=JRdDA@mail.gmail.com>
Download mbox | patch
Permalink /patch/136928/
State New
Headers show

Comments

Shawn J. Goff - Jan. 20, 2012, 12:16 a.m.
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.
Artem Bityutskiy - Jan. 27, 2012, 12:53 p.m.
On Thu, 2012-01-19 at 19:16 -0500, Shawn J. Goff wrote:
> 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

This driver is not in upstream - I do not have it in my 3.3-rc1 at
least.

Patch

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