]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
slimbus: qcom-ngd-ctrl: Correct PDR and SSR cleanup ownership
authorBjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Sat, 30 May 2026 20:44:17 +0000 (21:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jun 2026 15:19:51 +0000 (17:19 +0200)
PDR and SSR callbacks are registred from the controller probe function,
but currently released from the child device's remove function.

The remove() function should only be unwinding what was done in the
same device's probe() function.

Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260530204421.116824-5-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/slimbus/qcom-ngd-ctrl.c

index 6b91a6f11cb66164527ece371dab8ba77d803ab9..e9238927cd2a03c3086a90cefa31f0d437cd5d97 100644 (file)
@@ -1683,6 +1683,9 @@ static void qcom_slim_ngd_ctrl_remove(struct platform_device *pdev)
 {
        struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
 
+       pdr_handle_release(ctrl->pdr);
+       qcom_unregister_ssr_notifier(ctrl->notifier, &ctrl->nb);
+
        qcom_slim_ngd_unregister(ctrl);
 }
 
@@ -1691,8 +1694,6 @@ static void qcom_slim_ngd_remove(struct platform_device *pdev)
        struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
 
        pm_runtime_disable(&pdev->dev);
-       pdr_handle_release(ctrl->pdr);
-       qcom_unregister_ssr_notifier(ctrl->notifier, &ctrl->nb);
        qcom_slim_ngd_enable(ctrl, false);
        qcom_slim_ngd_exit_dma(ctrl);
        qcom_slim_ngd_qmi_svc_event_deinit(&ctrl->qmi);