Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>, linux-wireless@vger.kernel.org
Cc: leo.li@realtek.com, gary.chang@realtek.com, echuang@realtek.com,
	wenjie.tsai@realtek.com, phhuang@realtek.com, isaiah@realtek.com,
	kevin_yang@realtek.com, mh_chen@realtek.com
Subject: Re: [PATCH rtw-next 08/16] wifi: rtw89: add IO offload support via firmware
Date: Thu, 9 Jul 2026 17:25:36 +0300	[thread overview]
Message-ID: <c2c05574-2179-4b9e-b681-90387bea3561@gmail.com> (raw)
In-Reply-To: <20260420034051.17666-9-pkshih@realtek.com>

On 20/04/2026 06:40, Ping-Ke Shih wrote:
> +static void rtw89_fw_cmd_ofld_udelay(struct rtw89_dev *rtwdev, u32 us)
> +{
> +	struct rtw89_fw_cmd_ofld_arg cmd = {
> +		.src = RTW89_FW_CMD_OFLD_SRC_OTHER,
> +		.type = RTW89_FW_CMD_OFLD_DELAY,
> +		.value = us,
> +	};
> +	int ret;
> +
> +	ret = rtw89_fw_cmd_ofld_enqueue(rtwdev, &cmd);
> +	if (ret)
> +		udelay(us);
> +}
> +
> +static void rtw89_fw_cmd_ofld_mdelay(struct rtw89_dev *rtwdev, u32 ms)
> +{
> +	struct rtw89_fw_cmd_ofld_arg cmd = {
> +		.src = RTW89_FW_CMD_OFLD_SRC_OTHER,
> +		.type = RTW89_FW_CMD_OFLD_DELAY,
> +		.value = ms * 1000,
> +	};
> +	int ret;
> +
> +	ret = rtw89_fw_cmd_ofld_enqueue(rtwdev, &cmd);
> +	if (ret)
> +		mdelay(ms);
> +}
This can fail to compile with some kernel configurations because
RTW89_FW_CMD_OFLD_SRC_OTHER (4) doesn't fit in the mask
RTW89_H2C_CMD_OFLD_W0_SRC (GENMASK(0, 1)):

In file included from core.h:10,
                 from cam.h:8,
                 from fw.c:6:
In function ‘le32_encode_bits’,
    inlined from ‘rtw89_fw_cmd_ofld_enqueue’ at fw.c:11655:12,
    inlined from ‘rtw89_fw_cmd_ofld_udelay’ at fw.c:11858:8:
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:217:17: error: call to ‘__field_overflow’ declared with attribute error: value doesn't fit into mask
  217 |                 __field_overflow();                                     \
      |                 ^~~~~~~~~~~~~~~~~~
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:235:9: note: in expansion of macro ‘____MAKE_OP’
  235 |         ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
      |         ^~~~~~~~~~~
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:240:1: note: in expansion of macro ‘__MAKE_OP’
  240 | __MAKE_OP(32)
      | ^~~~~~~~~
In function ‘le32_encode_bits’,
    inlined from ‘rtw89_fw_cmd_ofld_enqueue’ at fw.c:11655:12,
    inlined from ‘rtw89_fw_cmd_ofld_mdelay’ at fw.c:11872:8:
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:217:17: error: call to ‘__field_overflow’ declared with attribute error: value doesn't fit into mask
  217 |                 __field_overflow();                                     \
      |                 ^~~~~~~~~~~~~~~~~~
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:235:9: note: in expansion of macro ‘____MAKE_OP’
  235 |         ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
      |         ^~~~~~~~~~~
/usr/lib/modules/7.1.3-zen1-1-zen/build/include/linux/bitfield.h:240:1: note: in expansion of macro ‘__MAKE_OP’
  240 | __MAKE_OP(32)
      | ^~~~~~~~~

https://github.com/morrownr/rtw89/issues/111
https://github.com/morrownr/rtw89/issues/106

The reports are about the code from that repository, not the kernel,
but I assume the same thing will happen when someone tries to build
kernel 7.2 with the Zen config.

Using the same GCC 16.1.1, this fails on 7.1.3-zen1 but compiles on
7.1.3-arch1 (the standard Arch Linux kernel). This is the difference
between their /proc/config.gz:

3c3
< # Linux/x86 7.1.3-arch1 Kernel Configuration
---
> # Linux/x86 7.1.3-zen1 Kernel Configuration
40a41
> CONFIG_ZEN_INTERACTIVE=y
148a150
> # CONFIG_PREEMPT_RT is not set
218a221
> # CONFIG_SCHED_ALT is not set
270a274
> CONFIG_USER_NS_UNPRIVILEGED=y
290c294,295
< CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
---
> # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
> CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
1264c1269
< CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
---
> CONFIG_COMPACT_UNEVICTABLE_DEFAULT=0
1477a1483
> CONFIG_TCP_CONG_BBR3=m
3057a3064
> CONFIG_VHBA=m

So I guess the error happens when rtw89 is compiled with -O3.

  reply	other threads:[~2026-07-09 14:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  3:40 [PATCH rtw-next 00/16] wifi: rtw89: add USB IO offload and some refactors Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 01/16] wifi: rtw89: 8922d: fix typo rx_freq_frome_ie Ping-Ke Shih
2026-04-29  5:24   ` Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 02/16] wifi: rtw89: 8852a: refine power save to lower latency Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 03/16] wifi: rtw89: debug: disable hw_scan for latency-sensitive scenarios Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 04/16] wifi: rtw89: debug: disable inactive power save to reduce bus overhead Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 05/16] wifi: rtw89: phy: support static PD level setting Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 06/16] wifi: rtw89: Correct data type for scan index to avoid infinite loop Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 07/16] wifi: rtw89: 8852bt: configure support_noise field explicitly Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 08/16] wifi: rtw89: add IO offload support via firmware Ping-Ke Shih
2026-07-09 14:25   ` Bitterblue Smith [this message]
2026-04-20  3:40 ` [PATCH rtw-next 09/16] wifi: rtw89: offload DMAC and CMAC init IO to firmware Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 10/16] wifi: rtw89: use firmware offload for PHY and RF batch register writes Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 11/16] wifi: rtw89: 8832cu: Add ID 2c7c:8206 for RTL8832CU Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 12/16] wifi: rtw89: use struct to fill C2H recv ack Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 13/16] wifi: rtw89: check scan C2H event recv ack instead of C2H event done ack Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 14/16] wifi: rtw89: suspend DIG when remain-on-channel Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 15/16] wifi: rtw89: chan: introduce new helper to get entity current configuration Ping-Ke Shih
2026-04-20  3:40 ` [PATCH rtw-next 16/16] wifi: rtw89: 8922d: update RF calibration flow for MLD Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2c05574-2179-4b9e-b681-90387bea3561@gmail.com \
    --to=rtl8821cerfe2@gmail.com \
    --cc=echuang@realtek.com \
    --cc=gary.chang@realtek.com \
    --cc=isaiah@realtek.com \
    --cc=kevin_yang@realtek.com \
    --cc=leo.li@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mh_chen@realtek.com \
    --cc=phhuang@realtek.com \
    --cc=pkshih@realtek.com \
    --cc=wenjie.tsai@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox