• Claudiu Beznea's avatar
    dmaengine: at_xdmac: do not resume channels paused by consumers · 44fe8440
    Claudiu Beznea authored
    In case there are DMA channels not paused by consumers in suspend
    process (valid on AT91 SoCs for serial driver when no_console_suspend) the
    driver pauses them (using at_xdmac_device_pause() which is also the same
    function called by dmaengine_pause()) and then in the resume process the
    driver resumes them calling at_xdmac_device_resume() which is the same
    function called by dmaengine_resume()). This is good for DMA channels
    not paused by consumers but for drivers that calls
    dmaengine_pause()/dmaegine_resume() on suspend/resume path this may lead to
    DMA channel being enabled before the IP is enabled. For IPs that needs
    strict ordering with regards to DMA channel enablement this will lead to
    wrong behavior. To fix this add a new set of functions
    at_xdmac_device_pause_internal()/at_xdmac_device_resume_internal() to be
    called only on suspend/resume.
    
    Fixes: e1f7c9ee ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
    Link: https://lore.kernel.org/r/20230214151827.1050280-4-claudiu.beznea@microchip.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    44fe8440
at_xdmac.c 75.5 KB