The initial runtime-PM reference is held only while initializing the NPU. Release it synchronously from ethosu_init() after the final hardware access, before registering the DRM device.
This keeps the runtime-PM setup and initial reference handling together and leaves the autosuspend configuration in place for subsequent jobs. Signed-off-by: Rob Herring (Arm) <[email protected]> --- v2: - new patch --- drivers/accel/ethosu/ethosu_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c index 8108622de258..df76253d01a6 100644 --- a/drivers/accel/ethosu/ethosu_drv.c +++ b/drivers/accel/ethosu/ethosu_drv.c @@ -338,6 +338,8 @@ static int ethosu_init(struct ethosu_device *ethosudev) ethosudev->npu_info.sram_size / 1024, ethosudev->npu_info.pmu_counters); + pm_runtime_put_sync_suspend(ethosudev->base.dev); + return 0; } @@ -376,10 +378,6 @@ static int ethosu_probe(struct platform_device *pdev) return ret; ret = drm_dev_register(ðosudev->base, 0); - if (ret) - pm_runtime_dont_use_autosuspend(ethosudev->base.dev); - - pm_runtime_put_autosuspend(ethosudev->base.dev); return ret; } -- 2.53.0
