* [PATCH] wifi: rsi: Fix types to appease CFI
@ 2026-08-02 12:22 Stefan Hansson
2026-08-02 14:30 ` Jeff Johnson
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stefan Hansson @ 2026-08-02 12:22 UTC (permalink / raw)
To: linux-wireless, linux-kernel, phone-devel,
~postmarketos/upstreaming
Cc: Stefan Hansson
Avoids errors like:
CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
As seen in the aforementioned error this was tested using the downstream
redpine_91x driver found in the Librem 5's downstream source tree.
However, it appears that this driver is a modified version of the rsi
driver found in mainline Linux and as such I decided to port the changes
here too.
Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
---
drivers/net/wireless/rsi/rsi_91x_coex.c | 3 ++-
drivers/net/wireless/rsi/rsi_91x_main.c | 5 +++--
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 3 ++-
drivers/net/wireless/rsi/rsi_91x_usb_ops.c | 3 ++-
drivers/net/wireless/rsi/rsi_common.h | 2 +-
drivers/net/wireless/rsi/rsi_sdio.h | 2 +-
drivers/net/wireless/rsi/rsi_usb.h | 2 +-
7 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_coex.c b/drivers/net/wireless/rsi/rsi_91x_coex.c
index ee603a5173fb..023c539fc384 100644
--- a/drivers/net/wireless/rsi/rsi_91x_coex.c
+++ b/drivers/net/wireless/rsi/rsi_91x_coex.c
@@ -50,8 +50,9 @@ static void rsi_coex_sched_tx_pkts(struct rsi_coex_ctrl_block *coex_cb)
} while (coex_q != RSI_COEX_Q_INVALID);
}
-static void rsi_coex_scheduler_thread(struct rsi_common *common)
+static int rsi_coex_scheduler_thread(void *data)
{
+ struct rsi_common *common = data;
struct rsi_coex_ctrl_block *coex_cb = common->coex_cb;
u32 timeout = EVENT_WAIT_FOREVER;
diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c
index 662e42d1e5e8..61db2b363d11 100644
--- a/drivers/net/wireless/rsi/rsi_91x_main.c
+++ b/drivers/net/wireless/rsi/rsi_91x_main.c
@@ -246,12 +246,13 @@ EXPORT_SYMBOL_GPL(rsi_read_pkt);
/**
* rsi_tx_scheduler_thread() - This function is a kernel thread to send the
* packets to the device.
- * @common: Pointer to the driver private structure.
+ * @data: Pointer to the driver private structure.
*
* Return: None.
*/
-static void rsi_tx_scheduler_thread(struct rsi_common *common)
+static int rsi_tx_scheduler_thread(void *data)
{
+ struct rsi_common *common = data;
struct rsi_hw *adapter = common->priv;
u32 timeout = EVENT_WAIT_FOREVER;
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
index 597b238e2294..18a28aa97446 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
@@ -62,8 +62,9 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter, u16 ms_word)
static void rsi_rx_handler(struct rsi_hw *adapter);
-void rsi_sdio_rx_thread(struct rsi_common *common)
+int rsi_sdio_rx_thread(void *data)
{
+ struct rsi_common *common = data;
struct rsi_hw *adapter = common->priv;
struct rsi_91x_sdiodev *sdev = adapter->rsi_dev;
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
index 25c2b232394a..513d2fdfb510 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
@@ -25,8 +25,9 @@
*
* Return: None.
*/
-void rsi_usb_rx_thread(struct rsi_common *common)
+int rsi_usb_rx_thread(void *data)
{
+ struct rsi_common *common = data;
struct rsi_hw *adapter = common->priv;
struct rsi_91x_usbdev *dev = adapter->rsi_dev;
int status;
diff --git a/drivers/net/wireless/rsi/rsi_common.h b/drivers/net/wireless/rsi/rsi_common.h
index 3cdf9ded876d..2a33a81f71a3 100644
--- a/drivers/net/wireless/rsi/rsi_common.h
+++ b/drivers/net/wireless/rsi/rsi_common.h
@@ -58,7 +58,7 @@ static inline void rsi_reset_event(struct rsi_event *event)
static inline int rsi_create_kthread(struct rsi_common *common,
struct rsi_thread *thread,
- void *func_ptr,
+ int (*func_ptr)(void *data),
u8 *name)
{
init_completion(&thread->completion);
diff --git a/drivers/net/wireless/rsi/rsi_sdio.h b/drivers/net/wireless/rsi/rsi_sdio.h
index 7c91b126b350..eb2b7f36a7e4 100644
--- a/drivers/net/wireless/rsi/rsi_sdio.h
+++ b/drivers/net/wireless/rsi/rsi_sdio.h
@@ -134,5 +134,5 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter, u16 ms_word);
void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit);
int rsi_sdio_determine_event_timeout(struct rsi_hw *adapter);
int rsi_sdio_check_buffer_status(struct rsi_hw *adapter, u8 q_num);
-void rsi_sdio_rx_thread(struct rsi_common *common);
+int rsi_sdio_rx_thread(void *data);
#endif
diff --git a/drivers/net/wireless/rsi/rsi_usb.h b/drivers/net/wireless/rsi/rsi_usb.h
index 961851748bc4..78067eaffe8b 100644
--- a/drivers/net/wireless/rsi/rsi_usb.h
+++ b/drivers/net/wireless/rsi/rsi_usb.h
@@ -81,5 +81,5 @@ static inline int rsi_usb_event_timeout(struct rsi_hw *adapter)
return EVENT_WAIT_FOREVER;
}
-void rsi_usb_rx_thread(struct rsi_common *common);
+int rsi_usb_rx_thread(void *data);
#endif
---
base-commit: 95d6a9ccef99117115e41e9adb271243bd5e985b
change-id: 20260802-rsi-cfi-fix-20085b693d22
Best regards,
--
Stefan Hansson <newbyte@postmarketos.org>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 12:22 [PATCH] wifi: rsi: Fix types to appease CFI Stefan Hansson
@ 2026-08-02 14:30 ` Jeff Johnson
2026-08-02 18:44 ` Stefan Hansson
2026-08-02 16:24 ` Johannes Berg
2026-08-13 21:15 ` kernel test robot
2 siblings, 1 reply; 7+ messages in thread
From: Jeff Johnson @ 2026-08-02 14:30 UTC (permalink / raw)
To: Stefan Hansson, linux-wireless, linux-kernel, phone-devel,
~postmarketos/upstreaming
Cc: Stefan Hansson
On 8/2/2026 5:22 AM, Stefan Hansson wrote:
> Avoids errors like:
>
> CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
>
> As seen in the aforementioned error this was tested using the downstream
> redpine_91x driver found in the Librem 5's downstream source tree.
> However, it appears that this driver is a modified version of the rsi
> driver found in mainline Linux and as such I decided to port the changes
> here too.
>
> Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
Having fixed a ton of these issues in the Qualcomm Android downstream driver I
was going to give my R-B, but I ran this through my ath.git patch acceptance
process and it flagged some issues, starting with:
WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch:
'From: Stefan Hansson <newbie13xd@gmail.com>' != 'Signed-off-by: Stefan
Hansson <newbyte@postmarketos.org>'
There are also kernel-doc issues noted below
> @@ -246,12 +246,13 @@ EXPORT_SYMBOL_GPL(rsi_read_pkt);
> /**
> * rsi_tx_scheduler_thread() - This function is a kernel thread to send the
> * packets to the device.
> - * @common: Pointer to the driver private structure.
> + * @data: Pointer to the driver private structure.
> *
> * Return: None.
Return: 0
> */
> -static void rsi_tx_scheduler_thread(struct rsi_common *common)
> +static int rsi_tx_scheduler_thread(void *data)
> {
> + struct rsi_common *common = data;
> struct rsi_hw *adapter = common->priv;
> u32 timeout = EVENT_WAIT_FOREVER;
>
...
> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
> index 25c2b232394a..513d2fdfb510 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
> @@ -25,8 +25,9 @@
above here update the documentation: s/common/data/
Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 function parameter
'data' not described in 'rsi_usb_rx_thread'
Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 Excess function
parameter 'common' description in 'rsi_usb_rx_thread'
> *
> * Return: None.
Return: 0
> */
> -void rsi_usb_rx_thread(struct rsi_common *common)
> +int rsi_usb_rx_thread(void *data)
> {
> + struct rsi_common *common = data;
> struct rsi_hw *adapter = common->priv;
> struct rsi_91x_usbdev *dev = adapter->rsi_dev;
> int status;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 12:22 [PATCH] wifi: rsi: Fix types to appease CFI Stefan Hansson
2026-08-02 14:30 ` Jeff Johnson
@ 2026-08-02 16:24 ` Johannes Berg
2026-08-02 18:40 ` Stefan Hansson
2026-08-13 21:15 ` kernel test robot
2 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2026-08-02 16:24 UTC (permalink / raw)
To: Stefan Hansson, linux-wireless, linux-kernel, phone-devel; +Cc: Stefan Hansson
On Sun, 2026-08-02 at 14:22 +0200, Stefan Hansson wrote:
> Avoids errors like:
>
> CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
Yeah, well. Everyone gets _one_ warning to send patches that actually
build warning-free, after that I just drop them without notice...
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 16:24 ` Johannes Berg
@ 2026-08-02 18:40 ` Stefan Hansson
2026-08-02 18:52 ` Johannes Berg
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hansson @ 2026-08-02 18:40 UTC (permalink / raw)
To: Johannes Berg, Stefan Hansson, linux-wireless, linux-kernel,
phone-devel
Hello Johannes,
On 02/08/2026 18:24, Johannes Berg wrote:
> On Sun, 2026-08-02 at 14:22 +0200, Stefan Hansson wrote:
>> Avoids errors like:
>>
>> CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
>
> Yeah, well. Everyone gets _one_ warning to send patches that actually
> build warning-free, after that I just drop them without notice...
Could you clarify what you are referring to here? I don't get any errors
when building after applying this patch on top of next-20260730:
$ make -j4
make: Entering directory '/mnt/linux'
make[1]: Entering directory '/mnt/linux/.output'
CC [M] drivers/net/wireless/rsi/rsi_91x_main.o
CC [M] drivers/net/wireless/rsi/rsi_91x_core.o
CC [M] drivers/net/wireless/rsi/rsi_91x_mac80211.o
CC [M] drivers/net/wireless/rsi/rsi_91x_mgmt.o
CC [M] drivers/net/wireless/rsi/rsi_91x_hal.o
CC [M] drivers/net/wireless/rsi/rsi_91x_ps.o
CC [M] drivers/net/wireless/rsi/rsi_91x_coex.o
CC [M] drivers/net/wireless/rsi/rsi_91x_debugfs.o
CC [M] drivers/net/wireless/rsi/rsi_91x_sdio.o
CC [M] drivers/net/wireless/rsi/rsi_91x_sdio_ops.o
CC [M] drivers/net/wireless/rsi/rsi_91x_usb.o
CC [M] drivers/net/wireless/rsi/rsi_91x_usb_ops.o
LD [M] drivers/net/wireless/rsi/rsi_91x.o
LD [M] drivers/net/wireless/rsi/rsi_sdio.o
LD [M] drivers/net/wireless/rsi/rsi_usb.o
MODPOST Module.symvers
CC [M] drivers/net/wireless/rsi/rsi_91x.mod.o
CC [M] drivers/net/wireless/rsi/rsi_sdio.mod.o
CC [M] drivers/net/wireless/rsi/rsi_usb.mod.o
LD [M] drivers/net/wireless/rsi/rsi_usb.ko
LD [M] drivers/net/wireless/rsi/rsi_sdio.ko
LD [M] drivers/net/wireless/rsi/rsi_91x.ko
make[1]: Leaving directory '/mnt/linux/.output'
make: Leaving directory '/mnt/linux'
FWIW I am building using Clang/LLVM.
If you are referring to checkpatch.pl complaining about the
aforementioned error line being too long, I can wrap it if you prefer that.
> johannes
Stefan Hansson
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 14:30 ` Jeff Johnson
@ 2026-08-02 18:44 ` Stefan Hansson
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Hansson @ 2026-08-02 18:44 UTC (permalink / raw)
To: Jeff Johnson, Stefan Hansson, linux-wireless, linux-kernel,
phone-devel, ~postmarketos/upstreaming
Hi Jeff,
On 02/08/2026 16:30, Jeff Johnson wrote:
> On 8/2/2026 5:22 AM, Stefan Hansson wrote:
>> Avoids errors like:
>>
>> CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
>>
>> As seen in the aforementioned error this was tested using the downstream
>> redpine_91x driver found in the Librem 5's downstream source tree.
>> However, it appears that this driver is a modified version of the rsi
>> driver found in mainline Linux and as such I decided to port the changes
>> here too.
>>
>> Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
>
> Having fixed a ton of these issues in the Qualcomm Android downstream driver I
> was going to give my R-B, but I ran this through my ath.git patch acceptance
> process and it flagged some issues, starting with:
> > WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address
mismatch:
> 'From: Stefan Hansson <newbie13xd@gmail.com>' != 'Signed-off-by: Stefan
> Hansson <newbyte@postmarketos.org>'
I was struggling to get b4 send to work with the mail service we use for
our postmarketOS email addresses but I have set up b4 relay now, so the
v2 should not have this issue. Hope switching around the sender in a new
revision is okay.
> There are also kernel-doc issues noted below
>
>> @@ -246,12 +246,13 @@ EXPORT_SYMBOL_GPL(rsi_read_pkt);
>> /**
>> * rsi_tx_scheduler_thread() - This function is a kernel thread to send the
>> * packets to the device.
>> - * @common: Pointer to the driver private structure.
>> + * @data: Pointer to the driver private structure.
>> *
>> * Return: None.
>
> Return: 0
>
>> */
>> -static void rsi_tx_scheduler_thread(struct rsi_common *common)
>> +static int rsi_tx_scheduler_thread(void *data)
>> {
>> + struct rsi_common *common = data;
>> struct rsi_hw *adapter = common->priv;
>> u32 timeout = EVENT_WAIT_FOREVER;
>>
> ...
>> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
>> index 25c2b232394a..513d2fdfb510 100644
>> --- a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
>> +++ b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
>> @@ -25,8 +25,9 @@
>
> above here update the documentation: s/common/data/
>
> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 function parameter
> 'data' not described in 'rsi_usb_rx_thread'
> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 Excess function
> parameter 'common' description in 'rsi_usb_rx_thread'
>
>> *
>> * Return: None.
>
> Return: 0
>
>> */
>> -void rsi_usb_rx_thread(struct rsi_common *common)
>> +int rsi_usb_rx_thread(void *data)
>> {
>> + struct rsi_common *common = data;
>> struct rsi_hw *adapter = common->priv;
>> struct rsi_91x_usbdev *dev = adapter->rsi_dev;
>> int status;
Regards,
Stefan Hansson
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 18:40 ` Stefan Hansson
@ 2026-08-02 18:52 ` Johannes Berg
0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2026-08-02 18:52 UTC (permalink / raw)
To: Stefan Hansson, Stefan Hansson, linux-wireless, linux-kernel,
phone-devel
On Sun, 2026-08-02 at 20:40 +0200, Stefan Hansson wrote:
> Hello Johannes,
>
> On 02/08/2026 18:24, Johannes Berg wrote:
> > On Sun, 2026-08-02 at 14:22 +0200, Stefan Hansson wrote:
> > > Avoids errors like:
> > >
> > > CFI failure at kthread+0x124/0x1cc (target: rsi_coex_scheduler_thread+0x0/0x1b4 [redpine_91x]; expected type: 0x89fb613d)
> >
> > Yeah, well. Everyone gets _one_ warning to send patches that actually
> > build warning-free, after that I just drop them without notice...
>
> Could you clarify what you are referring to here? I don't get any errors
> when building after applying this patch on top of next-20260730:
Alright, so it does build, sorry. I was just looking at nipa:
https://patchwork.kernel.org/project/linux-wireless/patch/20260802-rsi-cfi-fix-v1-1-5821d2cb54ee@postmarketos.org/
But I see now it's just duplicating the kernel-doc issues across all the
builds ... I wasn't paying attention to _what_ it was reporting and the
kthread_complete_and_exit() use in the functions and thought it was
likely getting "control reaches end of non-void function" warnings since
you change functions to int without ever returning anything.
> If you are referring to checkpatch.pl complaining about the
> aforementioned error line being too long, I can wrap it if you prefer that.
Nah, that's fine, no worries.
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
2026-08-02 12:22 [PATCH] wifi: rsi: Fix types to appease CFI Stefan Hansson
2026-08-02 14:30 ` Jeff Johnson
2026-08-02 16:24 ` Johannes Berg
@ 2026-08-13 21:15 ` kernel test robot
2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-08-13 21:15 UTC (permalink / raw)
To: Stefan Hansson, linux-wireless, linux-kernel, phone-devel,
~postmarketos/upstreaming
Cc: oe-kbuild-all, Stefan Hansson
Hi Stefan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 95d6a9ccef99117115e41e9adb271243bd5e985b]
url: https://github.com/intel-lab-lkp/linux/commits/Stefan-Hansson/wifi-rsi-Fix-types-to-appease-CFI/20260814-020048
base: 95d6a9ccef99117115e41e9adb271243bd5e985b
patch link: https://lore.kernel.org/r/20260802-rsi-cfi-fix-v1-1-5821d2cb54ee%40postmarketos.org
patch subject: [PATCH] wifi: rsi: Fix types to appease CFI
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260814/202608140519.Tt0pjFLu-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260814/202608140519.Tt0pjFLu-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608140519.Tt0pjFLu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 function parameter 'data' not described in 'rsi_usb_rx_thread'
>> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 Excess function parameter 'common' description in 'rsi_usb_rx_thread'
>> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 function parameter 'data' not described in 'rsi_usb_rx_thread'
>> Warning: drivers/net/wireless/rsi/rsi_91x_usb_ops.c:28 Excess function parameter 'common' description in 'rsi_usb_rx_thread'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-08-13 21:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 12:22 [PATCH] wifi: rsi: Fix types to appease CFI Stefan Hansson
2026-08-02 14:30 ` Jeff Johnson
2026-08-02 18:44 ` Stefan Hansson
2026-08-02 16:24 ` Johannes Berg
2026-08-02 18:40 ` Stefan Hansson
2026-08-02 18:52 ` Johannes Berg
2026-08-13 21:15 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.