Re: [PATCH wireless 1/3] Revert "wifi: wilc1000: convert list management to RCU"
From: Kalle Valo
Date: Sat Jun 01 2024 - 05:59:54 EST
Alexis Lothoré <alexis.lothore@xxxxxxxxxxx> wrote:
> This reverts commit f236464f1db7bea80075e6e31ac70dc6eb80547f
>
> Commit f236464f1db7 ("wifi: wilc1000: convert list management to RCU")
> replaced SRCU with RCU, aiming to simplify RCU usage in the driver. No
> documentation or commit history hinted about why SRCU has been preferred
> in original design, so it has been assumed to be safe to do this
> conversion.
> Unfortunately, some static analyzers raised warnings, confirmed by runtime
> checker, not long after the merge. At least three different issues arose
> when switching to RCU:
> - wilc_wlan_txq_filter_dup_tcp_ack is executed in a RCU read critical
> section yet calls wait_for_completion_timeout
> - wilc_wfi_init_mon_interface calls kmalloc and register_netdevice while
> manipulating a vif retrieved from vif list
> - set_channel sends command to chip (and so, also waits for a completion)
> while holding a vif retrieved from vif list (so, in RCU read critical
> section)
>
> Some of those issues are not trivial to fix and would need bigger driver
> rework. Fix those issues by reverting the SRCU to RCU conversion commit
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-wireless/3b46ec7c-baee-49fd-b760-3bc12fb12eaf@moroto.mountain/
> Fixes: f236464f1db7 ("wifi: wilc1000: convert list management to RCU")
> Signed-off-by: Alexis Lothoré <alexis.lothore@xxxxxxxxxxx>
3 patches applied to wireless.git, thanks.
ebfb5e8fc8b4 Revert "wifi: wilc1000: convert list management to RCU"
3596717a6fbd Revert "wifi: wilc1000: set atomic flag on kmemdup in srcu critical section"
596c195680dc wifi: wilc1000: document SRCU usage instead of SRCU
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240528-wilc_revert_srcu_to_rcu-v1-1-bce096e0798c@xxxxxxxxxxx/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches