• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Finally some success with suspend/resume

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#1
Hello world,

I finally had some progress with my laptop which would not resume. Resume from S3 would result in a forced power cycle after watching a black screen until bored.

What did the trick for me was to set
Code:
hw.usb.no_suspend_wait=1
and now it works a lot better. Well, this is easy considering it did not work at all before that. And it only works when in the console, not X11. That is a bit strange, the console is using the new vt driver, so basically there should be little difference, yes?

Anyway, I post this here so some other users may have a try at this. The most interesting point is that suspend/resume would also hang when USB was disabled in the BIOS and no driver was loaded. Now it would be interesting what else that sysctl affects, but that is "more research required".
 

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#2
To be more detailed: I cleaned up my sysctl.conf after the success to remove old crud from a long history of getting this to work. And what could possibly go wrong? It did no longer work. You also need these entries:
Code:
hw.pci.do_power_suspend=0
hw.pci.do_power_nodriver=1
The last one, I am not sure about. But I have restored them from a backup and it now works. So you need more than one setting, and why these are connected is not really obvious (to me).
 

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#4
It's an ASUS F8P. The ACPI seems to be, well, seems to have much room for improvements on any ASUS hardware I have. This might be normal, as I do not switch my hardware like some fashion victim, it has to work some years before being even considered old. So my experience with newer hardware (<5 years) is very limited. Maybe it is much better these days, maybe not.
 

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#8
To be more detailed: I cleaned up my sysctl.conf after the success to remove old crud from a long history of getting this to work. And what could possibly go wrong? It did no longer work. You also need these entries:

The last one, I am not sure about. But I have restored them from a backup and it now works. So you need more than one setting, and why these are connected is not really obvious (to me).
And I found something which I consider worth mentioning: you not only need to disable the power management for suspend, but you have to keep the power management for resume!

So this is my current sysctl.conf:
Code:
#do this to keep suspend from hanging the system at resume
hw.usb.no_suspend_wait=1
hw.pci.do_power_suspend=0

#just to make sure...
hw.pci.do_power_resume=1

hw.pci.do_power_nodriver=3

hw.acpi.lid_switch_state=S3
Also I would like to take this chance to praise ZFS for its robustness while trying things out - no file system damage from not resuming is a great thing.
 

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#9
Well, when I discovered 2 days ago that I was running a system from november, I did an update to 10.1-STABLE r276813, but now suspend is completely borked. When it was a good chance that the resume would work 2 out of three times, it now does not even suspend correctly. Just the screen goes dark, and that's it. Setting debug.acpi.suspend_bounce to 1 does not give information, it also simply turns the screen off and does nothing. And that is even the case when all settings I had done before are removed. So, sadly I am worse off than before, but I will not give up. Who knows, in the end this might motivate me enough to work on some suspend-to-disc.
 

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#10
Okay - I was at the point where the system will not even suspend. One good tip for anyone trying to get suspend/resume to work is this: get rid of VESA support in your kernel config!

After removing this by the use of a nooptions VESA line in my kernel config (you see, I include GENERIC and strip out anything I do not need) I can now suspend and resume again. This worked in 100% of attempts (N=1, so there is more testing needed!), but all in all this looks like it can be the problem.
 

merkata

New Member

Thanks: 1
Messages: 1

#11
I'm writing in this thread, because I found it while on my quest to get my suspend/resume working (again) on my Sony VAIO VPCYB3V1E - it wasn't working on 10.1, so I updated to -CURRENT and things were looking pretty great (suspend/resume working with some graphics issues on resuming that were fixed in later commits). Now this is some months ago and update after update things were the same or better. I hadn't updated -CURRENTcurrent on my laptop in about a month as of this writing, so I updated, but after that suspending failed. It is quite odd, since I haven't changed anything in my setup or configurations. Following the suspend hints in the wiki, I tried to narrow down the possible reasons by eliminating unnecessary kernel modules, though I wasn't able to remove the bluetooth modules, ng_bluetooth and others. I put a WITHOUT_BLUETOOTH=yes in my /etc/src.conf and rebuild world and kernel, a reboot later my worries were gone - the system suspends just fine now. Hopefully it can save someone with similar troubles some time.
 
Last edited by a moderator:

Crivens

Moderator
Staff member
Moderator

Thanks: 436
Messages: 1,304

#12
Worth a try - I have been faced with a broken suspend/resume again for some time, but do not know which update brought it in again. I use it seldom, but when I do I would like it to work. If I knew it would work, I would use it more.

I also tried -current, but that made no difference. I do not even know which driver in particular does the breaking. Some more testing will be in order there. But I will definitely give the removal of bluetooth a try.
 

jrm@

Daemon
Developer

Thanks: 447
Messages: 1,163

#13
Now that frequent -CURRENT snapshots are released, it's easier to narrow down the commit that introduced the problem. Unfortunately, you still have to bisect the problem by wiping and installing your system some number of times.
 

lme@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 293
Messages: 775

#15
Is there anyone out there using FreeBSD 10.2 or higher with working suspend resume for the Thinkpad X230?
Works almost flawlessly here. Only issue is the dead SD card reader after resuming.
 

gofer_touch

Active Member

Thanks: 119
Messages: 244

#16
WOW! This is great news then. Are your USB ports still functional after resume? Did you have to do any specific tuning/tweaks/configs to get this to work or does it work out of the box?

I am asking these questions because if this is the case I can switch over my main workstation which is a laptop to FreeBSD.
 

lme@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 293
Messages: 775

#17
You need to use vt instead of sc. Apart from that no further configuration is needed IIRC. USB still works after resuming. That was fixed some time ago.
 

Seagate

Member


Messages: 20

#18
And I found something which I consider worth mentioning: you not only need to disable the power management for suspend, but you have to keep the power management for resume!

So this is my current sysctl.conf:
Code:
#do this to keep suspend from hanging the system at resume
hw.usb.no_suspend_wait=1
hw.pci.do_power_suspend=0

#just to make sure...
hw.pci.do_power_resume=1

hw.pci.do_power_nodriver=3

hw.acpi.lid_switch_state=S3
Also I would like to take this chance to praise ZFS for its robustness while trying things out - no file system damage from not resuming is a great thing.
i've try with your sysctl.conf in Thinkpad T420. suspend and resume is work but resuming with black screen.
how to fix that ?
 
Top