From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: kjlu@umn.edu, Fuqian Huang <huangfq.daxian@gmail.com>,
Benson Leung <bleung@chromium.org>,
Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
Lee Jones <lee.jones@linaro.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: cyapa - Fix rumtime PM imbalance on error
Date: Wed, 7 Apr 2021 23:19:44 -0700 [thread overview]
Message-ID: <YG6ggJyKT/eIlEGk@google.com> (raw)
In-Reply-To: <20210407040740.20257-1-dinghao.liu@zju.edu.cn>
Hi Dinghao,
On Wed, Apr 07, 2021 at 12:07:38PM +0800, Dinghao Liu wrote:
> When mutex_lock_interruptible() fails, a pairing PM usage
> counter decrement is needed to keep the counter balanced.
Thank you for the patch.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> drivers/input/mouse/cyapa.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> index 77cc653edca2..e411ab45a218 100644
> --- a/drivers/input/mouse/cyapa.c
> +++ b/drivers/input/mouse/cyapa.c
> @@ -904,8 +904,10 @@ static ssize_t cyapa_update_rt_suspend_scanrate(struct device *dev,
> pm_runtime_get_sync(dev);
>
> error = mutex_lock_interruptible(&cyapa->state_sync_lock);
> - if (error)
> + if (error) {
> + pm_runtime_put_noidle(dev);
Why "noidle" and not pm_runtime_put_sync_autosuspend() like we do in
case of normal flow?
> return error;
> + }
>
> cyapa->runtime_suspend_sleep_time = min_t(u16, time, 1000);
> cyapa->runtime_suspend_power_mode =
> --
> 2.17.1
>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2021-04-08 6:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 4:07 [PATCH] Input: cyapa - Fix rumtime PM imbalance on error Dinghao Liu
2021-04-08 6:19 ` Dmitry Torokhov [this message]
2021-04-08 6:29 ` dinghao.liu
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=YG6ggJyKT/eIlEGk@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andrzej.p@collabora.com \
--cc=bleung@chromium.org \
--cc=dinghao.liu@zju.edu.cn \
--cc=huangfq.daxian@gmail.com \
--cc=kjlu@umn.edu \
--cc=lee.jones@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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