mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
@ 2026-07-13 16:13 Sakari Ailus
  2026-07-14  8:15 ` Laurent Pinchart
  2026-07-14 10:28 ` Joe Perches
  0 siblings, 2 replies; 6+ messages in thread
From: Sakari Ailus @ 2026-07-13 16:13 UTC (permalink / raw)
  To: linux-kernel, Andy Whitcroft, Joe Perches
  Cc: linux-media, laurent.pinchart, hans

The V4L2 pipeline power management code, in particular
v4l2_pipeline_link_notify(), v4l2_pipeline_pm_get() and
v4l2_pipeline_pm_put() are deprecated and shall not be used in new code.

The drivers need to use the Runtime PM instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..a8a7374dc9c4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -879,6 +879,9 @@ our %deprecated_apis = (
 	"DEFINE_IDR"				=> "DEFINE_XARRAY",
 	"idr_init"				=> "xa_init",
 	"idr_init_base"				=> "xa_init_flags",
+	"v4l2_pipeline_link_notify"		=> "",
+	"v4l2_pipeline_pm_get"			=> "",
+	"v4l2_pipeline_pm_put"			=> "",
 );
 
 #Create a search pattern for all these strings to speed up a loop below
-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
  2026-07-13 16:13 [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code Sakari Ailus
@ 2026-07-14  8:15 ` Laurent Pinchart
  2026-07-14 10:28 ` Joe Perches
  1 sibling, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2026-07-14  8:15 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-kernel, Andy Whitcroft, Joe Perches, linux-media, hans

Hi Sakari,

Thank you for the patch.

On Mon, Jul 13, 2026 at 07:13:27PM +0300, Sakari Ailus wrote:
> The V4L2 pipeline power management code, in particular
> v4l2_pipeline_link_notify(), v4l2_pipeline_pm_get() and
> v4l2_pipeline_pm_put() are deprecated and shall not be used in new code.
> 
> The drivers need to use the Runtime PM instead.

I'll be happy to see this API go, so we certainly need to make sure no
new drivers use it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  scripts/checkpatch.pl | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b7a42bbdd94..a8a7374dc9c4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -879,6 +879,9 @@ our %deprecated_apis = (
>  	"DEFINE_IDR"				=> "DEFINE_XARRAY",
>  	"idr_init"				=> "xa_init",
>  	"idr_init_base"				=> "xa_init_flags",
> +	"v4l2_pipeline_link_notify"		=> "",
> +	"v4l2_pipeline_pm_get"			=> "",
> +	"v4l2_pipeline_pm_put"			=> "",
>  );
>  
>  #Create a search pattern for all these strings to speed up a loop below

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
  2026-07-13 16:13 [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code Sakari Ailus
  2026-07-14  8:15 ` Laurent Pinchart
@ 2026-07-14 10:28 ` Joe Perches
  2026-07-14 11:14   ` Sakari Ailus
  1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2026-07-14 10:28 UTC (permalink / raw)
  To: Sakari Ailus, linux-kernel, Andy Whitcroft
  Cc: linux-media, laurent.pinchart, hans

On Mon, 2026-07-13 at 19:13 +0300, Sakari Ailus wrote:
> The V4L2 pipeline power management code, in particular
> v4l2_pipeline_link_notify(), v4l2_pipeline_pm_get() and
> v4l2_pipeline_pm_put() are deprecated and shall not be used in new code.
> 
> The drivers need to use the Runtime PM instead.

Nack. Say that in the error output.

Given this patch, checkpatch's message would be something like

"Deprecated use of 'v4l2_pipeline_pm_get', prefer '' instead"

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -879,6 +879,9 @@ our %deprecated_apis = (
>  	"DEFINE_IDR"				=> "DEFINE_XARRAY",
>  	"idr_init"				=> "xa_init",
>  	"idr_init_base"				=> "xa_init_flags",
> +	"v4l2_pipeline_link_notify"		=> "",
> +	"v4l2_pipeline_pm_get"			=> "",
> +	"v4l2_pipeline_pm_put"			=> "",

Add something like "v4l2 runtime power management API" instead
At least point out what that is.

And in today's '-next' there's seems to be no indication in
documentation or code these calls are deprecated.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
  2026-07-14 10:28 ` Joe Perches
@ 2026-07-14 11:14   ` Sakari Ailus
  2026-07-14 12:11     ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2026-07-14 11:14 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Andy Whitcroft, linux-media, laurent.pinchart, hans

Hi Joe,

On Tue, Jul 14, 2026 at 03:28:13AM -0700, Joe Perches wrote:
> On Mon, 2026-07-13 at 19:13 +0300, Sakari Ailus wrote:
> > The V4L2 pipeline power management code, in particular
> > v4l2_pipeline_link_notify(), v4l2_pipeline_pm_get() and
> > v4l2_pipeline_pm_put() are deprecated and shall not be used in new code.
> > 
> > The drivers need to use the Runtime PM instead.
> 
> Nack. Say that in the error output.
> 
> Given this patch, checkpatch's message would be something like
> 
> "Deprecated use of 'v4l2_pipeline_pm_get', prefer '' instead"

That's even technically correct: these functions serve no useful purpose
anymore, all new drivers effectively use Runtime PM anyway.

> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -879,6 +879,9 @@ our %deprecated_apis = (
> >  	"DEFINE_IDR"				=> "DEFINE_XARRAY",
> >  	"idr_init"				=> "xa_init",
> >  	"idr_init_base"				=> "xa_init_flags",
> > +	"v4l2_pipeline_link_notify"		=> "",
> > +	"v4l2_pipeline_pm_get"			=> "",
> > +	"v4l2_pipeline_pm_put"			=> "",
> 
> Add something like "v4l2 runtime power management API" instead
> At least point out what that is.

How about simply "Runtime PM"?

> 
> And in today's '-next' there's seems to be no indication in
> documentation or code these calls are deprecated.

The deprecation notes were introduced in commits
b97213a41140b87f48865ba594a1f4b5c5566631 and
4ec2caab775606c4bf9d0f026f8942a0b33e2255, the latter of which was merged in
2024.

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
  2026-07-14 11:14   ` Sakari Ailus
@ 2026-07-14 12:11     ` Joe Perches
  2026-07-14 12:31       ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2026-07-14 12:11 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-kernel, Andy Whitcroft, linux-media, laurent.pinchart, hans

On Tue, 2026-07-14 at 14:14 +0300, Sakari Ailus wrote:
> > Given this patch, checkpatch's message would be something like
> > 
> "Deprecated use of 'v4l2_pipeline_pm_get', prefer '' instead"
> 
> That's even technically correct: these functions serve no useful purpose
> anymore, all new drivers effectively use Runtime PM anyway.

OK, but given that there are only 32 uses in 16 files in all
of -next, why not just fix the uses then delete the functions?

$ git grep -P -w 'v4l2_pipeline_(?:link_notify|pm_get|pm_put)' | \
  grep -vP '^(?:include|drivers/media/v4l2-core)' | \
  wc -l
32

$ git grep -P -w -l 'v4l2_pipeline_(?:link_notify|pm_get|pm_put)' | \
  grep -vP '^(?:include|drivers/media/v4l2-core)' | \
  wc -l
16

> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -879,6 +879,9 @@ our %deprecated_apis = (
> > >  	"DEFINE_IDR"				=> "DEFINE_XARRAY",
> > >  	"idr_init"				=> "xa_init",
> > >  	"idr_init_base"				=> "xa_init_flags",
> > > +	"v4l2_pipeline_link_notify"		=> "",
> > > +	"v4l2_pipeline_pm_get"			=> "",
> > > +	"v4l2_pipeline_pm_put"			=> "",
> > 
> > Add something like "v4l2 runtime power management API" instead
> > At least point out what that is.
> 
> How about simply "Runtime PM"?

Better than nothing IMO.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code
  2026-07-14 12:11     ` Joe Perches
@ 2026-07-14 12:31       ` Sakari Ailus
  0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2026-07-14 12:31 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Andy Whitcroft, linux-media, laurent.pinchart, hans

Hi Joe,

On Tue, Jul 14, 2026 at 05:11:17AM -0700, Joe Perches wrote:
> On Tue, 2026-07-14 at 14:14 +0300, Sakari Ailus wrote:
> > > Given this patch, checkpatch's message would be something like
> > > 
> > "Deprecated use of 'v4l2_pipeline_pm_get', prefer '' instead"
> > 
> > That's even technically correct: these functions serve no useful purpose
> > anymore, all new drivers effectively use Runtime PM anyway.
> 
> OK, but given that there are only 32 uses in 16 files in all
> of -next, why not just fix the uses then delete the functions?
> 
> $ git grep -P -w 'v4l2_pipeline_(?:link_notify|pm_get|pm_put)' | \
>   grep -vP '^(?:include|drivers/media/v4l2-core)' | \
>   wc -l
> 32
> 
> $ git grep -P -w -l 'v4l2_pipeline_(?:link_notify|pm_get|pm_put)' | \
>   grep -vP '^(?:include|drivers/media/v4l2-core)' | \
>   wc -l
> 16

There are about 20 V4L2 sub-device drivers that implement the s_power()
sub-device video callback used by the v4l2_pipeline_*() functions. These
are generally old drivers and the conversion is typically not entirely
trivial.

The intent here is to avoid adding new users to these functions now -- some
have slipped through recently.

> 
> > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > []
> > > > @@ -879,6 +879,9 @@ our %deprecated_apis = (
> > > >  	"DEFINE_IDR"				=> "DEFINE_XARRAY",
> > > >  	"idr_init"				=> "xa_init",
> > > >  	"idr_init_base"				=> "xa_init_flags",
> > > > +	"v4l2_pipeline_link_notify"		=> "",
> > > > +	"v4l2_pipeline_pm_get"			=> "",
> > > > +	"v4l2_pipeline_pm_put"			=> "",
> > > 
> > > Add something like "v4l2 runtime power management API" instead
> > > At least point out what that is.
> > 
> > How about simply "Runtime PM"?
> 
> Better than nothing IMO.

I'll send v2 with that.

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-14 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-13 16:13 [PATCH 1/1] checkpatch: Deprecate V4L2 pipeline power management code Sakari Ailus
2026-07-14  8:15 ` Laurent Pinchart
2026-07-14 10:28 ` Joe Perches
2026-07-14 11:14   ` Sakari Ailus
2026-07-14 12:11     ` Joe Perches
2026-07-14 12:31       ` Sakari Ailus

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®