* [PATCH] media: rkvdec: vp9: Fix probs struct alignment
@ 2025-12-12 16:01 Detlev Casanova
2025-12-12 18:39 ` Nicolas Dufresne
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Detlev Casanova @ 2025-12-12 16:01 UTC (permalink / raw)
To: linux-kernel
Cc: Detlev Casanova, Ezequiel Garcia, Mauro Carvalho Chehab,
Heiko Stuebner, linux-media, linux-rockchip, linux-arm-kernel,
kernel, kernel test robot, Nicolas Dufresne
When building for arm 32 bits, the struct alignment changes and the compiler
adds 3 padding bits to the anonymous mv struct in
rkvdec_vp9_inter_frame_probs.
Therefore, the BUILD_BUG_ON used to check that the struct size is aligned
to 128 bits (hardware requirement) fails.
As that mv struct is at the end of the global rkvdec_vp9_probs struct
and is followed by 11 padding bits, the 3 padding bits can be explicitely
set in the mv struct and removed from the 11 following it.
This makes sure that the mv struct is 32 bits aligned.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512110229.R6YCf1Le-lkp@intel.com/
Fixes: d968e50b5c26 ("media: rkvdec: Unstage the driver")
Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
index b4bf01e839ef..23c733ca2e8e 100644
--- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
@@ -66,6 +66,8 @@ struct rkvdec_vp9_inter_frame_probs {
u8 fr[2][3];
u8 class0_hp[2];
u8 hp[2];
+ /* 32 bit alignment */
+ u8 padding6[3];
} mv;
};
@@ -85,7 +87,7 @@ struct rkvdec_vp9_probs {
struct rkvdec_vp9_intra_only_frame_probs intra_only;
};
/* 128 bit alignment */
- u8 padding1[11];
+ u8 padding1[8];
};
/* Data structure describing auxiliary buffer format. */
--
2.52.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rkvdec: vp9: Fix probs struct alignment
2025-12-12 16:01 [PATCH] media: rkvdec: vp9: Fix probs struct alignment Detlev Casanova
@ 2025-12-12 18:39 ` Nicolas Dufresne
2025-12-12 18:45 ` Nicolas Dufresne
2025-12-12 19:17 ` Detlev Casanova
2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Dufresne @ 2025-12-12 18:39 UTC (permalink / raw)
To: Detlev Casanova, linux-kernel
Cc: Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-rockchip, linux-arm-kernel, kernel,
kernel test robot
[-- Attachment #1.1: Type: text/plain, Size: 1931 bytes --]
Le vendredi 12 décembre 2025 à 11:01 -0500, Detlev Casanova a écrit :
> When building for arm 32 bits, the struct alignment changes and the compiler
> adds 3 padding bits to the anonymous mv struct in
> rkvdec_vp9_inter_frame_probs.
>
> Therefore, the BUILD_BUG_ON used to check that the struct size is aligned
> to 128 bits (hardware requirement) fails.
>
> As that mv struct is at the end of the global rkvdec_vp9_probs struct
> and is followed by 11 padding bits, the 3 padding bits can be explicitely
> set in the mv struct and removed from the 11 following it.
>
> This makes sure that the mv struct is 32 bits aligned.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202512110229.R6YCf1Le-lkp@intel.com/
> Fixes: d968e50b5c26 ("media: rkvdec: Unstage the driver")
> Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> index b4bf01e839ef..23c733ca2e8e 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> @@ -66,6 +66,8 @@ struct rkvdec_vp9_inter_frame_probs {
> u8 fr[2][3];
> u8 class0_hp[2];
> u8 hp[2];
> + /* 32 bit alignment */
> + u8 padding6[3];
> } mv;
> };
>
> @@ -85,7 +87,7 @@ struct rkvdec_vp9_probs {
> struct rkvdec_vp9_intra_only_frame_probs intra_only;
> };
> /* 128 bit alignment */
> - u8 padding1[11];
> + u8 padding1[8];
> };
>
> /* Data structure describing auxiliary buffer format. */
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rkvdec: vp9: Fix probs struct alignment
2025-12-12 16:01 [PATCH] media: rkvdec: vp9: Fix probs struct alignment Detlev Casanova
2025-12-12 18:39 ` Nicolas Dufresne
@ 2025-12-12 18:45 ` Nicolas Dufresne
2025-12-12 19:17 ` Detlev Casanova
2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Dufresne @ 2025-12-12 18:45 UTC (permalink / raw)
To: Detlev Casanova, linux-kernel
Cc: Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-rockchip, linux-arm-kernel, kernel,
kernel test robot
[-- Attachment #1.1: Type: text/plain, Size: 2289 bytes --]
Hi,
Le vendredi 12 décembre 2025 à 11:01 -0500, Detlev Casanova a écrit :
> When building for arm 32 bits, the struct alignment changes and the compiler
Reported by checkpatch [0], this needs a reflow, it exceeds 75 chars.
> adds 3 padding bits to the anonymous mv struct in
> rkvdec_vp9_inter_frame_probs.
>
> Therefore, the BUILD_BUG_ON used to check that the struct size is aligned
> to 128 bits (hardware requirement) fails.
>
> As that mv struct is at the end of the global rkvdec_vp9_probs struct
> and is followed by 11 padding bits, the 3 padding bits can be explicitely
Also from checkpatch:
explicitely -> explicitly
> set in the mv struct and removed from the 11 following it.
>
> This makes sure that the mv struct is 32 bits aligned.
Unless someone request a change, I will be able to apply these fixes while
picking it up.
cheers,
Nicolas
[0]https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/89677987/artifacts/junit/0001-media-rkvdec-vp9-Fix-probs-struct-alignment.patch%20checkpatch.err.txt
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512110229.R6YCf1Le-lkp@intel.com/
> Fixes: d968e50b5c26 ("media: rkvdec: Unstage the driver")
> Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
> drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> index b4bf01e839ef..23c733ca2e8e 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> @@ -66,6 +66,8 @@ struct rkvdec_vp9_inter_frame_probs {
> u8 fr[2][3];
> u8 class0_hp[2];
> u8 hp[2];
> + /* 32 bit alignment */
> + u8 padding6[3];
> } mv;
> };
>
> @@ -85,7 +87,7 @@ struct rkvdec_vp9_probs {
> struct rkvdec_vp9_intra_only_frame_probs intra_only;
> };
> /* 128 bit alignment */
> - u8 padding1[11];
> + u8 padding1[8];
> };
>
> /* Data structure describing auxiliary buffer format. */
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rkvdec: vp9: Fix probs struct alignment
2025-12-12 16:01 [PATCH] media: rkvdec: vp9: Fix probs struct alignment Detlev Casanova
2025-12-12 18:39 ` Nicolas Dufresne
2025-12-12 18:45 ` Nicolas Dufresne
@ 2025-12-12 19:17 ` Detlev Casanova
2 siblings, 0 replies; 4+ messages in thread
From: Detlev Casanova @ 2025-12-12 19:17 UTC (permalink / raw)
To: linux-kernel
Cc: Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-rockchip, linux-arm-kernel, kernel,
kernel test robot, Nicolas Dufresne
Hi all,
Sorry, I need to rewrite the commit message with some s/bit/byte...
Will do a v2 soon.
Regards,
Detlev.
On 12/12/25 11:01, Detlev Casanova wrote:
> When building for arm 32 bits, the struct alignment changes and the compiler
> adds 3 padding bits to the anonymous mv struct in
> rkvdec_vp9_inter_frame_probs.
>
> Therefore, the BUILD_BUG_ON used to check that the struct size is aligned
> to 128 bits (hardware requirement) fails.
>
> As that mv struct is at the end of the global rkvdec_vp9_probs struct
> and is followed by 11 padding bits, the 3 padding bits can be explicitely
> set in the mv struct and removed from the 11 following it.
>
> This makes sure that the mv struct is 32 bits aligned.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512110229.R6YCf1Le-lkp@intel.com/
> Fixes: d968e50b5c26 ("media: rkvdec: Unstage the driver")
> Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
> drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> index b4bf01e839ef..23c733ca2e8e 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
> @@ -66,6 +66,8 @@ struct rkvdec_vp9_inter_frame_probs {
> u8 fr[2][3];
> u8 class0_hp[2];
> u8 hp[2];
> + /* 32 bit alignment */
> + u8 padding6[3];
> } mv;
> };
>
> @@ -85,7 +87,7 @@ struct rkvdec_vp9_probs {
> struct rkvdec_vp9_intra_only_frame_probs intra_only;
> };
> /* 128 bit alignment */
> - u8 padding1[11];
> + u8 padding1[8];
> };
>
> /* Data structure describing auxiliary buffer format. */
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-12 19:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-12 16:01 [PATCH] media: rkvdec: vp9: Fix probs struct alignment Detlev Casanova
2025-12-12 18:39 ` Nicolas Dufresne
2025-12-12 18:45 ` Nicolas Dufresne
2025-12-12 19:17 ` Detlev Casanova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox