Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Unable to suspend (Read 4296 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Unable to suspend

Reply #15
Hello again. I've been reading about your suspend issue and many sites says that it would be a problem with "xhci" module. Could you execute this as root:


Code: [Select]
modprobe -r xhci

And the try to suspend?

Artix Linux Colombia

Re: Unable to suspend

Reply #16
Hi again. I replied with the "Quick reply" option but I cannot see my reply so I will post it again.

I've been reading about your suspend issue and it's seems that there is a problem with the "xhci" module.

Can you execute those commands:

Code: [Select]
modprobe -r xhci_pci
Code: [Select]
modprobe -r xhci_hcd

And try to suspend?
Artix Linux Colombia

Re: Unable to suspend

Reply #17
My output of dmesg shows no errors related to the xhci module. So I don't see how that will help.
The only errors I see in dmesg now are related to gpu and bluetooth.
#FreeHongKong

Re: Unable to suspend

Reply #18
Hi, one of the screenshots you share shows an error like this:

"usb_dev_suspend+0x0/0x10 return -16"

I googled it and the error seems to be related with "xhci" module. The commands I sent you were only for testing purposes when you reboot the machine modules will load automatically again. If the test  works you might have to write a script (Or maybe it will be  a better solution) which unloads the modules before suspending and loads when resume.

You can read here:

https://forums.fedoraforum.org/showthread.php?249335-Can-t-suspend-or-hibernate

Best regards.
Artix Linux Colombia

Re: Unable to suspend

Reply #19
I did that just now and rebooted but it still did not display the lts option. Do I need to re-run grub-mkconfig again to make it appear?

That's odd. It should appear in grub. Did you run grub-mkconfig again? But even without it, I would have expect the entry to appear in your grub menu.

Re: Unable to suspend

Reply #20
When adding new kernels, grub-mkconfig must be re-run for them to appear. Also, if the alternate kernel doesn't solve the xhci error, running rmmod xhci_pci xhci_hcd before suspend should fix it (provided the modules aren't in use by something else).

Re: Unable to suspend

Reply #21
Your output includes:
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.

Do you have the osprober package installed? I once had to remove it to fix this.
Then run grub-mkconfig again.

Re: Unable to suspend

Reply #22
I tried this and it solved both the issues:

Thanks, @jrballesteros05 . :)


The problem was that I was running it on grub.conf. When I ran the same on grub.cfg , the options started appearing in the "Advanced options" section.

Your output includes:
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Do you have the osprober package installed? I once had to remove it to fix this.
Then run grub-mkconfig again.

I have always had this error appear when I boot. I never looked into why because it never caused me any inconvenience or stopped me from using the PC normally. I tried to look for the package you mentioned but I could not find it through either pacman -Q | grep "osprober" or pacman -Ss osprober. As I am going to mark this issue as solved (which I assume makes it turn off replies), I shall PM you with further details after I look into this error and try to find this package.

Thanks everyone for all the guidance and input. :)


#FreeHongKong

Re: Unable to suspend

Reply #23
Hello. This post is not solved at all. We just could find what is the problem but it isn't solved because xhci module it's necessary for USB ports.

This kernel bug is too old and it's quit strange that it hasn't been solved. What people normally do is a workaround which consist in 2 scripts.

One with this content:

Code: [Select]
#! /bin/bash
modprobe -r xhci_pci xhci_hcd

And the other with this one:

Code: [Select]
#! /bin/bash
modprobe xhci_pci xhci_hcd

In this post  from Archlinux forum they solved it using systemd but here there is no systemd installed, and in this post from Ubuntu they solve through pm-utils but I don't think you have pm-utils installed and I am not sure if install it could be a good idea.  I don't know either if there is something similar in "Runit" or "Elogind" to apply the workaround.
Artix Linux Colombia

Re: Unable to suspend

Reply #24
Hi again, I've been reading about Elogind and it could solve the problem at all. In the Artix wiki there is an entry that talk about running scripts when suspending. And this one from Gentoo wiki

So in
Code: [Select]
/usr/lib/elogind/system-suspend
you can execute scripts before suspending and when resume. So, it would be somtehing like this:

Code: [Select]
#!/bin/bash
case $1/$2 in
  pre/*)
    modprobe -r xhci_pci
    ;;
  post/*)
   modprobe xhci_pci
    ;;
esac

I am not an expert about this, if someone else see an error please make me know.

I hope it can help you.

Best regards.
Artix Linux Colombia

Re: Unable to suspend

Reply #25
Your output includes:
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.

Do you have the osprober package installed? I once had to remove it to fix this.
Then run grub-mkconfig again.

I'm not sure how removing osprober would affect this. This warning message has to do with lvm. It happens if your system is configured to load lvm volumes on boot but is not using the lvmetad daemon. It's not an error or anything; using device scanning to load lvm is perfectly fine. The daemon is supposed to be faster however.

Re: Unable to suspend

Reply #26
As per the inputs here, this is what I have done:

  • Created a directory in /usr/lib/eloginid/ named system-suspend .
  • Created a script and made it executable with the contents:
    Code: [Select]
     #!/bin/bash
    case $1/$2 in
      pre/*)
        modprobe -r xhci_pci
        ;;
      post/*)
       modprobe xhci_pci
        ;;
    esac

Here are the results/observations:

Unless I have xhci_pci manually disabled, I cannot suspend (so same as before, in essence).

With xhci_pci disabled :
  • Can suspend
  • Cannot use USB ports

With xhci_pci enabled :
  • Cannot suspend
  • Can use USB ports
  • The battery drains faster than Vin Diesel races in the movies
#FreeHongKong

Re: Unable to suspend

Reply #27
Hello again, I think the artixwiki has a mistake (So Artix guys you should check this). The script must be in "/usr/lib/elogind/system-sleep/" instead of "/usr/lib/elogind/system-suspend".

I tried by myself and it works.

Of course there is a problem with this workaround, in my case I have an external keyboard connected in my laptop through USB so I cannot resume with the external keyboard. I must do it with laptop keyboard.

Best regards.
Artix Linux Colombia

Re: Unable to suspend

Reply #28
Yeah the docs say system-sleep not systemd-suspend. I'll update it. Thanks.