Skip to contentSkip to conversation

Can not unload ath11k_pci and load it back

DISCUSSION Mark Herbert 2 participants 10 messages Oct 5, 2021 – Oct 30, 2021 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

Dear ath11k team,

The main issue is I can not hibernate and wake up my XPS 13 9310.  If I keep module loaded it hibernate. Bu hangs on resume. If I unload module - it resumes OK but there is no chance to have WIFI back without reboot.

If I do rmmod ath11k_pci - it shows errors in dmesg:

[   48.801504] ath11k_pci 0000:72:00.0: link down error during global reset
[   48.801700] DMAR: DRHD: handling fault status reg 2
[   48.801709] DMAR: [INTR-REMAP] Request device [0x72:0x00.0] fault index 0x60 [fault reason 0x22] Present field in the IRTE entry is clear

If I do modprobe immediately it does load module but card will not come back again.

In Arch wiki reloading modules was explained as a workaround to suspend-resume 9310, but looks like it does not work anymore. Suspend to idle works fine - no module unloading needed.

Kind regards

Mark.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 4 lines · Mark Herbert

Dear ath11k team,

The main issue is I can not hibernate and wake up my XPS 13 9310.  If I keep module loaded it hibernate. Bu hangs on resume.

Just to avoid confusions with terminology, with hibernate you mean storing the system state to a disk and completely powering off the laptop?

I assume hibernation fails because ath11k keeps the firmware running during suspend and ath11k is not able to recover if the firmware is dead during resume.

Can you file a bug about this, instructions here:

https://wireless.wiki.kernel.org/en/users/drivers/ath11k/bugreport

Quoted 11 lines

If I unload module - it resumes OK but there is no chance to have WIFI back without reboot.

If I do rmmod ath11k_pci - it shows errors in dmesg:

[   48.801504] ath11k_pci 0000:72:00.0: link down error during global reset [   48.801700] DMAR: DRHD: handling fault status reg 2
[   48.801709] DMAR: [INTR-REMAP] Request device [0x72:0x00.0] fault index 0x60 [fault reason 0x22] Present field in the IRTE entry is clear

Quoted 6 lines

If I do modprobe immediately it does load module but card will not come back again.

In Arch wiki reloading modules was explained as a workaround to suspend-resume 9310, but looks like it does not work anymore. Suspend to idle works fine - no module unloading needed.

I have an XPS 13 9310 as well but I can't test this right now. Can you provide more information about the card not getting back after modprobe? What exact kernel and BIOS versions are you using? What log messages you get from ath11k? Preferably the exact commands you use and the output you get from ath11k would help a lot to understand what's happening.

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do  ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps.  Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

Quoted 41 lines · Kalle Valo
Quoted 4 lines · Mark Herbert

Dear ath11k team,

The main issue is I can not hibernate and wake up my XPS 13 9310.  If I keep module loaded it hibernate. Bu hangs on resume.

Just to avoid confusions with terminology, with hibernate you mean storing the system state to a disk and completely powering off the laptop?

I assume hibernation fails because ath11k keeps the firmware running during suspend and ath11k is not able to recover if the firmware is dead during resume.

Can you file a bug about this, instructions here:

https://wireless.wiki.kernel.org/en/users/drivers/ath11k/bugreport

Quoted 11 lines

If I unload module - it resumes OK but there is no chance to have WIFI back without reboot.

If I do rmmod ath11k_pci - it shows errors in dmesg:

[   48.801504] ath11k_pci 0000:72:00.0: link down error during global reset [   48.801700] DMAR: DRHD: handling fault status reg 2
[   48.801709] DMAR: [INTR-REMAP] Request device [0x72:0x00.0] fault index 0x60 [fault reason 0x22] Present field in the IRTE entry is clear

Quoted 6 lines

If I do modprobe immediately it does load module but card will not come back again.

In Arch wiki reloading modules was explained as a workaround to suspend-resume 9310, but looks like it does not work anymore. Suspend to idle works fine - no module unloading needed.

I have an XPS 13 9310 as well but I can't test this right now. Can you provide more information about the card not getting back after modprobe? What exact kernel and BIOS versions are you using? What log messages you get from ath11k? Preferably the exact commands you use and the output you get from ath11k would help a lot to understand what's happening.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw

As I mentioned - if I build mhi as a module - card will not even start. it works only if mhi is compiled inside the kernel, and in this config I can not unload it.

Quoted 39 lines · Kalle Valo
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#5 lore raw
In reply to Kalle Valo

I've manged to start a card with mhi compiled as a module. Istead of autoload  configured to lad mhi in advance, before system detects ath11k. So the card starts. then I unload ath11k_pci, qtrr_mhi , and finally mhi. Then loading them back  - mhi first, then qtrr and finally ath11_pci. Still same story.  I've also tried to unload modules, then hibernate so laptop was off for a while. Then resumed and loaded the modules manually. No effect.

