Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#14249 closed bug (fixed)

Upgrade atheroswifi driver to FreeBSD 11.1

Reported by: waddlesplash Owned by: waddlesplash
Priority: normal Milestone: Unscheduled
Component: Drivers/Network/atheroswifi Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Attachments (10)

AsusUX31_2018-07-07_23-17-12_driver not seen.png (177.8 KB) - added by starsseed 4 months ago.
screenshot showing the driver is not visible in PackageFS
syslog (297.9 KB) - added by starsseed 4 months ago.
syslog
syslog.2 (128.4 KB) - added by khallebal 4 months ago.
atheroswifi (1.1 MB) - added by waddlesplash 4 months ago.
v3; for x86_gcc2
previous_syslog (114.0 KB) - added by khallebal 4 months ago.
previous_syslog-x86_64 (163.6 KB) - added by return_0e 4 months ago.
atheroswifi_64 (1.3 MB) - added by waddlesplash 4 months ago.
v4; for x86_64
syslog-x86_64-v4 (512.0 KB) - added by return_0e 4 months ago.
syslog-x86_64-ar9485 (512.0 KB) - added by return_0e 4 months ago.
previous_syslog.2 (262.3 KB) - added by khallebal 4 months ago.

Change History (42)

comment:1 Changed 4 months ago by starsseed

  • I disabled the packaged old atheroswifi driver (it doesn't appear any more)
  • I copied the new atheroswifi driver in /system/non-packaged/add-ons/kernel/drivers/bin
  • chmod 755 atheroswifi
  • reboot

and the drivers doesn't appears in the PackageFS /boot/system/add-ons/kernel/drivers/bin directory. (see attached screenshot)

any idea ?

Changed 4 months ago by starsseed

screenshot showing the driver is not visible in PackageFS

comment:2 Changed 4 months ago by waddlesplash

It will not appear in packagefs, the kernel will load it from non-packaged. But you need to copy it *after* rebooting; please follow my instructions from the post more closely.

comment:3 Changed 4 months ago by starsseed

Of course I copy it *after* rebooting (since I checked for the packaged atheroswifi driver for being disabled )

Now, if I execute listimage, the new driver is not listed. however the syslog contains the following lines

KERN: driver "atheroswifi" added
KERN: [atheroswifi] () couldn't find symbol __fbsd_ath_pci
KERN: Last message repeated 12 times.

NB : I updated my system to hrev52080 just before installing the new driver.

comment:4 Changed 4 months ago by waddlesplash

OK, sorry about that, please try this new build.

comment:5 Changed 4 months ago by starsseed

  • The new atheroswifi driver seems to be detected at boot.
  • When I execute listimage, the new driver is not listed. (I join my syslog)

Did you add the pciid [168c:0032] to the driver ?

comment:6 Changed 4 months ago by waddlesplash

If the driver is in non-packaged/bin, it will not be loaded at boot. Are you sure you blacklisted the old driver correctly? Again, you should be copying the driver in after boot.

comment:7 Changed 4 months ago by starsseed

Are you sure you blacklisted the old driver correctly?

yes sure, both add-ons/kernel/drivers/bin/atheroswifi and add-ons/kernel/drivers/dev/net/atheroswifi.

Again, you should be copying the driver in after boot.

Here is what I do :

  • I check for atheroswifi not in /boot/system/add-ons/kernel/drivers/bin.
  • I check for atheroswifi not in /boot/system/add-ons/kernel/drivers/dev/net.
  • I check that /boot/system/non-packaged/add-ons/kernel/drivers/bin is empty.
  • I reboot.
  • I move atheroswifi into /boot/system/non-packaged/add-ons/kernel/drivers/bin.
  • KERN: driver "atheroswifi" added is instantly added to the syslog file. Nothing more appends.
  • listimage|grep atheroswifi doesn't show anything (except the command itself).
  • I reboot.
  • nothing more appends.
  • if I remove atheroswifi from /boot/system/non-packaged/add-ons/kernel/drivers/binthen KERN: driver "atheroswifi" removed is instantly added to the syslog.

(syslog updated)

Changed 4 months ago by starsseed

Attachment: syslog added

syslog

comment:8 Changed 4 months ago by korli

weird, I thought the binary should be moved to /boot/system/non-packaged/add-ons/kernel/drivers/dev/net.

comment:9 Changed 4 months ago by waddlesplash

Nope, that's actually not necessary.

Changed 4 months ago by khallebal

Attachment: syslog.2 added

comment:10 Changed 4 months ago by khallebal

For me copying the driver to the non-packaged location results in KDL

PANIC: _mutex_lock(): called with interrupts disabled for lock 0xd02f90d0

Tried several times with both locations sys & user one, it gets everytime to KDL.

Syslog attached.

comment:11 Changed 4 months ago by waddlesplash

Aha, that's useful; it looks like a bug on my part. I'll take a look later today.

comment:12 Changed 4 months ago by v.vill

Greetings,
for what it's worth, I have the exact same problem as star's seed above. Except my card is an Atheros/Qualcomm QCA9565/AR9565, with hrev52088 on x86_64.
(And unlike you guys, I can't find any detailed info in the syslog, other than "driver atheroswifi removed/reloaded" when I move it in- and outside of the kernel tree. I'm not sure how I can increase verbosity/debugging output here...)

Changed 4 months ago by waddlesplash

Attachment: atheroswifi added

v3; for x86_gcc2

comment:13 Changed 4 months ago by waddlesplash

@khaled, I believe I've fixed that error; try this driver.

comment:14 in reply to:  13 Changed 4 months ago by khallebal

Replying to waddlesplash:

@khaled, I believe I've fixed that error; try this driver.

Unfortunately it still makes the system crash, with a somewhat different panic msg.

PANIC: _mutex_lock(): double lock of 0xd04067c4 by thread 561

the full log included.

Changed 4 months ago by khallebal

Attachment: previous_syslog added

Changed 4 months ago by return_0e

Attachment: previous_syslog-x86_64 added

comment:15 in reply to:  10 Changed 4 months ago by return_0e

Replying to khaled:

For me copying the driver to the non-packaged location results in KDL

PANIC: _mutex_lock(): called with interrupts disabled for lock 0xd02f90d0

Tried several times with both locations sys & user one, it gets everytime to KDL.

The same issue happens on x86_64 in hrev52092 when copying the renamed atheroswifi driver to the non-packaged directory. I've attached the syslog of this here.

comment:16 Changed 4 months ago by waddlesplash

Component: Drivers/NetworkDrivers/Network/atheroswifi
Summary: Upgrade WiFi drivers to FreeBSD 11.1Upgrade atheroswifi driver to FreeBSD 11.1

Changed 4 months ago by waddlesplash

Attachment: atheroswifi_64 added

v4; for x86_64

comment:17 Changed 4 months ago by return_0e

I'm able to connect to several access points on this Atheros card (AR928X) and it appears that v4 on x86_64 works fine on it. Tested on hrev52092. Attached syslog of the driver running on my machine.

Changed 4 months ago by return_0e

Attachment: syslog-x86_64-v4 added

comment:18 Changed 4 months ago by waddlesplash

Resolution: fixed
Status: assignedclosed

Merged in hrev52093. Thanks for testing!

@vvill, @starsseed: I wonder if your issues might be related to #6423. Try the workaround(s) in that ticket after updating to hrev52093 or later.

comment:19 in reply to:  18 Changed 4 months ago by starsseed

Replying to waddlesplash:

@starsseed: I wonder if your issues might be related to #6423. Try the workaround(s) in that ticket after updating to hrev52093 or later.

I will test Saturday (when I will be home). But, reading your patch hrev52093, I was thinking to a few things:
V.Vill's AR9565 and my AR9485 (like all post-AR9300 chipsets added since FreeBSD 10) require a firmware and I don't see anything related to that in the patch. So, how does it work? Do we need to copy a firmware file somewhere?

comment:20 Changed 4 months ago by waddlesplash

Oh, I missed that. But if they do, there should have been an error message in the syslog stating that a firmware was needed, and what its name was. I can add those pretty easily once we know what they are.

comment:21 Changed 4 months ago by waddlesplash

Ah, it seems I missed adding the AR9300+ HAL, which would explain why there is no messages besides "driver loaded." I'll do that when I get home today.

comment:22 in reply to:  21 Changed 4 months ago by starsseed

Replying to waddlesplash
Note, I'm not sure about the firmware, I've found conflicting informations.

comment:23 Changed 4 months ago by waddlesplash

I've merged the AR9300 HAL in hrev52095. Please try again after that.

comment:24 Changed 4 months ago by return_0e

I can also confirm that the AR9485 on Haiku hrev52097 x86_64 is successfully recognized and connects to the internet. Attached a syslog of the wifi card working on my PC.

Changed 4 months ago by return_0e

Attachment: syslog-x86_64-ar9485 added

comment:25 Changed 4 months ago by khallebal

Resolution: fixed
Status: closedreopened

After updating my system to hrev52094 the driver does work but renders the audio playback slower and sttutering, to make sure that it's not something else causing this behaviour, i extracted the driver to an earlier hrev52084 and the result is the same, the syslog is fludded with kernel messages. See syslog below.

Changed 4 months ago by khallebal

Attachment: previous_syslog.2 added

comment:26 Changed 4 months ago by waddlesplash

Resolution: fixed
Status: reopenedclosed

Technically that is a new issue; please open a new ticket for that.

Probably the audio stuttering is directly caused by the syslog spam; it appears to be writing a new line every 90-100ms or so, which would certainly eat up a lot of time writing to disk. I'll disable the print when I have time later today.

comment:27 Changed 4 months ago by khallebal

New ticket #14270 created

comment:28 Changed 4 months ago by starsseed

Thank you Waddlesplash. The AR9485 adapter runs fine for me under hrev52097.
And many thanks to Adrian Chadd for his huge work on the FreeBSD wifi Drivers!

posted from webpositive thru an Atheros AR9485 wifi adapter

comment:29 Changed 4 months ago by v.vill

Yes!! I can add that the AR9565 chip is working fine as well, even though it did take me a few tries (and a few KDL moments).

@waddlesplash: you were right, even when the atheroswifi (with your latest commit) began to actually be recognized and loaded, I ran into issues related to #6423 and I had to reset all previously known (i.e. wired) interfaces.

Many, many thanks!

comment:30 Changed 4 months ago by v.vill

Darn. For the last dozen boots, I've been stuck with a KDL kernel panic (the only way I could finish booting was by blacklisting the atheroswifi driver and using a wired connection again). The relevant line appears to be a
vm_page_fault: unhandled page fault in kernel space
exception.

Furthermore, the syslog includes many lines such as:

KERN: [atheroswifi] (ath_pci) ath_edma_rxfifo_alloc: Q1: alloc failed: i=1, nbufs=128?
KERN: [atheroswifi] (ath_pci) ath_edma_rxbuf_alloc: nothing on rxbuf?!

Here's whatever KDL output I could photograph:

If there's anything I can provide for more detailed info, please let me know.

Last edited 4 months ago by v.vill (previous) (diff)

comment:31 Changed 4 months ago by waddlesplash

Please open a new ticket for that, and attach (not link) to those photos. Please also run the "syslog" command at the KDL prompt, press Space until the output stops, and take a picture of that screen.

comment:32 in reply to:  31 Changed 4 months ago by v.vill

Replying to waddlesplash:

Please open a new ticket for that

Thanks! Added as #14282.

Note: See TracTickets for help on using tickets.