• Robert Hancock's avatar
    sata_nv: use ADMA for NODATA commands · 382a6652
    Robert Hancock authored
    Some problems showed up recently with cache flush commands timing out on
    sata_nv.  Previously these commands were always handled by transitioning to
    legacy mode from ADMA mode first.  The timeout problem was worked around
    already by a change to the interrupt handling code for legacy mode, but for
    non-data commands like these it appears we can handle them in ADMA mode, so
    the switch to legacy mode is not needed.
    
    This patch changes the behavior so that we use ADMA mode to submit
    interrupt-driven commands with ATA_PROT_NODATA protocol.  In addition to
    avoiding the problem mentioned above entirely, this avoids the overhead of
    switching to legacy mode and back to ADMA mode for handling cache flushes.
    When handling non-DMA-mapped commands, we leave the APRD blank and clear
    the NV_CPB_CTL_APRD_VALID field in the CPB so the controller does not
    attempt to read it.
    Signed-off-by: default avatarRobert Hancock <hancockr@shaw.ca>
    Cc: Jeff Garzik <jeff@garzik.org>
    Cc: Tejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    382a6652
sata_nv.c 45.2 KB