Quoted 39 lines · Kalle Valo
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#6 lore raw
In reply to Kalle Valo

Created the bug for hibernate issue. For me it looks very close to the modules unloading - Archlinux wiki provides module unloading before /loading after as a workaround. And in fact there are a lot of hardware pieces that need to be reinitialized  after resume, so it is a kind of common workaround.

https://bugzilla.kernel.org/show_bug.cgi?id=214649

By the way the card gives a lot of trouble not only for Linux users but even in Windows, and Dell has issued several driver updates (latest dated 23 of September).  Just windering if Dell also uses same firmware 12 month old or they have some bugfixes in the firmware itself...

Quoted 39 lines · Kalle Valo
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#7 lore raw
In reply to Kalle Valo

Applied several patches series from latest mailing list

ath11k: add feature for device recovery (3 pathes)

ath11k: support for WoW functionalities (6 patches)

ath11k: Advertise PLATFORM CAP PCIE GLOBAL RESET.

Before those the system was deadly stuck on resume from hibernation - but now it gives control back, so I can see the error log in DMESG.  The card is not waiking up , and I still can not unload/reload the ath11k_pci module to get device back. But here is the log  - maybe it will give some ideas.

[137698.301974] ACPI: EC: interrupt unblocked
[137698.498119] usb usb1: root hub lost power or was reset
[137698.498122] usb usb2: root hub lost power or was reset
[137698.498186] usb usb3: root hub lost power or was reset
[137698.498195] usb usb4: root hub lost power or was reset
[137698.498231] ath11k_pci 0000:72:00.0: failed to set mhi state: RESUME(6)
[137698.522871] nvme nvme0: 7/0/0 default/read/poll queues
[137698.656843] i915 0000:00:02.0: [drm] GuC firmware i915/tgl_guc_62.0.0.bin version 62.0 submission:disabled
[137698.656849] i915 0000:00:02.0: [drm] GuC SLPC: disabled
[137698.656850] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9 authenticated:yes
[137698.848725] usb 3-6: reset high-speed USB device number 3 using xhci_hcd
[137699.042347] usb 3-6: restoring control 00000000-0000-0000-0000-000000000101/10/5
[137699.042356] usb 3-6: restoring control 00000000-0000-0000-0000-000000000101/12/11
[137699.178934] usb 3-3: reset full-speed USB device number 2 using xhci_hcd
[137701.548589] ath11k_pci 0000:72:00.0: timed out while waiting for wow wakeup completion
[137701.548596] ath11k_pci 0000:72:00.0: failed to wakeup wow during resume: -110
[137701.548599] ath11k_pci 0000:72:00.0: failed to resume core: -110
[137701.548601] PM: dpm_run_callback(): pci_pm_restore+0x0/0xd0 returns -110
[137701.548621] ath11k_pci 0000:72:00.0: PM: failed to restore async: error -110
[137701.557110] PM: hibernation: Basic memory bitmaps freed
[137701.557113] OOM killer enabled.
[137701.557115] Restarting tasks ... done.
[137701.619948] PM: hibernation: hibernation exit
[137701.624409] usbcore: registered new interface driver btusb
[137704.668739] ath11k_pci 0000:72:00.0: wmi command 16387 timeout
[137704.668781] ath11k_pci 0000:72:00.0: failed to send WMI_PDEV_SET_PARAM cmd
[137704.668795] ath11k_pci 0000:72:00.0: failed to enable PMF QOS: (-11
Quoted 39 lines · Kalle Valo
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#8 lore raw
In reply to Kalle Valo

Found message in May archive of the mailing list with pretty similar issue that I have.

http://lists.infradead.org/pipermail/ath11k/2021-May/001267.html

The author of that message managed better debugging info than I did. It is same - if the kernel do autoloading of ath11k_pci  at boot it works. But  if I do manual load - it gets stuck in

"Wait for device to enter SBL or Mission mode"

sometimes instead of waiting it does report the versions of loaded firmware and the card works fine, but that happens very very rare. Once in 30-40 tries.

The message is produced by drivers/bus/mhi/core/boot.c file,  by

void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) function.   And this message seems to be generated if everything is working OK - so the card should reach this SBL or Mission mode and continue but it does not,  no follow up messages and the WiFi device is not available anymore.

Quoted 39 lines · Kalle Valo
Quoted 8 lines · Mark Herbert

I've found similar bug files already - so not to create duplicates simply commented there

https://bugzilla.kernel.org/show_bug.cgi?id=214541

Exactly - hibernation means saving state on disk and resuming later, it is a very usefull feature when you are running out of battery and want to save your work.

