From e334b71c4179cb27b9bd6958413f93de971330d0 Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Mon, 5 Apr 2021 13:40:07 -0700 Subject: [PATCH] dsp: probe defer when remoteproc is uninitialized There can be race condition that audio_notifier probe function is called before remoteproc-adsp driver instance is initialized. In such case, NULL handle would be returned. It should not be treated as unrecovery error. Update return status to EPROBE_DEFER upon getting NULL handle back from remoteproc Change-Id: Id9d182949d12923a25b582142e3fe8bad85e19de Signed-off-by: Vignesh Kulothungan Signed-off-by: Patrick Lai --- dsp/audio_notifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsp/audio_notifier.c b/dsp/audio_notifier.c index 81df977dab..7afc7245b5 100644 --- a/dsp/audio_notifier.c +++ b/dsp/audio_notifier.c @@ -626,13 +626,13 @@ static int audio_notify_probe(struct platform_device *pdev) priv->rproc_h = rproc_get_by_phandle(rproc_phandle); if (!priv->rproc_h) { - dev_err(&pdev->dev, "remotproc handle NULL\n"); + dev_info_ratelimited(&pdev->dev, "remotproc handle NULL\n"); + ret = -EPROBE_DEFER; return ret; } adsp_private = pdev; - audio_notifier_subsys_init(); audio_notifier_init_service(AUDIO_NOTIFIER_PDR_SERVICE);