Page MenuHomeFreeBSD

rtwn: Fix RTL8192EU cannot associate in STA mode
Needs ReviewPublic

Authored by cy on Mar 2 2023, 5:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 6, 10:44 PM
Unknown Object (File)
Mon, Mar 4, 7:12 PM
Unknown Object (File)
Feb 26 2024, 7:24 AM
Unknown Object (File)
Feb 9 2024, 5:43 AM
Unknown Object (File)
Jan 12 2024, 6:18 AM
Unknown Object (File)
Dec 23 2023, 5:34 AM
Unknown Object (File)
Nov 19 2023, 3:42 AM
Unknown Object (File)
Oct 14 2023, 2:26 AM
Subscribers

Details

Reviewers
imp
jhb
bz
arved
adrian
Group Reviewers
Src Committers
wireless
Summary

On some systems RTL8192EU will fail to associate in STA mode while
others it will work fine. On the systems RTL8192EU fails to associate
in STA mode, it works perfectly fine in AP mode. This points to a USB
timing issue when selecting a channel while in STA mode.

While here fix RTL8192EU power off and power on hang for the same reason.

Test Plan

Tested locally and in PR/247528.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

cy requested review of this revision.EditedMar 2 2023, 5:37 PM
cy updated this revision to Diff 118179.
cy created this revision.

Add similar fix for RTL8188EU as reported by rkoberman@gmail.com also in PR/247528. My 8188EU never experienced this problem so testing whether this fixes the problem or not must be confirmed by the person reporting it.

This would be a separate commit.

i understand the fix, but the whole code layout for rtwn is to avoid the HW code knowing too much about the bus/transport.

Honestly, I think we should move the delay stuff into the normal rtwn_softc and use it there, and only configure it for usb. That way the chipset HW code doesn't need to include the USB specific bits.

i understand the fix, but the whole code layout for rtwn is to avoid the HW code knowing too much about the bus/transport.

Honestly, I think we should move the delay stuff into the normal rtwn_softc and use it there, and only configure it for usb. That way the chipset HW code doesn't need to include the USB specific bits.

Thanks. I'll rework the patch and either update this revision or abandon it and open a new one instead.

With the patch I get an instant reboot (no coredump), so something is fishy. Sorry for not having much more information.

panic: _mtx_lock_sleep: recursed on non-recursive mutex rtwn0 @ /usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c:87

#6 0xffffffff80bd01a3 in panic (fmt=<unavailable>)

at /usr/src/sys/kern/kern_shutdown.c:907

#7 0xffffffff80baae8d in __mtx_lock_sleep (c=c@entry=0xfffffe00d8789018,

v=18446741878244833056, opts=opts@entry=0, 
file=file@entry=0xffffffff82aa8a54 "/usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c", line=line@entry=87) at /usr/src/sys/kern/kern_mutex.c:546

#8 0xffffffff80baa9d5 in __mtx_lock_flags (c=0xfffffe00d8789018, opts=0,

file=0xffffffff82aa8a54 "/usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c", line=87) at /usr/src/sys/kern/kern_mutex.c:284

#9 0xffffffff82aa4701 in r88eu_power_on (sc=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c:87

#10 0xffffffff82ac1739 in rtwn_init (sc=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/if_rtwn.c:1789

#11 rtwn_parent (ic=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/if_rtwn.c:1368

#12 0xffffffff80c3452a in taskqueue_run_locked (

queue=queue@entry=0xfffff8000896ba00)
at /usr/src/sys/kern/subr_taskqueue.c:514

panic: _mtx_lock_sleep: recursed on non-recursive mutex rtwn0 @ /usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c:87

#6 0xffffffff80bd01a3 in panic (fmt=<unavailable>)

at /usr/src/sys/kern/kern_shutdown.c:907

#7 0xffffffff80baae8d in __mtx_lock_sleep (c=c@entry=0xfffffe00d8789018,

v=18446741878244833056, opts=opts@entry=0, 
file=file@entry=0xffffffff82aa8a54 "/usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c", line=line@entry=87) at /usr/src/sys/kern/kern_mutex.c:546

#8 0xffffffff80baa9d5 in __mtx_lock_flags (c=0xfffffe00d8789018, opts=0,

file=0xffffffff82aa8a54 "/usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c", line=87) at /usr/src/sys/kern/kern_mutex.c:284

#9 0xffffffff82aa4701 in r88eu_power_on (sc=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c:87

#10 0xffffffff82ac1739 in rtwn_init (sc=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/if_rtwn.c:1789

#11 rtwn_parent (ic=0xfffffe00d8782000)

at /usr/src/sys/dev/rtwn/if_rtwn.c:1368

#12 0xffffffff80c3452a in taskqueue_run_locked (

queue=queue@entry=0xfffff8000896ba00)
at /usr/src/sys/kern/subr_taskqueue.c:514

Thanks. I'm taking adrian@'s advice to refactor, placing the added USB code into the bus portion of the code. The implementation will change. Thus it probably makes sense to abandon this revision and start a new revision when it's ready. As I'm working on other $JOB and FreeBSD things this week I'll start on this again next week.