Got it, thanks. So it seems we have two issues here: ath11k does not support hibernation and ath11k module reload failing. Let's handle the module reload failing in bug #214541, but can you file another bug about the missing support for hibernation? Let's have one issue per bug report, it's easier to manage bugzilla that way.

Quoted 16 lines

Also one more point I've found - if MHI is configured in the kernel - the card is starting up on thr first boot and works. But if i configure MHI as a module - it does not. MHI module do load. So do ath11k and ath11k_pci.  But the last ath11k dmesg says :

mhi mhi0: Wait for device to enter SBL or Mission mode

Exactly as if I  do rmmod/modprobe sequence.

I use latest BIOS from Dell (in fact upgrading 3.0.4 to 3.1.0 did not cange anythng) ,  and have tried multiple kernels. Stable 5.14 series and ath11k git tree (next and master-pending). Nothing helps. Sometimes it woks out - I had couple of times successfully rmmod/modprobe ath11k_pci but it s a kind of random and very rare event ( I had it 2 times only).

Quoted 2 lines

So for me it looks like an issue between MHI and ath11k , but ubfortunately my knowledge is not enough to propose any solution here.

On my NUC x86 test box I reload ath11k modules several times a day while I test ath11k but I always reload the mhi modules at the same time, maybe that makes the difference? Or XPS 13 9310 works differently from NUC, that's also possible.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#9 lore raw
In reply to Kalle Valo

[    5.777419] ath11k_pci 0000:72:00.0: BAR 0: assigned [mem 0xa2500000-0xa25fffff 64bit]
[    5.777442] ath11k_pci 0000:72:00.0: enabling device (0000 -> 0002)
[    5.777783] ath11k_pci 0000:72:00.0: qca6390 hw2.0
[    5.934955] Loading firmware: ath11k/QCA6390/hw2.0/amss.bin
[    6.376059] ath11k_pci 0000:72:00.0: chip_id 0x0 chip_family 0xb board_id 0xff soc_id 0xffffffff
[    6.377450] ath11k_pci 0000:72:00.0: fw_version 0x101c06cc fw_build_timestamp 2020-06-24 19:50 fw_build_id
[    6.378909] Loading firmware: ath11k/QCA6390/hw2.0/board-2.bin
[    6.394521] Loading firmware: ath11k/QCA6390/hw2.0/m3.bin
rmmod ath11k_pci
[  100.322300] ath11k_pci 0000:72:00.0: link down error during global reset
[  100.322472] DMAR: DRHD: handling fault status reg 2
[  100.322491] DMAR: [INTR-REMAP] Request device [0x72:0x00.0] fault index 0x60 [fault reason 0x22] Present field in the IRTE entry is clear modprobe ath11k_pci
[  235.222223] ath11k_pci 0000:72:00.0: BAR 0: assigned [mem 0xa2500000-0xa25fffff 64bit]
[  235.223161] ath11k_pci 0000:72:00.0: qca6390 hw2.0
[  235.379984] mhi mhi0: Requested to power ON
[  235.380244] mhi mhi0: Power on setup success
[  235.380331] Loading firmware: ath11k/QCA6390/hw2.0/amss.bin
[  235.701567] mhi mhi0: Wait for device to enter SBL or Mission mode

Quoted 41 lines · Kalle Valo
Quoted 4 lines · Mark Herbert

Dear ath11k team,

The main issue is I can not hibernate and wake up my XPS 13 9310.  If I keep module loaded it hibernate. Bu hangs on resume.

Just to avoid confusions with terminology, with hibernate you mean storing the system state to a disk and completely powering off the laptop?

I assume hibernation fails because ath11k keeps the firmware running during suspend and ath11k is not able to recover if the firmware is dead during resume.

Can you file a bug about this, instructions here:

https://wireless.wiki.kernel.org/en/users/drivers/ath11k/bugreport

Quoted 11 lines

If I unload module - it resumes OK but there is no chance to have WIFI back without reboot.

If I do rmmod ath11k_pci - it shows errors in dmesg:

[   48.801504] ath11k_pci 0000:72:00.0: link down error during global reset [   48.801700] DMAR: DRHD: handling fault status reg 2
[   48.801709] DMAR: [INTR-REMAP] Request device [0x72:0x00.0] fault index 0x60 [fault reason 0x22] Present field in the IRTE entry is clear

Quoted 6 lines

If I do modprobe immediately it does load module but card will not come back again.

In Arch wiki reloading modules was explained as a workaround to suspend-resume 9310, but looks like it does not work anymore. Suspend to idle works fine - no module unloading needed.

I have an XPS 13 9310 as well but I can't test this right now. Can you provide more information about the card not getting back after modprobe? What exact kernel and BIOS versions are you using? What log messages you get from ath11k? Preferably the exact commands you use and the output you get from ath11k would help a lot to understand what's happening.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k