* [PATCH] wifi: mwifiex: Allocate dev name earlier for interface workqueue name
@ 2026-01-07 9:27 Chen-Yu Tsai
2026-01-07 14:59 ` Francesco Dolcini
0 siblings, 1 reply; 2+ messages in thread
From: Chen-Yu Tsai @ 2026-01-07 9:27 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Johannes Berg
Cc: Chen-Yu Tsai, linux-wireless, linux-kernel
The interface specific workqueues are allocated with the interface name
as part of the workqueue name. However when they are allocated, the
interface name has not been allocated, thus the "name" is actually the
pattern for the name "mlan%d". This ends up pretty ugly and could
conflict if multiple interfaces were added.
Allocate the device name earlier and use that to allocate the
workqueues. Also tweak the workqueue name patterns to add a separator
between the prefix and the interface name parts for readability.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index be23a29e7de0..a66d18e380fc 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -3147,10 +3147,14 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
SET_NETDEV_DEV(dev, adapter->dev);
- priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC%s",
+ ret = dev_alloc_name(dev, name);
+ if (ret)
+ goto err_alloc_name;
+
+ priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC-%s",
WQ_HIGHPRI |
WQ_MEM_RECLAIM |
- WQ_UNBOUND, 0, name);
+ WQ_UNBOUND, 0, dev->name);
if (!priv->dfs_cac_workqueue) {
mwifiex_dbg(adapter, ERROR, "cannot alloc DFS CAC queue\n");
ret = -ENOMEM;
@@ -3159,9 +3163,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue);
- priv->dfs_chan_sw_workqueue = alloc_workqueue("MWIFIEX_DFS_CHSW%s",
+ priv->dfs_chan_sw_workqueue = alloc_workqueue("MWIFIEX_DFS_CHSW-%s",
WQ_HIGHPRI | WQ_UNBOUND |
- WQ_MEM_RECLAIM, 0, name);
+ WQ_MEM_RECLAIM, 0, dev->name);
if (!priv->dfs_chan_sw_workqueue) {
mwifiex_dbg(adapter, ERROR, "cannot alloc DFS channel sw queue\n");
ret = -ENOMEM;
@@ -3198,6 +3202,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
destroy_workqueue(priv->dfs_cac_workqueue);
priv->dfs_cac_workqueue = NULL;
err_alloc_cac:
+err_alloc_name:
free_netdev(dev);
priv->netdev = NULL;
err_sta_init:
--
2.52.0.351.gbe84eed79e-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: mwifiex: Allocate dev name earlier for interface workqueue name
2026-01-07 9:27 [PATCH] wifi: mwifiex: Allocate dev name earlier for interface workqueue name Chen-Yu Tsai
@ 2026-01-07 14:59 ` Francesco Dolcini
0 siblings, 0 replies; 2+ messages in thread
From: Francesco Dolcini @ 2026-01-07 14:59 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Brian Norris, Francesco Dolcini, Johannes Berg, linux-wireless,
linux-kernel
On Wed, Jan 07, 2026 at 05:27:40PM +0800, Chen-Yu Tsai wrote:
> The interface specific workqueues are allocated with the interface name
> as part of the workqueue name. However when they are allocated, the
> interface name has not been allocated, thus the "name" is actually the
> pattern for the name "mlan%d". This ends up pretty ugly and could
> conflict if multiple interfaces were added.
>
> Allocate the device name earlier and use that to allocate the
> workqueues. Also tweak the workqueue name patterns to add a separator
> between the prefix and the interface name parts for readability.
Is there any impact on this approach when/if the interface is renamed from
userspace?
Francesco
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-07 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07 9:27 [PATCH] wifi: mwifiex: Allocate dev name earlier for interface workqueue name Chen-Yu Tsai
2026-01-07 14:59 ` Francesco Dolcini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®