]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle
authorTony Lindgren <tony@atomide.com>
Wed, 23 Oct 2019 15:31:38 +0000 (08:31 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 23 Oct 2019 15:45:21 +0000 (21:15 +0530)
commite4e2678b401087eddd5e769b8b90d6fcf859a7e1
treecec456f7693c0ec24b38acc8a15fda8d45db7d9b
parent103b7d04a925db6242f2f5a4e5d577e49a12a1d0
dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle

Yegor Yefremov <yegorslists@googlemail.com> reported that musb and ftdi
uart can fail for the first open of the uart unless connected using
a hub.

This is because the first dma call done by musb_ep_program() must wait
if cppi41 is PM runtime suspended. Otherwise musb_ep_program() continues
with other non-dma packets before the DMA transfer is started causing at
least ftdi uarts to fail to receive data.

Let's fix the issue by waking up cppi41 with PM runtime calls added to
cppi41_dma_prep_slave_sg() and return NULL if still idled. This way we
have musb_ep_program() continue with PIO until cppi41 is awake.

Fixes: b8fd015e92f7 ("dmaengine: cppi41: Add basic PM runtime support")
Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: stable@vger.kernel.org # v4.9+
Link: https://lore.kernel.org/r/20191023153138.23442-1-tony@atomide.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/cppi41.c