• Robin Gong's avatar
    dmaengine: imx-sdma: add virt-dma support · 57b772b8
    Robin Gong authored
    The legacy sdma driver has below limitations or drawbacks:
      1. Hardcode the max BDs number as "PAGE_SIZE / sizeof(*)", and alloc
         one page size for one channel regardless of only few BDs needed
         most time. But in few cases, the max PAGE_SIZE maybe not enough.
      2. One SDMA channel can't stop immediatley once channel disabled which
         means SDMA interrupt may come in after this channel terminated.There
         are some patches for this corner case such as commit "2746e2c3",
         but not cover non-cyclic.
    
    The common virt-dma overcomes the above limitations. It can alloc bd
    dynamically and free bd once this tx transfer done. No memory wasted or
    maximum limititation here, only depends on how many memory can be requested
    from kernel. For No.2, such issue can be workaround by checking if there
    is available descript("sdmac->desc") now once the unwanted interrupt
    coming. At last the common virt-dma is easier for sdma driver maintain.
    Signed-off-by: default avatarRobin Gong <yibin.gong@nxp.com>
    Reviewed-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
    Tested-by: default avatarLucas Stach <l.stach@pengutronix.de>
    Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
    57b772b8
Kconfig 18.5 KB