The patch titled atmel_spi: fix handling of chipselect after SPI transfer has been added to the -mm tree. Its filename is atmel_spi-fix-handling-of-chipselect-after-spi-transfer.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: atmel_spi: fix handling of chipselect after SPI transfer From: Michael Heimpold <michael@xxxxxxxxxxx> According to include/linux/spi/spi.h chipselect should stay active after a SPI transfer or after a SPI message unless modified by spi_transfer.cs_change != 0. The current atmel driver passes this field to atmel_spi_msg_done as a parameter with oppositional meaning: "cs_change" -> "stay" (see atmel_spi_interrupt). This patch fixes this behaviour by adapting the called function and its callers. IMHO this solution is better than an one line fix of inverting the function's argument as the meaning of the field remains throughout the hole stack. Signed-off-by: Michael Heimpold <mhei@xxxxxxxxxxx> Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx> Cc: David Brownell <david-b@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/spi/atmel_spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN drivers/spi/atmel_spi.c~atmel_spi-fix-handling-of-chipselect-after-spi-transfer drivers/spi/atmel_spi.c --- a/drivers/spi/atmel_spi.c~atmel_spi-fix-handling-of-chipselect-after-spi-transfer +++ a/drivers/spi/atmel_spi.c @@ -385,9 +385,9 @@ static void atmel_spi_dma_unmap_xfer(str static void atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as, - struct spi_message *msg, int status, int stay) + struct spi_message *msg, int status, int cs_change) { - if (!stay || status < 0) + if (cs_change || status < 0) cs_deactivate(as, msg->spi); else as->stay = msg->spi; @@ -482,7 +482,7 @@ atmel_spi_interrupt(int irq, void *dev_i /* Clear any overrun happening while cleaning up */ spi_readl(as, SR); - atmel_spi_msg_done(master, as, msg, -EIO, 0); + atmel_spi_msg_done(master, as, msg, -EIO, 1); } else if (pending & (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX))) { ret = IRQ_HANDLED; _ Patches currently in -mm which might be from michael@xxxxxxxxxxx are atmel_spi-fix-handling-of-chipselect-after-spi-transfer.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html