lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <AS8PR04MB90805590BB4501F7F4289624FA2BA@AS8PR04MB9080.eurprd04.prod.outlook.com>
Date: Tue, 12 Aug 2025 09:29:17 +0000
From: "G.N. Zhou" <guoniu.zhou@....com>
To: "G.N. Zhou (OSS)" <guoniu.zhou@....nxp.com>, Laurent Pinchart
	<laurent.pinchart@...asonboard.com>, "rmfrfs@...il.com" <rmfrfs@...il.com>,
	"martink@...teo.de" <martink@...teo.de>, "kernel@...i.sm" <kernel@...i.sm>,
	"mchehab@...nel.org" <mchehab@...nel.org>
CC: "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>, "kernel@...gutronix.de"
	<kernel@...gutronix.de>, "festevam@...il.com" <festevam@...il.com>,
	"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, Frank Li <frank.li@....com>
Subject: RE: [PATCH] media: nxp: imx8-isi: Add suspend/resume support for ISI
 mem2mem

Hi,

Could you help to please review the patches which I have submitted some time back to linux media community.
Your feedback will be very appreciated. Thanks.

Best Regards
G.N Zhou


> -----Original Message-----
> From: G.N. Zhou (OSS)
> Sent: Thursday, July 17, 2025 10:41 AM
> To: Laurent Pinchart <laurent.pinchart@...asonboard.com>;
> rmfrfs@...il.com; martink@...teo.de; kernel@...i.sm;
> mchehab@...nel.org
> Cc: s.hauer@...gutronix.de; kernel@...gutronix.de; festevam@...il.com;
> linux-media@...r.kernel.org; imx@...ts.linux.dev; linux-arm-
> kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: [PATCH] media: nxp: imx8-isi: Add suspend/resume support for ISI
> mem2mem
> 
> From: Guoniu Zhou <guoniu.zhou@....com>
> 
> Add suspend/resume support for ISI when work at memory to memory mode.
> 
> Signed-off-by: Guoniu Zhou <guoniu.zhou@....com>
> ---
>  .../platform/nxp/imx8-isi/imx8-isi-core.c     |  8 ++++
>  .../platform/nxp/imx8-isi/imx8-isi-core.h     | 11 +++++
>  .../platform/nxp/imx8-isi/imx8-isi-m2m.c      | 48 +++++++++++++++++++
>  3 files changed, 67 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> index 981648a03113..6eef45302e6c 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> @@ -372,6 +372,7 @@ static int mxc_isi_pm_suspend(struct device *dev)
>  		struct mxc_isi_pipe *pipe = &isi->pipes[i];
> 
>  		mxc_isi_video_suspend(pipe);
> +		mxc_isi_m2m_suspend(pipe);
>  	}
> 
>  	return pm_runtime_force_suspend(dev);
> @@ -401,6 +402,13 @@ static int mxc_isi_pm_resume(struct device *dev)
>  			 */
>  			err = ret;
>  		}
> +
> +		ret = mxc_isi_m2m_resume(pipe);
> +		if (ret) {
> +			dev_err(dev, "Failed to resume ISI%u (%d) for m2m\n",
> i,
> +				ret);
> +			err = ret;
> +		}
>  	}
> 
>  	return err;
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> index 206995bedca4..b979b79b5525 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> @@ -343,6 +343,8 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev
> *isi, struct vb2_buffer *vb2  #ifdef CONFIG_VIDEO_IMX8_ISI_M2M  int
> mxc_isi_m2m_register(struct mxc_isi_dev *isi, struct v4l2_device *v4l2_dev);
> int mxc_isi_m2m_unregister(struct mxc_isi_dev *isi);
> +void mxc_isi_m2m_suspend(struct mxc_isi_pipe *pipe); int
> +mxc_isi_m2m_resume(struct mxc_isi_pipe *pipe);
>  #else
>  static inline int mxc_isi_m2m_register(struct mxc_isi_dev *isi,
>  				       struct v4l2_device *v4l2_dev) @@ -353,6
> +355,15 @@ static inline int mxc_isi_m2m_unregister(struct mxc_isi_dev *isi)
> {
>  	return 0;
>  }
> +
> +static inline void mxc_isi_m2m_suspend(struct mxc_isi_pipe *pipe) { }
> +
> +static inline int mxc_isi_m2m_resume(struct mxc_isi_pipe *pipe) {
> +	return 0;
> +}
>  #endif
> 
>  int mxc_isi_channel_acquire(struct mxc_isi_pipe *pipe, diff --git
> a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> index 22e49d3a1287..fe9d85335b6c 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> @@ -732,6 +732,54 @@ static const struct v4l2_file_operations
> mxc_isi_m2m_fops = {
>  	.mmap		= v4l2_m2m_fop_mmap,
>  };
> 
> +/*
> +-----------------------------------------------------------------------
> +------
> + * Suspend & resume
> + */
> +
> +void mxc_isi_m2m_suspend(struct mxc_isi_pipe *pipe) {
> +	struct mxc_isi_m2m *m2m = &pipe->isi->m2m;
> +	struct mxc_isi_m2m_ctx *ctx = m2m->last_ctx;
> +
> +	/*
> +	 * Check pipe for ISI memory to memory since only
> +	 * channel 0 support this feature.
> +	 */
> +	if (m2m->pipe != pipe || m2m->usage_count == 0)
> +		return;
> +
> +	v4l2_m2m_suspend(m2m->m2m_dev);
> +
> +	if (ctx->chained)
> +		mxc_isi_channel_unchain(pipe);
> +
> +	mxc_isi_channel_disable(pipe);
> +	mxc_isi_channel_put(pipe);
> +}
> +
> +int mxc_isi_m2m_resume(struct mxc_isi_pipe *pipe) {
> +	struct mxc_isi_m2m *m2m = &pipe->isi->m2m;
> +	struct mxc_isi_m2m_ctx *ctx = m2m->last_ctx;
> +
> +	/*
> +	 * Check pipe for ISI memory to memory since only
> +	 * channel 0 support this feature.
> +	 */
> +	if (m2m->pipe != pipe || m2m->usage_count == 0)
> +		return 0;
> +
> +	mxc_isi_channel_get(pipe);
> +
> +	if (ctx->chained)
> +		mxc_isi_channel_chain(pipe, false);
> +
> +	m2m->last_ctx = NULL;
> +	v4l2_m2m_resume(m2m->m2m_dev);
> +
> +	return 0;
> +}
> +
>  /* -----------------------------------------------------------------------------
>   * Registration
>   */
> --
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