* [PATCH batadv 1/3] batman-adv: correct batadv_wifi_* kernel-doc
2026-06-03 4:21 [PATCH batadv 0/3] batman-adv: wifi flags cache cleanup Sven Eckelmann
@ 2026-06-03 4:21 ` Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 2/3] batman-adv: drop duplicated wifi_flags assigned Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 3/3] batman-adv: use GFP_KERNEL allocations for the wifi detection cache Sven Eckelmann
2 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2026-06-03 4:21 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
The original kernel documentation for the batadv_wifi_* functions contained
copy+paste errors. Correct them to make it easier understandable.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/hard-interface.c | 6 +++---
net/batman-adv/hard-interface.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bb3c31b5..213d4609 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -960,9 +960,9 @@ static int batadv_hard_if_event_meshif(unsigned long event,
/**
* batadv_wifi_net_device_insert() - save information about wifi net_device
* @net_dev: net_device to add to batadv_wifi_net_devices
- * @wifi_flags: net_device which generated an event
+ * extracted batadv_hard_iface_wifi_flags of a net_device
*
- * Return: 0 on result, negative value on error
+ * Return: 0 on success, negative value on error
*/
static int
batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
@@ -996,7 +996,7 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
/**
* batadv_wifi_net_device_remove() - remove information about wifi net_device
- * @device_state: wifi net_device state to remove from batadv_wifi_net_device_state
+ * @device_state: wifi net_device state to remove from batadv_wifi_net_devices
*/
static void
batadv_wifi_net_device_remove(struct batadv_wifi_net_device_state *device_state)
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h
index 089e65c8..41ef2944 100644
--- a/net/batman-adv/hard-interface.h
+++ b/net/batman-adv/hard-interface.h
@@ -125,7 +125,7 @@ batadv_primary_if_get_selected(struct batadv_priv *bat_priv)
/**
* batadv_is_cfg80211() - check if the given hardif is a cfg80211
* wifi interface
- * @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device
+ * @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
*
* Return: true if the net device is a cfg80211 wireless device, false
* otherwise.
@@ -142,7 +142,7 @@ static inline bool batadv_is_cfg80211(u32 wifi_flags)
/**
* batadv_is_wifi() - check if flags belong to wifi interface
- * @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device
+ * @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
*
* Return: true if the net device is a 802.11 wireless device, false otherwise.
*/
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH batadv 2/3] batman-adv: drop duplicated wifi_flags assigned
2026-06-03 4:21 [PATCH batadv 0/3] batman-adv: wifi flags cache cleanup Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 1/3] batman-adv: correct batadv_wifi_* kernel-doc Sven Eckelmann
@ 2026-06-03 4:21 ` Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 3/3] batman-adv: use GFP_KERNEL allocations for the wifi detection cache Sven Eckelmann
2 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2026-06-03 4:21 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
During the initialization of the batadv_wifi_net_device_state, it is enough
to write the wifi_flags once before the batadv_wifi_net_device_state is
added to the batadv_wifi_net_devices rhashtable.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/hard-interface.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 213d4609..80eaac0e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -976,7 +976,6 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
if (!device_state)
return -ENOMEM;
- device_state->wifi_flags = wifi_flags;
netdev_hold(net_dev, &device_state->dev_tracker, GFP_ATOMIC);
device_state->netdev = net_dev;
WRITE_ONCE(device_state->wifi_flags, wifi_flags);
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH batadv 3/3] batman-adv: use GFP_KERNEL allocations for the wifi detection cache
2026-06-03 4:21 [PATCH batadv 0/3] batman-adv: wifi flags cache cleanup Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 1/3] batman-adv: correct batadv_wifi_* kernel-doc Sven Eckelmann
2026-06-03 4:21 ` [PATCH batadv 2/3] batman-adv: drop duplicated wifi_flags assigned Sven Eckelmann
@ 2026-06-03 4:21 ` Sven Eckelmann
[not found] ` <20260603045118.0625E1F00893@smtp.kernel.org>
2 siblings, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2026-06-03 4:21 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
The batadv_wifi_net_device_insert() is called with ASSERT_RTNL() held, but
not inside a spinlock or another context which prevents "might_sleep"
functions. To relax the requirements for the allocator, use GFP_KERNEL.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/hard-interface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 80eaac0e..63caabf5 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -972,11 +972,11 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
ASSERT_RTNL();
- device_state = kzalloc_obj(*device_state, GFP_ATOMIC);
+ device_state = kzalloc_obj(*device_state, GFP_KERNEL);
if (!device_state)
return -ENOMEM;
- netdev_hold(net_dev, &device_state->dev_tracker, GFP_ATOMIC);
+ netdev_hold(net_dev, &device_state->dev_tracker, GFP_KERNEL);
device_state->netdev = net_dev;
WRITE_ONCE(device_state->wifi_flags, wifi_flags);
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread