[SOLVED] QCA6174 freez after suspend

Problem

I am using Manjaro with Gnome.
When I suspend the laptop with wireless adapter turned on it will crash. I had the same issue on Ubuntu and on Solus. On Solus, a laptop would unlock but it was not possible to shut it down or launch any software. On Manjaro after opening the lid there is only a black screen.
I have tried updating the firmware manually using this repo using this command

sudo wget https://github.com/kvalo/ath10k-firmware/raw/master/QCA6174/hw3.0/4.4.1/firmware-6.bin_WLAN.RM.4.4.1-00051-QCARMSWP-1 -O /lib/firmware/ath10k/QCA6174/hw3.0/firmware-6.bin

I have tried various versions of the firmware but I cannot fix the problem.
The only fix I know it turning off wireless adapter before suspending.

Specs:

System:
  Host: tomasz-pc Kernel: 4.19.2-1-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 8.2.1 Desktop: Gnome 3.30.1 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: Acer product: Aspire VN7-591G v: V1.15 
  serial: <root required> 
  Mobo: Acer model: Aspire VN7-591G v: V1.15 serial: <root required> 
  UEFI: Insyde v: 1.15 date: 08/06/2015 
Battery:
  ID-1: BAT0 charge: 27.7 Wh condition: 38.4/52.5 Wh (73%) 
  model: LGC AC14A8L status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i5-4210H bits: 64 type: MT MCP 
  arch: Haswell rev: 3 L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23159 
  Speed: 917 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 883 2: 823 
  3: 831 4: 899 
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics 
  vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
  Device-2: NVIDIA GM107M [GeForce GTX 960M] vendor: Acer Incorporated ALI 
  driver: nvidia v: 410.73 bus ID: 01:00.0 
  Display: x11 server: X.org 1.20.3 driver: nvidia 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.2.5 
  direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 00:03.0 
  Device-2: Intel 8 Series/C220 Series High Definition Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 00:1b.0 
  Sound Server: ALSA v: k4.19.2-1-MANJARO 
Network:
  Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Lite-On driver: ath10k_pci v: kernel port: 4000 bus ID: 07:00.0 
  IF: wlp7s0 state: up mac: 5c:93:a2:9b:cc:51 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  driver: r8168 v: 8.045.08-NAPI port: 3000 bus ID: 08:00.0 
  IF: enp8s0 state: down mac: 30:65:ec:72:78:6f 
Drives:
  Local Storage: total: 931.51 GiB used: 86.10 GiB (9.2%) 
  ID-1: /dev/sda vendor: Western Digital model: WD10JPVX-22JC3T0 
  size: 931.51 GiB 
Partition:
  ID-1: / size: 906.94 GiB used: 86.10 GiB (9.5%) fs: ext4 dev: /dev/sda2 
  ID-2: swap-1 size: 8.80 GiB used: 12 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 50.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 280 Uptime: 1h 38m Memory: 7.71 GiB used: 4.38 GiB (56.8%) 
  Init: systemd Compilers: gcc: 8.2.1 clang: 7.0.0 Shell: bash v: 4.4.23 
  inxi: 3.0.27 

There is a fix, it involves writing a systemd service.

I have many other posts on this topic if you search the forum.

https://forum.manjaro.org/t/kernel-4-19-0-3-not-network-after-suspending-gnome-edition/63544/2

https://forum.manjaro.org/t/wifi-adapter-tp-link-tl-wn823n-must-be-reconnected-for-it-to-work/52968/19

https://forum.manjaro.org/t/surface-pro-1796-wifi-not-resuming-after-suspend/48133/47

https://forum.manjaro.org/t/thinkpad-x230t-wont-suspend-under-kernel-419rc4-4-18-4-17-4-14-4-9/59798/21

Here are some external links with excellent systemd reference material:

The ArchWiki - systemd

Red Hat - systemd-targets

Red Hat - systemd unit files

Systemd manpage

2 Likes

I’ve got exactly same problem. What hw your qca6174 has? Mine is 2.1

Read the links I posted. It is easily solved.

1 Like

