mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lachlan Michael <lachlan.michael@sony.com>,
	mchehab@kernel.org, hverkuil+cisco@kernel.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	kieran.bingham@ideasonboard.com, jai.luthra@ideasonboard.com,
	Ryuichi.Tadano@sony.com, Kengo.Hayasaka@sony.com,
	Tim.Bird@sony.com, Kazumi.A.Sato@sony.com,
	Yuji.John.Takahashi@sony.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] media: i2c: Add Sony IMX908 image sensor driver
Date: Thu, 1 Oct 2026 16:45:42 +0300	[thread overview]
Message-ID: <ar5kBpv8hdkpldp9@kekkonen.localdomain> (raw)
In-Reply-To: <20261001133138.GM944070@killaraus.ideasonboard.com>

Hi Laurent,

On Thu, Oct 01, 2026 at 04:31:38PM +0300, Laurent Pinchart wrote:
> On Thu, Oct 01, 2026 at 03:24:54PM +0300, Sakari Ailus wrote:
> > > +static int imx908_set_selection(struct v4l2_subdev *sd,
> > > +				struct v4l2_subdev_state *sd_state,
> > > +				struct v4l2_subdev_selection *sel)
> > 
> > We don't really have cropping behaviour documented before the common raw
> > sensor model. I'd just postpone this until we have the common raw sensor
> > model support
> > <URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=metadata> merged.
> 
> There's real progress on merging the raw camera sensor model, with Jai
> finalizing the implementation in libcamera. We could drop crop support
> for the initial version of the IMX908 driver or wait for the raw camera
> sensor model to be merged. The former is probably better to avoid
> delays.
> 
> Lachlan, sorry about this last-minute request. Hopefully it will be
> quite simple to drop the .set_selection() handler and hardcode full
> resolution. imx908_update_framing_limits() will then have no user and
> could be dropped too. We'll add it back one kernel version later by
> adding crop support based on the raw camera sensor model.

As an added bonus, it'll be more simple to support that in the driver, too.

> > > +static int imx908_disable_streams(struct v4l2_subdev *sd,
> > > +				  struct v4l2_subdev_state *sd_state,
> > > +				  u32 pad,
> > > +				  u64 streams_mask)
> > > +{
> > > +	struct imx908 *imx = to_imx908(sd);
> > > +	int ret;
> > > +
> > > +	ret = imx908_stop_streaming(imx);
> > 
> > imx908_stop_streaming() is used in a single location only. I think you
> > should move the code here. Same for imx908_enable_streams() and
> > imx906_start_streaming(), too.
> 
> For imx908_start_streaming() it could make error handling a tiny bit
> more complex. This is the kind of detail I'd leave to the appreciation
> of the driver author.

Works for me. In that case I'd move the other function just above the
caller.

...

> > > +	/* Device is powered; keep it resumed across registration, release at end */
> > > +	pm_runtime_set_active(imx->dev);
> > > +	pm_runtime_get_noresume(imx->dev);
> > > +	ret = devm_pm_runtime_enable(imx->dev);
> > 
> > What will happen on error here? PM runtime will be disabled after probe()
> > exits on error, but you'd need to set the state to suspended after that.
> > I'm not sure you can correctly use this as things stand currently. This
> > also conflicts currently with remove() below disabling Runtime PM
> > explicitly.
> 
> I'm not sure to understand what's requested here. Are you saying there's
> a potential issue that can't be fixed currently ? Or should this code be
> modified ? In the latter case, could you please tell what should be done
> ?

I'd just avoid using devm_pm_runtime_enable() here. The problem really is
that you'll need to set the device to suspended state (as well as power it
off) *after* devm does its teardown work. You can't do that, at least not
right now, without introducing devm variant of setting the state active.
There may be dependencies to some assumptions on how devices are unbound.

-- 
Regards,

Sakari Ailus

      parent reply	other threads:[~2026-10-01 13:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  6:48 [PATCH v3 0/2] Add bindings and driver for Sony IMX908 Lachlan Michael
2026-08-28  6:48 ` [PATCH v3 1/2] media: dt-bindings: imx908: Add Sony IMX908 sensor Lachlan Michael
2026-08-28 16:32   ` Conor Dooley
2026-09-29  0:28   ` Laurent Pinchart
2026-08-28  6:48 ` [PATCH v3 2/2] media: i2c: Add Sony IMX908 image sensor driver Lachlan Michael
2026-09-21 16:28   ` Jai Luthra
2026-09-29  1:26     ` Laurent Pinchart
2026-10-01  8:40       ` Lachlan Michael
2026-10-01 13:42         ` Laurent Pinchart
2026-10-01  8:36     ` Lachlan Michael
2026-10-01 12:24   ` Sakari Ailus
2026-10-01 13:31     ` Laurent Pinchart
2026-10-01 13:41       ` Laurent Pinchart
2026-10-01 13:45       ` Sakari Ailus [this message]

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=ar5kBpv8hdkpldp9@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=Kazumi.A.Sato@sony.com \
    --cc=Kengo.Hayasaka@sony.com \
    --cc=Ryuichi.Tadano@sony.com \
    --cc=Tim.Bird@sony.com \
    --cc=Yuji.John.Takahashi@sony.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jai.luthra@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=krzk+dt@kernel.org \
    --cc=lachlan.michael@sony.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@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

all inboxes | Powered by JetHome®