* [PATCH] mac80211: clear lower drv private data on iface removal
@ 2012-11-08 12:37 Arik Nemtsov
2012-11-08 12:43 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Arik Nemtsov @ 2012-11-08 12:37 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov
The lower driver might rely on getting zeroed per-vif private memory
when an interface is added. Resetting the memory on removal avoids
adverse affects during recovery, where the interface is added without
being removed.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
net/mac80211/driver-ops.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index d3d9fda..4620117 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -183,6 +183,10 @@ static inline void drv_remove_interface(struct ieee80211_local *local,
trace_drv_remove_interface(local, sdata);
local->ops->remove_interface(&local->hw, &sdata->vif);
sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
+
+ /* clear driver specific private data */
+ memset(sdata->vif.drv_priv, 0, sdata->local->hw.vif_data_size);
+
trace_drv_return_void(local);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: clear lower drv private data on iface removal
2012-11-08 12:37 [PATCH] mac80211: clear lower drv private data on iface removal Arik Nemtsov
@ 2012-11-08 12:43 ` Johannes Berg
2012-11-08 12:43 ` Arik Nemtsov
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2012-11-08 12:43 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless
On Thu, 2012-11-08 at 14:37 +0200, Arik Nemtsov wrote:
> The lower driver might rely on getting zeroed per-vif private memory
> when an interface is added. Resetting the memory on removal avoids
> adverse affects during recovery, where the interface is added without
> being removed.
However, it means that data isn't stable across suspend/resume, which
could be desirable to the driver as it may want to have the same
configuration after resuming.
I think we should therefore leave this to the driver, it's obviously
easily implemented as the last step of the driver's ->remove_interface()
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: clear lower drv private data on iface removal
2012-11-08 12:43 ` Johannes Berg
@ 2012-11-08 12:43 ` Arik Nemtsov
0 siblings, 0 replies; 3+ messages in thread
From: Arik Nemtsov @ 2012-11-08 12:43 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Thu, Nov 8, 2012 at 2:43 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Thu, 2012-11-08 at 14:37 +0200, Arik Nemtsov wrote:
>> The lower driver might rely on getting zeroed per-vif private memory
>> when an interface is added. Resetting the memory on removal avoids
>> adverse affects during recovery, where the interface is added without
>> being removed.
>
> However, it means that data isn't stable across suspend/resume, which
> could be desirable to the driver as it may want to have the same
> configuration after resuming.
>
> I think we should therefore leave this to the driver, it's obviously
> easily implemented as the last step of the driver's ->remove_interface()
>
Agreed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-08 12:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 12:37 [PATCH] mac80211: clear lower drv private data on iface removal Arik Nemtsov
2012-11-08 12:43 ` Johannes Berg
2012-11-08 12:43 ` Arik Nemtsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox