public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>,
	"Sanyog Kale" <sanyog.r.kale@intel.com>,
	"Andy Gross" <agross@kernel.org>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@linaro.org>,
	"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Charles Keepax" <ckeepax@opensource.cirrus.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/2] soundwire: debugfs: fix unbalanced pm_runtime_put()
Date: Wed, 17 May 2023 11:47:35 -0500	[thread overview]
Message-ID: <805a61d6-64eb-5805-b0bf-74fcc317fb98@linux.intel.com> (raw)
In-Reply-To: <20230517163750.997629-2-krzysztof.kozlowski@linaro.org>



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@linaro.org>

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.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;
>  	}

  reply	other threads:[~2023-05-17 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 16:37 [PATCH 1/2] soundwire: qcom: fix unbalanced pm_runtime_put() Krzysztof Kozlowski
2023-05-17 16:37 ` [PATCH 2/2] soundwire: debugfs: " Krzysztof Kozlowski
2023-05-17 16:47   ` Pierre-Louis Bossart [this message]
2023-05-17 16:47 ` [PATCH 1/2] soundwire: qcom: " Pierre-Louis Bossart
2023-05-29  5:20 ` Vinod Koul

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=805a61d6-64eb-5805-b0bf-74fcc317fb98@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=agross@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andersson@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox