* [PATCH 0/2] Document Media Controller IOCTL number assignments
@ 2025-05-26 11:17 Sakari Ailus
2025-05-26 11:17 ` [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers Sakari Ailus
2025-05-26 11:17 ` [PATCH 2/2] media: uapi: Document IOCTL number assignment Sakari Ailus
0 siblings, 2 replies; 6+ messages in thread
From: Sakari Ailus @ 2025-05-26 11:17 UTC (permalink / raw)
To: linux-doc
Cc: Jonathan Corbet, Greg Kroah-Hartman, Madhavan Srinivasan,
Haren Myneni, Bagas Sanjaya, Andrew Donnellan, Michael Ellerman,
Akshay Gupta, linux-kernel, linux-media, hans, laurent.pinchart,
Mauro Carvalho Chehab, Lee Jones
Hello all,
The Media Controller uses IOCTL numbers with '|' type up to 0x81 but the
range from 0x80 upwards is documented to belong to samples. The samples,
however, are not currently using these values. Solve the problem by
bumping the top of the MC range and the samples allocation by 0x10.
Some sample code in samples/rust/rust_misc_device.rs also uses MC IOCTL
numbers below the current limit 0x80, it'd be nice to address that as well
as align with the changes in this patch.
Sakari Ailus (2):
Documentation: Bump media IOCTL reserved numbers
media: uapi: Document IOCTL number assignment
Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++--
include/uapi/linux/media.h | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers
2025-05-26 11:17 [PATCH 0/2] Document Media Controller IOCTL number assignments Sakari Ailus
@ 2025-05-26 11:17 ` Sakari Ailus
2025-05-26 11:48 ` Laurent Pinchart
2025-05-26 11:17 ` [PATCH 2/2] media: uapi: Document IOCTL number assignment Sakari Ailus
1 sibling, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2025-05-26 11:17 UTC (permalink / raw)
To: linux-doc
Cc: Jonathan Corbet, Greg Kroah-Hartman, Madhavan Srinivasan,
Haren Myneni, Bagas Sanjaya, Andrew Donnellan, Michael Ellerman,
Akshay Gupta, linux-kernel, linux-media, hans, laurent.pinchart,
Mauro Carvalho Chehab, Lee Jones
The Media Controller uses IOCTL numbers up to 0x81. Given that nothing
appears to be using them for other purposes, even in the samples
allocation (checked with $ git grep "#define.*_IO.*'|'"), just reassign
the numbers up to 0x8f to linux/media.h and bump the samples allocation by
0x10.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
index bc91756bde73..6b3be3fb0b15 100644
--- a/Documentation/userspace-api/ioctl/ioctl-number.rst
+++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
@@ -312,8 +312,8 @@ Code Seq# Include File Comments
'z' 40-7F CAN bus card conflict!
<mailto:oe@port.de>
'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
-'|' 00-7F linux/media.h
-'|' 80-9F samples/ Any sample and example drivers
+'|' 00-8F linux/media.h
+'|' 90-AF samples/ Any sample and example drivers
0x80 00-1F linux/fb.h
0x81 00-1F linux/vduse.h
0x89 00-06 arch/x86/include/asm/sockios.h
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] media: uapi: Document IOCTL number assignment
2025-05-26 11:17 [PATCH 0/2] Document Media Controller IOCTL number assignments Sakari Ailus
2025-05-26 11:17 ` [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers Sakari Ailus
@ 2025-05-26 11:17 ` Sakari Ailus
2025-05-26 11:48 ` Laurent Pinchart
1 sibling, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2025-05-26 11:17 UTC (permalink / raw)
To: linux-doc
Cc: Jonathan Corbet, Greg Kroah-Hartman, Madhavan Srinivasan,
Haren Myneni, Bagas Sanjaya, Andrew Donnellan, Michael Ellerman,
Akshay Gupta, linux-kernel, linux-media, hans, laurent.pinchart,
Mauro Carvalho Chehab, Lee Jones
Document MC IOCTL number assignment in linux/media.h. In the past the
assignment up to 0x7f was missed so to prevent that from happening again,
document the value here as well.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
include/uapi/linux/media.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index 1c80b1d6bbaf..2808132fcf49 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -381,6 +381,10 @@ struct media_v2_topology {
*/
#define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80)
#define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
+/*
+ * Don't allocate new IOCTL numbers past 0x8f, MC IOCTL number assignment ends
+ * there!
+ */
#ifndef __KERNEL__
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers
2025-05-26 11:17 ` [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers Sakari Ailus
@ 2025-05-26 11:48 ` Laurent Pinchart
2025-05-26 13:24 ` Sakari Ailus
0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2025-05-26 11:48 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-doc, Jonathan Corbet, Greg Kroah-Hartman,
Madhavan Srinivasan, Haren Myneni, Bagas Sanjaya,
Andrew Donnellan, Michael Ellerman, Akshay Gupta, linux-kernel,
linux-media, hans, Mauro Carvalho Chehab, Lee Jones
Hi Sakari,
Thank you for the patch.
On Mon, May 26, 2025 at 02:17:31PM +0300, Sakari Ailus wrote:
> The Media Controller uses IOCTL numbers up to 0x81. Given that nothing
> appears to be using them for other purposes, even in the samples
> allocation (checked with $ git grep "#define.*_IO.*'|'"), just reassign
> the numbers up to 0x8f to linux/media.h and bump the samples allocation by
> 0x10.
The commit message should explain why. The explanation is in the cover
letter, just move it to this patch. With that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
> index bc91756bde73..6b3be3fb0b15 100644
> --- a/Documentation/userspace-api/ioctl/ioctl-number.rst
> +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
> @@ -312,8 +312,8 @@ Code Seq# Include File Comments
> 'z' 40-7F CAN bus card conflict!
> <mailto:oe@port.de>
> 'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
> -'|' 00-7F linux/media.h
> -'|' 80-9F samples/ Any sample and example drivers
> +'|' 00-8F linux/media.h
> +'|' 90-AF samples/ Any sample and example drivers
> 0x80 00-1F linux/fb.h
> 0x81 00-1F linux/vduse.h
> 0x89 00-06 arch/x86/include/asm/sockios.h
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] media: uapi: Document IOCTL number assignment
2025-05-26 11:17 ` [PATCH 2/2] media: uapi: Document IOCTL number assignment Sakari Ailus
@ 2025-05-26 11:48 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2025-05-26 11:48 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-doc, Jonathan Corbet, Greg Kroah-Hartman,
Madhavan Srinivasan, Haren Myneni, Bagas Sanjaya,
Andrew Donnellan, Michael Ellerman, Akshay Gupta, linux-kernel,
linux-media, hans, Mauro Carvalho Chehab, Lee Jones
Hi Sakari,
Thank you for the patch.
On Mon, May 26, 2025 at 02:17:32PM +0300, Sakari Ailus wrote:
> Document MC IOCTL number assignment in linux/media.h. In the past the
> assignment up to 0x7f was missed so to prevent that from happening again,
> document the value here as well.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> include/uapi/linux/media.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index 1c80b1d6bbaf..2808132fcf49 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -381,6 +381,10 @@ struct media_v2_topology {
> */
> #define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80)
> #define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
> +/*
> + * Don't allocate new IOCTL numbers past 0x8f, MC IOCTL number assignment ends
> + * there!
> + */
>
> #ifndef __KERNEL__
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers
2025-05-26 11:48 ` Laurent Pinchart
@ 2025-05-26 13:24 ` Sakari Ailus
0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2025-05-26 13:24 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-doc, Jonathan Corbet, Greg Kroah-Hartman,
Madhavan Srinivasan, Haren Myneni, Bagas Sanjaya,
Andrew Donnellan, Michael Ellerman, Akshay Gupta, linux-kernel,
linux-media, hans, Mauro Carvalho Chehab, Lee Jones
Hi Laurent,
On Mon, May 26, 2025 at 01:48:02PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
>
> Thank you for the patch.
Thank you for the review.
>
> On Mon, May 26, 2025 at 02:17:31PM +0300, Sakari Ailus wrote:
> > The Media Controller uses IOCTL numbers up to 0x81. Given that nothing
> > appears to be using them for other purposes, even in the samples
> > allocation (checked with $ git grep "#define.*_IO.*'|'"), just reassign
> > the numbers up to 0x8f to linux/media.h and bump the samples allocation by
> > 0x10.
>
> The commit message should explain why. The explanation is in the cover
> letter, just move it to this patch. With that,
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I'll use this in v2:
The Media Controller uses IOCTL type '|' with numbers up to 0x81 while
numbers from 0x80 onwards are allocated for samples, creating a conflict
between allocations for MC and samples. Given that nothing appears to be
using numbers between 0x80 and 0x8f for other purposes than MC, even in
the samples allocation (checked with $ git grep "#define.*_IO.*'|'"), just
reassign the numbers up to 0x8f to linux/media.h and bump the samples
allocation by 0x10.
>
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> > Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst
> > index bc91756bde73..6b3be3fb0b15 100644
> > --- a/Documentation/userspace-api/ioctl/ioctl-number.rst
> > +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst
> > @@ -312,8 +312,8 @@ Code Seq# Include File Comments
> > 'z' 40-7F CAN bus card conflict!
> > <mailto:oe@port.de>
> > 'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
> > -'|' 00-7F linux/media.h
> > -'|' 80-9F samples/ Any sample and example drivers
> > +'|' 00-8F linux/media.h
> > +'|' 90-AF samples/ Any sample and example drivers
> > 0x80 00-1F linux/fb.h
> > 0x81 00-1F linux/vduse.h
> > 0x89 00-06 arch/x86/include/asm/sockios.h
>
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-26 13:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-26 11:17 [PATCH 0/2] Document Media Controller IOCTL number assignments Sakari Ailus
2025-05-26 11:17 ` [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers Sakari Ailus
2025-05-26 11:48 ` Laurent Pinchart
2025-05-26 13:24 ` Sakari Ailus
2025-05-26 11:17 ` [PATCH 2/2] media: uapi: Document IOCTL number assignment Sakari Ailus
2025-05-26 11:48 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).