• Adrian Hunter's avatar
    mmc: sdhci: 64-bit DMA actually has 4-byte alignment · 04a5ae6f
    Adrian Hunter authored
    The version 3.00 SDHCI spec. was a bit unclear about the
    required data alignment for 64-bit DMA, whereas the version
    4.10 spec. uses different language and indicates that only
    4-byte alignment is required rather than the 8-byte alignment
    currently implemented.  That make no difference to SD and EMMC
    which invariably transfer data in sector-aligned blocks.
    However with SDIO, it results in using more DMA descriptors
    than necessary.  Theoretically that slows DMA slightly although
    DMA is not the limiting factor for throughput, so there is no
    discernable impact on performance.  Nevertheless, the driver
    should follw the spec unless there is good reason not to, so
    this patch corrects the alignment criterion.
    
    There is a more complicated criterion for the DMA descriptor
    table itself.  However the table is allocated by dma_alloc_coherent()
    which allocates pages (i.e. aligned to a page boundary).
    For simplicity just check it is 8-byte aligned, but add a comment
    that some Intel controllers actually require 8-byte alignment
    even when using 32-bit DMA.
    Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    04a5ae6f
sdhci.c 91.2 KB