All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Cc: tomm.merciai@gmail.com, linux-renesas-soc@vger.kernel.org,
	 biju.das.jz@bp.renesas.com,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	 Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	 linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/9] media: rzg2l-cru: Add device_link from CRU to CSI-2
Date: Mon, 27 Jul 2026 11:45:50 +0200	[thread overview]
Message-ID: <amcn1m-RFmVdeCsE@zed> (raw)
In-Reply-To: <20260616170542.447804-2-tommaso.merciai.xr@bp.renesas.com>

Hi Tommaso

On Tue, Jun 16, 2026 at 07:05:31PM +0200, Tommaso Merciai wrote:
> The CRU device depends on CSI-2 to operate. Without an explicit
> device_link the PM core has no knowledge of this dependency and may
> suspend CSI-2 while CRU is still active, or resume CRU before CSI-2
> is ready.
>
> Add a DL_FLAG_STATELESS device_link from the CRU to CSI-2 when the
> CSI-2 subdev binds. This instructs the PM core to suspend CRU before
> CSI-2 and to resume CSI-2 before CRU. The link is deleted on unbind.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
> index 3c5fbd857371..1b12d91eaec9 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
> @@ -101,6 +101,7 @@ static void rzg2l_cru_group_notify_unbind(struct v4l2_async_notifier *notifier,
>  	mutex_lock(&cru->mdev_lock);
>
>  	if (cru->csi.asd == asd) {
> +		device_link_remove(cru->dev, subdev->dev);
>  		cru->csi.subdev = NULL;
>  		dev_dbg(cru->dev, "Unbind CSI-2 %s\n", subdev->name);
>  	}
> @@ -118,6 +119,12 @@ static int rzg2l_cru_group_notify_bound(struct v4l2_async_notifier *notifier,
>
>  	if (cru->csi.asd == asd) {
>  		cru->csi.subdev = subdev;
> +		if (!device_link_add(cru->dev, subdev->dev, DL_FLAG_STATELESS)) {

So, cru-core and cru-csi2 are two different drivers, guarded by two
different config symbols, both live in drivers/media/platforms/renesas/rzg2l-cru/

I guess it doesn't make much sense to have one without the other, but
the build system allows that. That might be the reason why you used
STATELESS here, but since this call happens at _bound() time, doesn't
it mean we're sure the supplier driver is there and has probed
correctly already ?

I guess you don't want DL_FLAG_PM_RUNTIME as this series is for system
suspend/resume, right ?

> +			dev_err(cru->dev, "Failed to create device link to CSI-2 %s\n",
> +				subdev->name);
> +			mutex_unlock(&cru->mdev_lock);
> +			return -EINVAL;
> +		}
>  		dev_dbg(cru->dev, "Bound CSI-2 %s\n", subdev->name);
>  	}
>
> --
> 2.54.0
>

  reply	other threads:[~2026-07-27  9:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 17:05 [PATCH 0/9] media: rzg2l-cru: Add suspend/resume support Tommaso Merciai
2026-06-16 17:05 ` [PATCH 1/9] media: rzg2l-cru: Add device_link from CRU to CSI-2 Tommaso Merciai
2026-07-27  9:45   ` Jacopo Mondi [this message]
2026-07-27 15:02     ` Tommaso Merciai
2026-07-27  9:50   ` Jacopo Mondi
2026-07-27 15:17     ` Tommaso Merciai
2026-06-16 17:05 ` [PATCH 2/9] media: rzg2l-cru: csi2: Add device_link from CSI-2 to sensor Tommaso Merciai
2026-07-27  9:48   ` Jacopo Mondi
2026-07-27 15:41     ` Tommaso Merciai
2026-06-16 17:05 ` [PATCH 3/9] media: rzg2l-cru: Use bulk reset API in rzg2l_cru_start_streaming_vq() Tommaso Merciai
2026-07-27  9:55   ` Jacopo Mondi
2026-06-16 17:05 ` [PATCH 4/9] media: rzg2l-cru: Drop stop streaming function Tommaso Merciai
2026-07-27  9:55   ` Jacopo Mondi
2026-06-16 17:05 ` [PATCH 5/9] media: rzg2l-cru: Move active_slot reset into rzg2l_cru_set_stream() Tommaso Merciai
2026-07-27 10:11   ` Jacopo Mondi
2026-06-16 17:05 ` [PATCH 6/9] media: rzg2l-cru: Add suspend/resume support Tommaso Merciai
2026-07-27 10:20   ` Jacopo Mondi
2026-06-16 17:05 ` [PATCH 7/9] media: rzg2l-cru: csi2: Add system sleep PM support Tommaso Merciai
2026-06-16 17:05 ` [PATCH 8/9] media: i2c: ov5645: Switch to RUNTIME_PM_OPS() and pm_ptr() Tommaso Merciai
2026-06-16 17:05 ` [PATCH 9/9] media: i2c: ov5645: Add suspend/resume support Tommaso Merciai
2026-07-15  8:47 ` [PATCH 0/9] media: rzg2l-cru: " Tommaso Merciai

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=amcn1m-RFmVdeCsE@zed \
    --to=jacopo.mondi@ideasonboard.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomm.merciai@gmail.com \
    --cc=tommaso.merciai.xr@bp.renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.