Page MenuHomeFreeBSD

urtwn(4): remove some duplicate actions from urtwn_ra_init()
AbandonedPublic

Authored by avos on Oct 22 2015, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 1 2024, 1:05 AM
Unknown Object (File)
Jun 3 2023, 5:17 PM
Unknown Object (File)
May 15 2023, 5:45 AM
Unknown Object (File)
Sep 8 2016, 6:39 AM
Unknown Object (File)
Jul 1 2016, 11:44 AM
Unknown Object (File)
May 30 2016, 5:26 PM
Unknown Object (File)
Mar 30 2016, 5:38 PM
Unknown Object (File)
Jan 21 2016, 10:31 AM
Subscribers

Details

Reviewers
kevlo
adrian
Summary

Reduce code duplication.

Test Plan

Tested with RTL8188EU, STA mode.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

avos retitled this revision from to urtwn(4): remove few unneeded actions from urtwn_ra_init().
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos added reviewers: adrian, kevlo.
avos set the repository for this revision to rS FreeBSD src repository - subversion.

ok, so this stupid hack is because of something else - there's no locking around fetching and setting vap->iv_bss; and sometimes an invalid or NULL node shows up there. The hack (ni = ref(vap->iv_bss)) closes the window, but it's still there.

I'd rather we actually plan out and fix how the vap node lifecycle and refcounting happens, rather than what currently happens.

In D3985#83018, @adrian wrote:

ok, so this stupid hack is because of something else - there's no locking around fetching and setting vap->iv_bss; and sometimes an invalid or NULL node shows up there. The hack (ni = ref(vap->iv_bss)) closes the window, but it's still there.

I'd rather we actually plan out and fix how the vap node lifecycle and refcounting happens, rather than what currently happens.

How this will help when vap->iv_bss will be changed / set to NULL before calling urtwn_ra_init()?

There's a small window around the time that the vap bss node gets changed in net80211. It's a small window, but people would hit it during scanning.

We should fix that and the locking first, otherwise we're still going to keep hitting issues. The refcounting isn't enough - it's atomic and done without locks but you can end up with node counters getting down to zero and then you get a reference to the node whilst it's being freed and then try incrementing the reference. It's all very racy.

avos retitled this revision from urtwn(4): remove few unneeded actions from urtwn_ra_init() to urtwn(4): remove some duplicate actions from urtwn_ra_init().
avos updated this object.
avos edited edge metadata.

If there is no possibility to use usbd_do_request*() without sleeping, then this will be a bit complicated (revert this part for now).