Not really. This service you wrote does not execute correctly. Systemd interpreter does not respect ; and it executes “/bin/systemctl stop NetworkManager.service; ip link set wlp3s0 down; modprobe -r ath10k_pci” as one command, like “/bin/systemctl stop NetworkManager.service ip link set wlp3s0 down modprobe -r ath10k_pci”

(edit)
But I have to say that you helped me a loooot. Actually, this works: Thinkpad X230T won't suspend under kernel 419rc4, 4.18, 4.17, 4.14, 4.9

(edit)
Ok. This works partially. First suspend works, but next one does not work. Any solution for this?

(edit)
I noticed that service has this line: RemainAfterExit=yes. It prevented service from terminating. I modified it this way and it works like a charm:

[Unit]
Description=Stop network components prior to suspending
Before=sleep.target

[Service]
Type=oneshot
ExecStart=/bin/nmcli networking off

[Install]
WantedBy=sleep.target

and

[Unit]
Description=Start network components after resuming
After=suspend.target

[Service]
Type=oneshot
ExecStart=/bin/nmcli networking on

[Install]
WantedBy=suspend.target

@tomas98 let me know if it helped you

Well it sounds like that resolved your problem then.

Glad you got it working.

Hopefully the OP has the same success with using a service to correct his issue.

@tbg Thank you very much for your solution :slight_smile:
@qwaler Using your fix works like a charm. Thank you very much
Problem is resolved now.

1 Like

Awesome, systemd scores a two’fer. I was so against sysyemd at first. It’s taken a while , but I’ve changed my opinion since I’ve started to grasp how it works.

So glad you both got it working for you.

If anyone using this solution has a problem with network adapter being permanently disabled after rapidly closing and opening the lid, or for any reason whatsoever just run

sudo systemctl start start-network.service

Once again thanks for the help.

Hi,
after a couple of updates, this solution is no longer reliable. I have to enable both scripts every time I start the system and even then it sometimes does not work. I am using @qwaler’s version of system.d files.

Using only “nmcli networking off/on” in your service is the simplest method you can use. Generally it often takes a restart of network manager, loading/unloading your network modules, and raising/lowering your network adapter. You will have to add some or all of those steps to make this a more reliable service.

The links I posted earlier have all the information necessary to modify your service.

For those Atheros users out there with suspend problems. These two units should solve any suspend/resume problems related to your wifi.

Suspend unit:

#/etc/systemd/system/network-suspend.service
#sudo systemctl enable network-suspend.service
#sudo systemctl start network-suspend.service
#sudo systemctl status network-suspend.service
#sudo systemctl daemon-reload
[Unit]
Description=Network suspend service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/ip link set wlp7s0  down
ExecStart=/usr/bin/sleep 1
ExecStart=/usr/bin/rmmod  ath10k_pci
ExecStart=/usr/bin/sleep 1
ExecStartPost=/usr/bin/rmmod  ath10k_core

[Install]
WantedBy=sleep.target

Resume unit:

#/etc/systemd/system/network-resume.service
#sudo systemctl enable network-resume.service
#sudo systemctl start network-resume.service
#sudo systemctl status network-resume.service
#sudo systemctl daemon-reload
[Unit]
Description=Network resume service
After=suspend.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/sleep 10
ExecStart=/usr/bin/modprobe ath10k_pci
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/modprobe ath10k_core
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/ip link set wlp7s0 up
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/systemctl start NetworkManager
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi off'
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi on'

[Install]
WantedBy=suspend.target

If your adapter ID is different than “wlp7s0” you will need to substitute you own adapter’s ID into the service files. If you are using a different driver module(s) you will also need to substitute it in place of “ath10k_pci” and “ath10k_core” as well.

3 Likes

Thank you very much @tbg. It definitely works right now :slight_smile:.

I have read your reply before the edit and I definitely agree with you, I should have done more to solve the problem.

That’s OK. Sometimes I’m in the mood to write the unit for others, and sometimes I’m not. When I’m not in the mood, I can get ticked off if someone doesn’t seem motivated to help correct their own issue. At the same time not everyone is at the level of proficiency to write their own service files.

The service files to correct these issues used to be quite simple. Unfortunately recent kernel (or other) changes have made a lot of the suspend/resume services no longer work.

That is why I wrote this more advanced unit for others that couldn’t get it working themselves.

You are welcome, glad it’s now working for you.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark