• Silvester Erdeg's avatar
    atmel_spi: chain DMA transfers · 154443c7
    Silvester Erdeg authored
    Add support for chained transfers in the atmel_spi driver, letting the DMA
    controller switch to the next buffer pair without CPU intervention.  This
    reduced I/O latencies by about 2% in one bulk I/O test.  It should also help
    work around several interrelated errata affecting chipselect 0 on at91rm9200
    chips.
    
    Almost all of the changes are in the reworked atmel_spi_next_xfer() function.
    That's now called with the driver in one of three states:
    
     1. It isn't transferring anything (in which case the first transfer
        of the current message is going to be sent)
     2. It has finished transfering a non-chainable transfer (in which
        case it will go to the next transfer in the message)
     3. It has finished transfering a chained transfer (in which case the
        next transfer is already queued)
    
    After that it will queue the next transfer if it can be chained.
    Signed-off-by: default avatarSzilveszter Ordog <slipszi@gmail.com>
    Acked-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    154443c7
atmel_spi.c 21.3 KB