Document Media Controller IOCTL number assignments
Subsystems (3)
Sakari Ailus
maintainercover Document Media Controller IOCTL number assignments
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(-)
Signature · 1 line
2.39.5
Sakari Ailus
maintainerPATCH 1/2 Documentation: Bump media IOCTL reserved numbers
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.
--- Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/userspace-api/ioctl/ioctl-number.rst +2 -2
@@ -312,8 +312,8 @@ Code Seq# Include File Comments 'z' 40-7F CAN bus card conflict! <mailto:[email protected]> '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
Signature · 1 line
2.39.5
Re: [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers
Hi Sakari,
Thank you for the patch.
Quoted 5 lines · Sakari Ailus
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 to0x8ftolinux/media.hand bump the samples allocation by0x10.
The commit message should explain why. The explanation is in the cover letter, just move it to this patch. With that,
Quoted 20 lines
Signed-off-by Sakari Ailus <[email protected]>--- Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/userspace-api/ioctl/ioctl-number.rst +2
-2@@ -312,8 +312,8 @@ Code Seq# Include File Comments 'z' 40-7F CAN bus card conflict! <mailto:[email protected]> '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
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 1/2] Documentation: Bump media IOCTL reserved numbers
Hi Laurent,
Quoted 3 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
Thank you for the review.
Quoted 8 lines · Sakari Ailus
Quoted 5 lines
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 to0x8ftolinux/media.hand bump the samples allocation by0x10.
Quoted 4 lines
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 <[email protected]>
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.
Quoted 22 lines
Quoted 21 lines
Signed-off-by Sakari Ailus <[email protected]>--- Documentation/userspace-api/ioctl/ioctl-number.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/userspace-api/ioctl/ioctl-number.rst +2
-2@@ -312,8 +312,8 @@ Code Seq# Include File Comments 'z' 40-7F CAN bus card conflict! <mailto:[email protected]> '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
Signature · 3 lines
Regards, Sakari Ailus
Sakari Ailus
maintainerPATCH 2/2 media: uapi: Document IOCTL number assignment
In reply to Sakari AilusDocument 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.
--- include/uapi/linux/media.h | 4 ++++ 1 file changed, 4 insertions(+)
include/uapi/linux/media.h +4 -0
@@ -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__
Signature · 1 line
2.39.5
Re: [PATCH 2/2] media: uapi: Document IOCTL number assignment
Hi Sakari,
Thank you for the patch.
Quoted 5 lines · Sakari Ailus
Document MC IOCTL number assignment in
linux/media.h. In the past the assignment up to0x7fwas missed so to prevent that from happening again, document the value here as well.Signed-off-by Sakari Ailus <[email protected]>
Quoted 19 lines
--- include/uapi/linux/media.h | 4 ++++ 1 file changed, 4 insertions(+)include/uapi/linux/media.h +4
-0@@ -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__
Signature · 3 lines
Regards, Laurent Pinchart