# System freeze on lid close only, FreeBSD-13



## phalange (Apr 17, 2021)

I have a Thinpad T470s, upgraded from 12.2 to 13.

When I close the lid, the system freezes solid, as in full lock up. Need to force restart with power button.

In my sysctl.conf I have (worked in 12.2)

```
# sleep
hw.acpi.supported_sleep_state=S3
hw.acpi.lid_switch_state=S3
```

If I run `acpiconf -s 3` the system sleeps fine.

I also tested before starting X session, same results.

Is lid close sending a different command? I can't make sense of it.

Suggestions?


----------



## phalange (Apr 20, 2021)

Anyone have idea about this?


----------



## Raffeale (Apr 20, 2021)

does keyboard works? try to press cap key, cap led is on or off?


----------



## phalange (Apr 20, 2021)

Raffeale said:


> does keyboard works? try to press cap key, cap led is on or off?


After reopening the lid, it is full lock up. No keyboard or mouse. Can't escape x session to terminal using ctl-alt-f*, and even without x running, the problem occurs.


----------



## Raffeale (Apr 21, 2021)

you can figure out the issues from log


----------



## phalange (Apr 22, 2021)

Filed as a bug report.

PR 255329


----------



## zackb (Aug 3, 2021)

I have the same issue on my T470s. Suspend worked fine in FreeBSD 12. Upgraded over the weekend and now it's freezing after closing the lid. The screen is still on, but unresponsive. After 10-15 seconds I can hear the fan ramping up.

Running  `acpiconf -s 3` also suspends fine, and the power button brings the system back up.

I can't find anything in the logs. Any suggestions on where to look are appreciated.


----------



## sidetone (Aug 3, 2021)

If the case doesn't have a button associated with a closed lid, it's because of heat, especially if the fan ramps up.


----------



## zackb (Aug 3, 2021)

Somehow my suspend works now, but I am not sure what changed. I kept playing with these sysctl settings and rebooting:

`hw.acpi.reset_video: 0
hw.acpi.verbose: 1
hw.acpi.suspend_state: S3
hw.acpi.lid_switch_state: S3`

I also changed `dev.acpi_ibm.0.handlerevents=NONE` to `dev.acpi_ibm.0.handlerevents='0x04'`, and that's when I noticed it worked; more details on this in `man acpi_ibm`. But then I switched it back and it still worked, odd. 

Anyway, I'm taking the win


----------



## zackb (Aug 4, 2021)

Apparently this is a know issue for ThinkPads upgraded to FreeBSD 13: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255745.


----------



## phalange (Aug 6, 2021)

zackb said:


> Apparently this is a know issue for ThinkPads upgraded to FreeBSD 13: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255745.



Yes, I had to revert to 12.2. I tested on  a t470s then a t430s and had the same result -- no resume from sleep aka suspend.


----------



## zackb (Aug 10, 2021)

I am still on 13 because I did not have the chance to revert yet. It's an intermittent issue now, so I just don't close the lid anymore. If I do `acpi -s 3` or `zzz`, it reverts fine. It's closing the lid that breaks it. Not always, but frequent enough; and I have to tell you that I've been conditioned not to close it after so many forced reboots.

The battery seems to last longer on 13, but other than that, for my use there are no noticeable improvements.


----------



## grahamperrin@ (Nov 23, 2021)

zackb said:


> If I do `acpi -s 3` or `zzz`, it reverts fine.



Are things configured for the power button to sleep the computer and if so, is the power button reliable?


----------



## zackb (Jan 2, 2022)

I believe so, because after `zzz` completes, pressing the power button brings the system up.

I also found out that after heavy use (high CPU, certain python scripts, Chrome on certain pages), even though the above commands put it to sleep, it can never wake up. I had to force power cycle in those instances. So definitely more to it than I observed initially.

More debugging being done on this issue, and possibly it relates to the sound driver? 

Bug 255745


----------



## grahamperrin@ (Jan 2, 2022)

Thanks. If you have not already seen it, here's what might be a comparable topic:









						Lid Close Action Issue on ThinkPad
					

I have a fresh install of 13.0-Release on a ThinkPad T460. Suspend and resume works as expected from X or Terminal environments using acpiconf -s 3. The default install should have no lid-close action as far as I know, however when I - without setting hw.acpi.lid_switch-state - close my lid, the...




					forums.freebsd.org
				




zackb I linked to your case from post #6 there.


----------

