diff mbox series

[RFC,2/2] slimbus: qcom-ngd-ctrl: Initialize ngd_up_work before it can be scheduled

Message ID 20220510144219.806391-3-y.oudjana@protonmail.com (mailing list archive)
State Not Applicable
Headers show
Series Make qcom-ngd-ctrl not wait indefinitely for already booted ADSP | expand

Commit Message

Yassine Oudjana May 10, 2022, 2:42 p.m. UTC
From: Yassine Oudjana <y.oudjana@protonmail.com>

ngd_up_work can be scheduled by the SSR notifier, which is registered
before it is initialized. Move initialization of ngd_up_work before
SSR notifier registration.

Fixes: a899d324863a3 ("slimbus: qcom-ngd-ctrl: add Sub System Restart support")
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
 drivers/slimbus/qcom-ngd-ctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 7040293c2ee8..73b9abba305f 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1490,7 +1490,6 @@  static int qcom_slim_ngd_probe(struct platform_device *pdev)
 	INIT_WORK(&ctrl->m_work, qcom_slim_ngd_master_worker);
-	INIT_WORK(&ctrl->ngd_up_work, qcom_slim_ngd_up_worker);
 	ctrl->mwq = create_singlethread_workqueue("ngd_master");
 	if (!ctrl->mwq) {
 		dev_err(&pdev->dev, "Failed to start master worker\n");
@@ -1539,6 +1538,8 @@  static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)
 		return ret;
+	INIT_WORK(&ctrl->ngd_up_work, qcom_slim_ngd_up_worker);
 	ctrl->nb.notifier_call = qcom_slim_ngd_ssr_notify;
 	ctrl->notifier = qcom_register_ssr_notifier("lpass", &ctrl->nb);
 	if (IS_ERR(ctrl->notifier))