The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are
supposed to be balanced on exit, add these calls.
Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Cc: stable@vger.kernel.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
---
drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index d932f7fd6170773890f561e3af444ac2c5730338..54a4c6ee1e71fe55794f09575979826d9aa5be9f 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1584,8 +1584,11 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
pm_runtime_get_noresume(dev);
ret = qcom_slim_ngd_qmi_svc_event_init(ctrl);
- if (ret)
+ if (ret) {
dev_err(&pdev->dev, "QMI service registration failed:%d", ret);
+ pm_runtime_dont_use_autosuspend(dev);
+ pm_runtime_disable(dev);
+ }
return ret;
}
@@ -1699,6 +1702,7 @@ static void qcom_slim_ngd_remove(struct platform_device *pdev)
{
struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);
qcom_slim_ngd_enable(ctrl, false);
qcom_slim_ngd_exit_dma(ctrl);
--
2.51.0
On Mon, Mar 09, 2026 at 11:09:07PM -0500, Bjorn Andersson wrote:
> The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are
> supposed to be balanced on exit, add these calls.
Use devm_pm_runtime_enable()?
>
> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> ---
> drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
--
With best wishes
Dmitry
On Wed, Mar 11, 2026 at 03:34:40AM +0200, Dmitry Baryshkov wrote:
> On Mon, Mar 09, 2026 at 11:09:07PM -0500, Bjorn Andersson wrote:
> > The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are
> > supposed to be balanced on exit, add these calls.
>
> Use devm_pm_runtime_enable()?
>
That would extend the pm_runtime_enabled() time until after
qcom_slim_ngd_remove() returns. I think that might be okay...
But I think we should continue this cleanup and try to clean up the dual
platform_drivers in the single driver. Also the PM runtime callbacks are
attached to the NGD, but the callbacks are exclusively operating on the
NGD ctrl (i.e. parent) state.
Regards,
Bjorn
> >
> > Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> > ---
> > drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
>
> --
> With best wishes
> Dmitry
On Mon, Mar 09, 2026 at 11:09:07PM -0500, Bjorn Andersson wrote:
> The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are
> supposed to be balanced on exit, add these calls.
>
> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> ---
> drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
> index d932f7fd6170773890f561e3af444ac2c5730338..54a4c6ee1e71fe55794f09575979826d9aa5be9f 100644
> --- a/drivers/slimbus/qcom-ngd-ctrl.c
> +++ b/drivers/slimbus/qcom-ngd-ctrl.c
> @@ -1584,8 +1584,11 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev)
> pm_runtime_enable(dev);
> pm_runtime_get_noresume(dev);
> ret = qcom_slim_ngd_qmi_svc_event_init(ctrl);
> - if (ret)
> + if (ret) {
> dev_err(&pdev->dev, "QMI service registration failed:%d", ret);
> + pm_runtime_dont_use_autosuspend(dev);
> + pm_runtime_disable(dev);
> + }
Can this entire pm_runtime_* calls moved after
qcom_slim_ngd_qmi_svc_event_init() ?
>
> return ret;
> }
> @@ -1699,6 +1702,7 @@ static void qcom_slim_ngd_remove(struct platform_device *pdev)
> {
> struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
>
> + pm_runtime_dont_use_autosuspend(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> qcom_slim_ngd_enable(ctrl, false);
> qcom_slim_ngd_exit_dma(ctrl);
>
> --
> 2.51.0
>
--
-Mukesh Ojha
On Tue, Mar 10, 2026 at 01:30:25PM +0530, Mukesh Ojha wrote:
> On Mon, Mar 09, 2026 at 11:09:07PM -0500, Bjorn Andersson wrote:
> > The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are
> > supposed to be balanced on exit, add these calls.
> >
> > Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> > ---
> > drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
> > index d932f7fd6170773890f561e3af444ac2c5730338..54a4c6ee1e71fe55794f09575979826d9aa5be9f 100644
> > --- a/drivers/slimbus/qcom-ngd-ctrl.c
> > +++ b/drivers/slimbus/qcom-ngd-ctrl.c
> > @@ -1584,8 +1584,11 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev)
> > pm_runtime_enable(dev);
> > pm_runtime_get_noresume(dev);
> > ret = qcom_slim_ngd_qmi_svc_event_init(ctrl);
> > - if (ret)
> > + if (ret) {
> > dev_err(&pdev->dev, "QMI service registration failed:%d", ret);
> > + pm_runtime_dont_use_autosuspend(dev);
> > + pm_runtime_disable(dev);
> > + }
>
> Can this entire pm_runtime_* calls moved after
> qcom_slim_ngd_qmi_svc_event_init() ?
>
As soon as qcom_slim_ngd_qmi_svc_event_init() executes we might get a
qcom_slim_ngd_qmi_new_server() if the service is already up which would
complete(qmi_up), which would unblock qcom_slim_ngd_up_worker() which
will invoke qcom_slim_ngd_enable() which currently operates
conditionally on pm_runtime_enabled().
So, what you're proposing does make some sense, but I think we should
try to clean that up in a subsequent series.
Regards,
Bjorn
> >
> > return ret;
> > }
> > @@ -1699,6 +1702,7 @@ static void qcom_slim_ngd_remove(struct platform_device *pdev)
> > {
> > struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
> >
> > + pm_runtime_dont_use_autosuspend(&pdev->dev);
> > pm_runtime_disable(&pdev->dev);
> > qcom_slim_ngd_enable(ctrl, false);
> > qcom_slim_ngd_exit_dma(ctrl);
> >
> > --
> > 2.51.0
> >
>
> --
> -Mukesh Ojha
© 2016 - 2026 Red Hat, Inc.