* [PATCH rtw-next] wifi: rtw88: 8814a: add __packed to ensure efuse map size
@ 2026-04-10 13:13 Ping-Ke Shih
2026-04-10 15:44 ` Bitterblue Smith
0 siblings, 1 reply; 3+ messages in thread
From: Ping-Ke Shih @ 2026-04-10 13:13 UTC (permalink / raw)
To: linux-wireless; +Cc: rtl8821cerfe2, lkp
All nested sture/union used by efuse map should be packed. Otherwise, a
arm-linux-gnueabi-gcc compiler might throw errors due to size assertion.
In file included from include/linux/bitfield.h:10,
from include/linux/fortify-string.h:5,
from include/linux/string.h:389,
from include/linux/uuid.h:11,
from include/linux/mod_devicetable.h:14,
from include/linux/usb.h:5,
from drivers/net/wireless/realtek/rtw88/rtw8814a.c:5:
>> include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct rtw8814a_efuse) == 512"
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
^~~~~~~~~~~~~~
Fixes: 1a7545784642 ("wifi: rtw88: Add rtw8814a.{c,h}")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604101721.fsv5XmCX-lkp@intel.com/
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8814a.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 9c0b746540b0..3cc7c2666c1c 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -471,7 +471,7 @@ struct rtw_2g_txpwr_idx {
struct rtw_2g_ns_pwr_idx_diff ht_2s_diff;
struct rtw_2g_ns_pwr_idx_diff ht_3s_diff;
struct rtw_2g_ns_pwr_idx_diff ht_4s_diff;
-};
+} __packed;
struct rtw_5g_ht_1s_pwr_idx_diff {
#ifdef __LITTLE_ENDIAN
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8814a.h b/drivers/net/wireless/realtek/rtw88/rtw8814a.h
index c57c7c8f915e..a0d9446e2043 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8814a.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8814a.h
@@ -51,7 +51,7 @@ struct rtw8814a_efuse {
union {
struct rtw8814au_efuse u;
struct rtw8814ae_efuse e;
- };
+ } __packed;
u8 res5[0x122]; /* 0xde */
} __packed;
base-commit: 929298742bb5dfacd53ea99cf989cc81210f90a3
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw88: 8814a: add __packed to ensure efuse map size
2026-04-10 13:13 [PATCH rtw-next] wifi: rtw88: 8814a: add __packed to ensure efuse map size Ping-Ke Shih
@ 2026-04-10 15:44 ` Bitterblue Smith
2026-04-11 7:29 ` Ping-Ke Shih
0 siblings, 1 reply; 3+ messages in thread
From: Bitterblue Smith @ 2026-04-10 15:44 UTC (permalink / raw)
To: Ping-Ke Shih, linux-wireless; +Cc: lkp
On 10/04/2026 16:13, Ping-Ke Shih wrote:
> All nested sture/union used by efuse map should be packed. Otherwise, a
> arm-linux-gnueabi-gcc compiler might throw errors due to size assertion.
>
> In file included from include/linux/bitfield.h:10,
> from include/linux/fortify-string.h:5,
> from include/linux/string.h:389,
> from include/linux/uuid.h:11,
> from include/linux/mod_devicetable.h:14,
> from include/linux/usb.h:5,
> from drivers/net/wireless/realtek/rtw88/rtw8814a.c:5:
>>> include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct rtw8814a_efuse) == 512"
> #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
> ^~~~~~~~~~~~~~
>
> Fixes: 1a7545784642 ("wifi: rtw88: Add rtw8814a.{c,h}")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604101721.fsv5XmCX-lkp@intel.com/
> Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> drivers/net/wireless/realtek/rtw88/main.h | 2 +-
> drivers/net/wireless/realtek/rtw88/rtw8814a.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
Thank you for taking care of this. Actually, every chip's efuse struct
has a union like this missing __packed, not just RTL8814A. Most of them
don't have a static_assert.
> diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
> index 9c0b746540b0..3cc7c2666c1c 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.h
> +++ b/drivers/net/wireless/realtek/rtw88/main.h
> @@ -471,7 +471,7 @@ struct rtw_2g_txpwr_idx {
> struct rtw_2g_ns_pwr_idx_diff ht_2s_diff;
> struct rtw_2g_ns_pwr_idx_diff ht_3s_diff;
> struct rtw_2g_ns_pwr_idx_diff ht_4s_diff;
> -};
> +} __packed;
>
> struct rtw_5g_ht_1s_pwr_idx_diff {
> #ifdef __LITTLE_ENDIAN
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8814a.h b/drivers/net/wireless/realtek/rtw88/rtw8814a.h
> index c57c7c8f915e..a0d9446e2043 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8814a.h
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8814a.h
> @@ -51,7 +51,7 @@ struct rtw8814a_efuse {
> union {
> struct rtw8814au_efuse u;
> struct rtw8814ae_efuse e;
> - };
> + } __packed;
> u8 res5[0x122]; /* 0xde */
> } __packed;
>
>
> base-commit: 929298742bb5dfacd53ea99cf989cc81210f90a3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw88: 8814a: add __packed to ensure efuse map size
2026-04-10 15:44 ` Bitterblue Smith
@ 2026-04-11 7:29 ` Ping-Ke Shih
0 siblings, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2026-04-11 7:29 UTC (permalink / raw)
To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: lkp@intel.com
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> On 10/04/2026 16:13, Ping-Ke Shih wrote:
> > All nested sture/union used by efuse map should be packed. Otherwise, a
> > arm-linux-gnueabi-gcc compiler might throw errors due to size assertion.
> >
> > In file included from include/linux/bitfield.h:10,
> > from include/linux/fortify-string.h:5,
> > from include/linux/string.h:389,
> > from include/linux/uuid.h:11,
> > from include/linux/mod_devicetable.h:14,
> > from include/linux/usb.h:5,
> > from drivers/net/wireless/realtek/rtw88/rtw8814a.c:5:
> >>> include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct rtw8814a_efuse) == 512"
> > #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
> > ^~~~~~~~~~~~~~
> >
> > Fixes: 1a7545784642 ("wifi: rtw88: Add rtw8814a.{c,h}")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202604101721.fsv5XmCX-lkp@intel.com/
> > Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> > ---
> > drivers/net/wireless/realtek/rtw88/main.h | 2 +-
> > drivers/net/wireless/realtek/rtw88/rtw8814a.h | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
>
> Thank you for taking care of this. Actually, every chip's efuse struct
> has a union like this missing __packed, not just RTL8814A. Most of them
> don't have a static_assert.
>
Indeed. I added size assetion of efuse map entirely to rtw88 and rtw89 [1],
hoping we can find and address this kind of problem earlier.
[1] https://lore.kernel.org/linux-wireless/20260411072413.1556575-1-pkshih@realtek.com/T/#t
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-11 7:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 13:13 [PATCH rtw-next] wifi: rtw88: 8814a: add __packed to ensure efuse map size Ping-Ke Shih
2026-04-10 15:44 ` Bitterblue Smith
2026-04-11 7:29 ` Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox