From: Sakari Ailus <sakari.ailus@iki.fi>
To: Martin Kepplinger <martin.kepplinger@puri.sm>
Cc: laurent.pinchart@ideasonboard.com, kernel@puri.sm,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
mchehab@kernel.org
Subject: Re: [PATCH v2] media: hi846: fix usage of pm_runtime_get_if_in_use()
Date: Tue, 16 May 2023 16:22:58 +0300 [thread overview]
Message-ID: <ZGODstToZrypFaAV@valkosipuli.retiisi.eu> (raw)
In-Reply-To: <20230425094747.2769693-1-martin.kepplinger@puri.sm>
Hi Martin,
On Tue, Apr 25, 2023 at 11:47:47AM +0200, Martin Kepplinger wrote:
> pm_runtime_get_if_in_use() does not only return nonzero values when
> the device is in use, it can return a negative errno too.
>
> And especially during resuming from system suspend, when runtime pm
> is not yet up again, -EAGAIN is being returned, so the subsequent
> pm_runtime_put() call results in a refcount underflow.
>
> Fix system-resume by handling -EAGAIN of pm_runtime_get_if_in_use().
>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> ---
>
> revision history
> ----------------
> v2 (thank you Sakari and Laurent):
> * drop the other patch (the streaming-state in suspend/resume needs to
> be solved differently).
> * Sakari pointed out that many drivers are affected by this and that
> runtime-pm might need changes instead. I think this patch doesn't hurt
> and could serve as a reminder to do so.
I guess it's appropriate to add:
Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera")
--
Sakari Ailus
next prev parent reply other threads:[~2023-05-16 13:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 9:47 Martin Kepplinger
2023-05-16 13:22 ` Sakari Ailus [this message]
2023-05-23 10:07 ` Martin Kepplinger
2023-05-29 20:40 ` Sakari Ailus
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=ZGODstToZrypFaAV@valkosipuli.retiisi.eu \
--to=sakari.ailus@iki.fi \
--cc=kernel@puri.sm \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=martin.kepplinger@puri.sm \
--cc=mchehab@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
Powered by JetHome