Dear All!
I have a custom board with an IMX6ULL on it.
If the power is turned on and off repeatedly, the return value of the pm_runtime_get_sync(sdma->dev) function is -13 and an error occurs.
Sometimes the symptoms above occur, but the cause is unknown.
If you retry after seeing the return value as shown below, the firmware is read normally.
Can I use it like this?
ret = pm_runtime_get_sync(sdma->dev);
if (ret < 0) {
dev_err(sdma->dev, "pm_runtime_get_sync err %d\n", ret);
pm_runtime_get_sync(sdma->dev);
}
If using this way is a problem, is there any other way?
//---------------------------------------------------------------------------------------------------------------------------
[[ os status and error messages ]]
uname -a
Linux 5.10.72-lts-5.10.y+ga68e31b #56 SMP PREEMPT Fri Jun 24 15:18:26 KST 2022 armv7l GNU/Linux
// kernel config
CONFIG_IMX_SDMA=m
CONFIG_DMA_VIRTUAL_CHANNELS=y
// driver/dma/imx-sdma.c
Line 2257
dev_info(sdma->dev, "firmware found.\n");
if (!sdma->fw_data) {
sdma->fw_data = kmalloc(fw->size, GFP_KERNEL);
if (!sdma->fw_data)
goto err_firmware;
memcpy(sdma->fw_data, fw->data, fw->size);
dev_info(sdma->dev, "memcpy size : %d\n", fw->size);
if (!sdma->drvdata->pm_runtime){
=> ret = pm_runtime_get_sync(sdma->dev);
if (ret < 0) {
=> dev_err(sdma->dev, "pm_runtime_get_sync err %d\n", ret);
}
}
}
// normal boot message
[ 10.474954] imx-sdma 20ec000.sdma: firmware found.
[ 10.479804] imx-sdma 20ec000.sdma: memcpy size : 2970
[ 10.625768] imx-sdma 20ec000.sdma: loaded firmware 3.6
// error boot message
[ 10.310526] imx-sdma 20ec000.sdma: firmware found.
[ 10.350879] imx-sdma 20ec000.sdma: memcpy size : 2970
[ 10.355971] imx-sdma 20ec000.sdma: pm_runtime_get_sync err -13