Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] wifi: rsi: Fix types to appease CFI
       [not found] <20260802-rsi-cfi-fix-v1-1-5821d2cb54ee@postmarketos.org>
@ 2026-08-02 14:30 ` Jeff Johnson
  2026-08-02 18:44   ` Stefan Hansson
  2026-08-02 16:24 ` Johannes Berg
  1 sibling, 1 reply; 5+ 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] 5+ messages in thread

* Re: [PATCH] wifi: rsi: Fix types to appease CFI
       [not found] <20260802-rsi-cfi-fix-v1-1-5821d2cb54ee@postmarketos.org>
  2026-08-02 14:30 ` [PATCH] wifi: rsi: Fix types to appease CFI Jeff Johnson
@ 2026-08-02 16:24 ` Johannes Berg
  2026-08-02 18:40   ` Stefan Hansson
  1 sibling, 1 reply; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread

* Re: [PATCH] wifi: rsi: Fix types to appease CFI
  2026-08-02 14:30 ` [PATCH] wifi: rsi: Fix types to appease CFI Jeff Johnson
@ 2026-08-02 18:44   ` Stefan Hansson
  0 siblings, 0 replies; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2026-08-02 18:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260802-rsi-cfi-fix-v1-1-5821d2cb54ee@postmarketos.org>
2026-08-02 14:30 ` [PATCH] wifi: rsi: Fix types to appease CFI 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox