[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <805a61d6-64eb-5805-b0bf-74fcc317fb98@linux.intel.com>
Date: Wed, 17 May 2023 11:47:35 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Vinod Koul <vkoul@...nel.org>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Péter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 2/2] soundwire: debugfs: fix unbalanced pm_runtime_put()
On 5/17/23 11:37, Krzysztof Kozlowski wrote:
> If pm_runtime_resume_and_get() failed with -EACCES, the driver continued
> execution and finally called pm_runtime_put_autosuspend(). Since
> pm_runtime_resume_and_get() drops the usage counter on every error, this
> lead to double decrement of that counter.
>
> Fixes: b275bf45ba1d ("soundwire: debugfs: Switch to sdw_read_no_pm")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> ---
> drivers/soundwire/debugfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c
> index dea782e0edc4..c3a1a359ee5c 100644
> --- a/drivers/soundwire/debugfs.c
> +++ b/drivers/soundwire/debugfs.c
> @@ -56,8 +56,9 @@ static int sdw_slave_reg_show(struct seq_file *s_file, void *data)
> if (!buf)
> return -ENOMEM;
>
> - ret = pm_runtime_resume_and_get(&slave->dev);
> + ret = pm_runtime_get_sync(&slave->dev);
> if (ret < 0 && ret != -EACCES) {
> + pm_runtime_put_noidle(&slave->dev);
> kfree(buf);
> return ret;
> }
Powered by blists - more mailing lists