From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Jarrah Gosbell <kernel@undef.tools>,
Arnaud Ferraris <arnaud.ferraris@collabora.com>,
laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH] media: ov5640: use pm_runtime_force_suspend/resume for system suspend
Date: Wed, 13 Sep 2023 23:48:13 +0300 [thread overview]
Message-ID: <ZQIgDb0usm768umH@skv.local> (raw)
In-Reply-To: <ZQHU+LA+BEB7jzx1@valkosipuli.retiisi.eu>
Hi Sakari,
On 23-09-13 15:27, Sakari Ailus wrote:
> Hi Andrey,
>
> On Fri, Aug 18, 2023 at 08:34:16PM +0300, Andrey Skvortsov wrote:
> > If system was suspended while camera sensor was used, data and
> > interrupts were still coming from sensor and that caused unstable
> > system. Sometimes system hanged during a resume. Use
> > pm_runtime_force_* helpers in order to support system suspend.
> >
> > Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
>
> Thanks for the patch.
>
> It's not been documented really how system suspend and resume should
> work for complex cameras. But I don't think it can be done by drivers
> separately as the CSI-2 bus initialisation requires actions from both
> sender and receiver drivers, at particular points of time.
Thanks for the review.
I've tested this on PinePhone A64. It uses DVP, maybe because of that
system suspend/resume worked good in my case.
Originally I've implemented system suspend/resume similar to this [1]
or [2] as I've seen this approach in other mainlined drivers. But some
drivers reuse pm_runtime_force_* helpers, so I've went with this.
Do you think it would be better to use something like [2] until there
is better well defined way for system suspend/resume for complex cameras?
>
> So I think we'll need to initiate this from the driver handling DMA, just
> as starting and stopping streaming. Even then, there needs to be a
> certainty that the sensor device has resumed before streaming is started. I
> recall Laurent suggested device links for that purpose, but I don't think
> any work has been done to implement it that way.
1. https://salsa.debian.org/Mobian-team/devices/kernels/sunxi64-linux/-/blob/mobian-6.1/debian/patches/camera/0076-media-gc2145-implement-system-suspend.patch
2. https://elixir.bootlin.com/linux/latest/source/drivers/media/i2c/imx219.c#L1159
--
Best regards,
Andrey Skvortsov
next prev parent reply other threads:[~2023-09-13 20:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 17:34 [PATCH] media: ov5640: use pm_runtime_force_suspend/resume for system suspend Andrey Skvortsov
2023-09-13 15:27 ` Sakari Ailus
2023-09-13 20:48 ` Andrey Skvortsov [this message]
2023-09-14 8:54 ` Jacopo Mondi
2023-09-14 9:02 ` Laurent Pinchart
2023-09-14 9:55 ` 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=ZQIgDb0usm768umH@skv.local \
--to=andrej.skvortzov@gmail.com \
--cc=arnaud.ferraris@collabora.com \
--cc=kernel@undef.tools \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=sakari.ailus@linux.intel.com \
--cc=slongerbeam@gmail.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