Search Linux Wireless

Re: [PATCH] mac80211: fix chantype recalc warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 August 2014 17:05, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> On Mon, 2014-07-28 at 15:16 +0200, Michal Kazior wrote:
>> When a device driver is unloaded local->interfaces
>> list is cleared. If there was more than 1
>> interface running and connected (bound to a
>> chanctx) then chantype recalc was called and it
>> ended up with compat being NULL causing a call
>> trace warning.
>>
>> Warn if compat becomes NULL as a result of
>> incompatible bss_conf.chandef of interfaces bound
>> to a given channel context only.
>
> Err, this slipped my radar - where does this need to go?

No big deal. The warning is just a small nuisance with multi-vif. You
won't see this on a typical system.


>
> Also - is this really the right thing? Why does this happen in this
> situation? Shouldn't they all be not connected or not have a chanctx or
> be compatible?

If you eject, e.g. plug a usb wifi device out, its driver will call
ieee80211_unregister_hw() which calls ieee80211_remove_interfaces().
If there are still running interfaces that have a netdev (probably to
avoid a deadlock on iflist_mtx?) each interface is *moved* to a
temporary list for a later call to unregister_netdevice_many(). While
unregister_netdevice_many() executes the local->interfaces is empty.
ieee80211_recalc_chanctx_chantype() is called whenever a chanctx is
unassigned from a vif as long as there are still references to that
chanctx. If there is just 1 interface when device is ejected, then
ieee80211_recalc_chanctx_chantype() is not called. If there is more
than 1 running interfaces then the removal of each but the last one
calls to ieee80211_recalc_chanctx_chantype(). Since local->interfaces
is empty compat pointer stays NULL and this triggers WARN_ON_ONCE (but
only the first one effectively dumps a trace).

Another way to fix this would probably be to change
ieee80211_remove_interfaces() to remove all interfaces one-by-one
(instead of in bulk). It seems iflist_mtx can be temporarily released
while iterating over interfaces for the sake of calling
unregister_netdevice() for each one because RTNL is held all the time
guaranteeing no new interfaces are added in the meantime. I'm not sure
if it's perfectly safe to replace unregister_netdevice_many() just
like that though. I can look more into it.


Michał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux