LF-4858: dmaengine: imx-sdma: retry load sdma firmware fail
authorJoy Zou <joy.zou@nxp.com>
Thu, 23 Dec 2021 06:44:51 +0000 (14:44 +0800)
committerJosep Orga <jorga@somdevices.com>
Tue, 27 Jun 2023 14:03:17 +0000 (16:03 +0200)
commitb451fb778373bf85f84324138a748c8c6c95035b
tree7cf59be022987baba99c5868b86c3d716b1ee32a
parent202239ca573b978cdea0265e4face75e333f17ca
LF-4858: dmaengine: imx-sdma: retry load sdma firmware fail

If there is more than one sdma controller, the first controller
load sdma firmware using fallback failed in first time, it will
retry load sdma firmware again. But the second sdma controller
error state clean up may be still not finished (the firmware
request priv data has not been released). So the retry will fail
immediately due to get the old firmware priv data.

The fail log as follow:

[   62.505753] imx-sdma 30e10000.dma-controller: external firmware not found, using ROM firmware
[   62.599868] imx-sdma 30bd0000.dma-controller: firmware found.
[   62.605808] imx-sdma 30bd0000.dma-controller: loaded firmware 4.6

This patch adds a bit delay to wait for the second controller
firmware priv data released.

This issue is very hard to reproduce with yocto rootfs.
The 20ms delay is tested value with ubuntu rootfs which is more easy
to reproduce.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
drivers/dma/imx-sdma.c