From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: stephan@gerhold.net, loic.poulain@linaro.org,
ryazanov.s.a@gmail.com, johannes@sipsolutions.net,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] net: wwan: qcom_bam_dmux: Fix missing pm_runtime_disable()
Date: Fri, 20 Sep 2024 14:45:53 +0200 [thread overview]
Message-ID: <Zu1ugT3cYptfeUaa@linaro.org> (raw)
In-Reply-To: <20240920100711.2744120-1-ruanjinjie@huawei.com>
On Fri, Sep 20, 2024 at 06:07:11PM +0800, Jinjie Ruan wrote:
> It's important to undo pm_runtime_use_autosuspend() with
> pm_runtime_dont_use_autosuspend() at driver exit time.
>
> But the pm_runtime_disable() and pm_runtime_dont_use_autosuspend()
> is missing in the error path for bam_dmux_probe(). So add it.
>
> Fixes: 21a0ffd9b38c ("net: wwan: Add Qualcomm BAM-DMUX WWAN network driver")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/net/wwan/qcom_bam_dmux.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wwan/qcom_bam_dmux.c b/drivers/net/wwan/qcom_bam_dmux.c
> index 26ca719fa0de..34a4e8095161 100644
> --- a/drivers/net/wwan/qcom_bam_dmux.c
> +++ b/drivers/net/wwan/qcom_bam_dmux.c
> @@ -823,17 +823,17 @@ static int bam_dmux_probe(struct platform_device *pdev)
> ret = devm_request_threaded_irq(dev, pc_ack_irq, NULL, bam_dmux_pc_ack_irq,
> IRQF_ONESHOT, NULL, dmux);
> if (ret)
> - return ret;
> + goto err_disable_pm;
>
> ret = devm_request_threaded_irq(dev, dmux->pc_irq, NULL, bam_dmux_pc_irq,
> IRQF_ONESHOT, NULL, dmux);
> if (ret)
> - return ret;
> + goto err_disable_pm;
>
> ret = irq_get_irqchip_state(dmux->pc_irq, IRQCHIP_STATE_LINE_LEVEL,
> &dmux->pc_state);
> if (ret)
> - return ret;
> + goto err_disable_pm;
>
> /* Check if remote finished initialization before us */
> if (dmux->pc_state) {
> @@ -844,6 +844,12 @@ static int bam_dmux_probe(struct platform_device *pdev)
> }
>
> return 0;
> +
> +err_disable_pm:
> + pm_runtime_disable(dev);
> + pm_runtime_dont_use_autosuspend(dev);
> + pm_runtime_set_suspended(dev);
Please drop the pm_runtime_set_suspended(dev); line, it should be
unneeded since runtime PM documentation says:
the initial runtime PM status of all devices is ‘suspended’
Thanks,
Stephan
next prev parent reply other threads:[~2024-09-20 12:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 10:07 [PATCH] net: wwan: qcom_bam_dmux: Fix missing pm_runtime_disable() Jinjie Ruan
2024-09-20 10:48 ` Dmitry Baryshkov
2024-09-20 12:44 ` Stephan Gerhold
2024-09-20 13:05 ` Dmitry Baryshkov
2024-09-20 13:38 ` Stephan Gerhold
2024-09-23 2:25 ` Jinjie Ruan
2024-09-23 9:05 ` Stephan Gerhold
2024-09-20 12:45 ` Stephan Gerhold [this message]
2024-09-23 9:16 ` Jinjie Ruan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zu1ugT3cYptfeUaa@linaro.org \
--to=stephan.gerhold@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ruanjinjie@huawei.com \
--cc=ryazanov.s.a@gmail.com \
--cc=stephan@gerhold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.