On imx8mq platform, system hangs up during booting phase if the
HDMI monitor is connected. This issue is caused by commit 501ac079acd7
("dmaengine: imx-sdma: Make runtime PM irq safe"). After changing
the consistent DMA into streaming DMA, it needs to copy data firstly,
and then do the DMA mapping operation so that the expected data
is stored to dma physical address.

Signed-off-by: Meng Li <meng...@windriver.com>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 5de05041e8e4..1f5997db027e 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -898,6 +898,8 @@ static int sdma_load_script(struct sdma_engine *sdma)
        if (!buf_virt)
                return -ENOMEM;
 
+       memcpy(buf_virt, ram_code, header->ram_code_size);
+
        buf_phys = dma_map_single(sdma->dev, buf_virt,
                                        header->ram_code_size,
                                        DMA_TO_DEVICE);
@@ -912,8 +914,6 @@ static int sdma_load_script(struct sdma_engine *sdma)
        bd0->buffer_addr = buf_phys;
        bd0->ext_buffer_addr = addr->ram_code_start_addr;
 
-       memcpy(buf_virt, ram_code, header->ram_code_size);
-
        ret = sdma_run_channel0(sdma);
 
        spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13780): 
https://lists.yoctoproject.org/g/linux-yocto/message/13780
Mute This Topic: https://lists.yoctoproject.org/mt/105397625/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to