
Suspend for the X1 Carbon 2018 on Linux - fiji-flo
https://github.com/fiji-flo/x1carbon2018s3
======
1996
This is short on details. So here are some more: since S0 ( active suspend)
became more popular with windows 10, most manufacturers have decided to REMOVE
THE CODE from the bios that allows S3 (suspend to ram).

Worst case is they left the stubs pretending S3 is supported, so the computer
goes to sleep - but never wakes up! Dell, I'm looking at you!!

Workarounds come from redoing the S3 code, mostly in ACPI tables with triggers
- for all peripherals.

It is a shame, as in S3 most laptops eat less that 1% of the battery per hour,
while in S0 such good results require heavy configuration to prevent the
"active" part of active sleep, and make sure the laptop never wakes up until
you actually press on the power button. But I guess it is the road to
progress, as S0 is more flexible.

~~~
nextos
It's worrying how obscure and poor standards compliance modern hardware is
starting to display. And we're talking about PCs. Let's not even discuss
mobiles.

In 2012 I bought a MacBook Air to run Linux. It's a great silent machine with
all Intel hardware, except the pretty poor quality Broadcom wireless card. It
boots with any vanilla kernel, and everything just works. Except for poor
wireless range. What machine can I buy these days that?

i) Just works on Linux (which in practice means everything has to be Intel,
including the wireless card)

ii) Is reasonably silent

The only machine I've found worth considering is a Xiaomi Air 12 with a m3
(fanless) CPU. Some Thinkpads are OK, but they tend to be on the noisy side of
things due to excessively small fans and too much power I don't need. This,
despite aggressively tweaking powertop settings.

I'm also looking for external USB high-gain wireless antennas. But even
classic Alfa ones with Atheros 9271 chipsets are a hit and miss.

It's a bit hopeless. If someone has good suggestions, I'd be glad to consider
them.

~~~
michelledepeil
Thinkpads might not be as bad as you think. I have an X230 at home, which runs
many flavors of linux extremely well and is dead silent, and a T440s at work
which is also an excellent choice albeit slightly more expensive. You can pick
up refurbished t440s'es for around 500-700 euros in the Netherlands, where
X230's go for 200 at the very lowest price point (still with an ssd!).

Unless I'm playing Counter Strike on the X230, which runs great all things
considered, I never ever hear the fan. Wireless and thankfully wired
connections are spotless too, though the X230 doesn't have 802.11ac as far as
I know.

~~~
kajecounterhack
X1 Carbon 5th gen had some kinks at first but has been serving me well w/
Ubuntu for a year now. Managing the HiDPI display has been the only real
headache -- if I could go back in time I'd have gotten the 1080p screen
instead of the high res one.

Besides that when I say it works, I mean it really works. Even the 4g card I
added worked out of box on Ubuntu!

~~~
brongondwana
Yeah, that's why I got the 1080p screen :) Learned my lesson with the 2nd gen
- that was a piece of crap.

------
bubblethink
Didn't Lenovo used to get Thinkpads certified by Ubuntu and RH ? Did they give
up on it ? That only leaves Dell as the other main vendor (not counting
smaller niche players) that still gives a shit.

Edit: Looks like they still do, just that certification doesn't mean shit.
This is more RH and Canonical's fault than Lenovo's. What's the point of
certifying something if you can add a note (as Canonical did) that
suspend/resume doesn't work.

[https://access.redhat.com/ecosystem/hardware/3398131](https://access.redhat.com/ecosystem/hardware/3398131)

[https://certification.ubuntu.com/hardware/201712-26045/](https://certification.ubuntu.com/hardware/201712-26045/)

~~~
rafael859
> Slow Resume from Suspend

> This system does not not meet our performance criteria for resuming from
> suspend, but suspend/resume is functional and other functionality is not
> affected.

Ah, so it does meet their performance criteria after all. The elusive double
negative.

~~~
bubblethink
Upon further reading, there are further issues with this laptop with thermal
throttling (only on linux, not windows). And no support for wwan or
fingerprint reader. The certification is beyond useless.

------
rubbingalcohol
It's probably because Lenovo's suspend feature relies on an unsigned binary
blob from China sideloaded during system boot over an unsecure HTTP
connection.

Why anyone still trusts Lenovo enough for this sort of thing to come up as an
issue is beyond me.

~~~
organsnyder
Citation on that? Never heard that before, and I own two ThinkPads (including
a four-month-old T480).

~~~
rubbingalcohol
[https://www.makeuseof.com/tag/security-failings-
demonstrate-...](https://www.makeuseof.com/tag/security-failings-demonstrate-
avoid-lenovo/)

Or who could forget Lenovo's surveillance malware that performed man-in-the-
middle attacks on SSL traffic? Seriously, these machines should be banned for
sale in the U.S. on national security grounds.

~~~
philsnow
that link says nothing about

> Lenovo's suspend feature relies on an unsigned binary blob from China
> sideloaded during system boot over an unsecure HTTP connection

it talks about Lenovo Service Engine, Superfish, Lenovo Solution Center, and
Lenovo Customer Feedback.

if you blow away the default install of windows, including the UEFI partition,
and install (windows or linux or whatever) from scratch, how could any of
those things affect you?

~~~
rubbingalcohol
Lenovo Service Engine was BIOS-level bloatware loading garbage into clean
installs of Windows over HTTP. Lenovo's drivers were so bad that they couldn't
get Microsoft WHQL certification, so their BIOS was sideloading them in a very
unsecure manner.

~~~
slrz
Note that this is an official Windows feature and it is the OS that executes
the firmware-provided crapware in the first place. It should provide an option
to turn it off.

Of course, malicious firmware doesn't really depend on the OS's cooperation.
It would just be harder to implement and the result a lot more flaky.

------
AdmiralAsshat
The fact that the script is open source is great, but I'd be extremely
hesitant to download something that patches my laptop's boot sequence without
a little more info and/or some comments in the code about exactly what it's
doing. Yes, I can see the sed commands, but I have zero idea what it's
actually replacing or with what.

~~~
nbsd4life
You're editing your ACPI tables, compiling the result, and telling the kernel
to use it instead of what it gets from the hardware.

------
aclave1
I planned to buy this laptop some time this year. Has lenovo stopped
supporting linux as well as they used to? I've owned two lenovo laptops and
loved them and planned to buy another. I'm also looking at dell laptops since
their linux support is reportedly excellent.

~~~
ahnick
I just switched from an MBP 2013 to a ThinkPad T480 running Ubuntu 18.04. I'm
loving it. Linux support has been really great and I didn't have to install a
lot of special drivers. (e.g. trackpad support with multi-touch scrolling
worked from the start) A lot of Dell's have that terrible bottom placement of
the webcam.

Things to love about the T480:

\- Fairly portable at around 3.5 lbs with a 14inch screen. It avoids the
dedicated numeric keypad that some larger 15inch models have, while still
having good screen real estate.

\- Great keyboard as all Thinkpads have. (media keys are working great under
linux)

\- Very durable having undergone mil-spec testing.

\- Camera placement at top with a mechanical shutter if you get the FHD
screen.

\- 32 GB of ram if you want/need it

\- Hot-swappable batteries. No need to turn off the laptop. just flip it over
and replace. (You can buy the extended 72Wh battery for extra battery time)

Bonus if you find one on eBay slightly used. You could save over a $1000 for a
comparably specced machine.

~~~
namibj
I have to second how awesome Hot-swap batteries are. While I do need to find a
socket for this, having 'just' a T540p (can recommend, nice device), being
able to swap the battery in seconds instead of charging >30 min (depending on
how large your charger is) is awesome. So if you can hot swap, get another
non-protuding battery instead of one that sticks out from the laptop, as that
makes it hard to hold it on your palm (works like a charm, and the robustness
makes you worry less). In that sense it is easier to use on-the-go than a
tablet, due to the ease of holding (just wrap your fingers around the battery,
and it will take a couple weeks to get the strength in your arm to do it
comfortably if you are not used to such loads).

------
anon1253
Trackpad also doesn’t work under Linux with the NFC model. Hardware wise the
webcam and sound are beyond horrible. The fan curves are obnoxious and it
still gets uncomfortably hot. It’s such a shame, I had high hopes for this
laptop but it’s collecting dust in a drawer. Between the sleep states, track
pad, thermal issues and throttling, poor audio visuals and battery life … the
thing really should never have had that price point.

~~~
rayiner
I've got that laptop and it's fine in Windows. Maybe the problem is Linux, not
the laptop?

~~~
olivil
I run linux, have the latest BIOS, but it is _not_ the NFC model, with the
"HDR" screen and i7-8650U. I idle around 43C and my fan is completely off
under 50ish, at which point it (very silently) ramps up. I get 8-10 hours of
battery life, and the screen is fantastic (and very very bright). However the
speakers are worst than a 200$ smartphones. No issue with the trackpad as it
is a non-NFC model.

I suggest OP revises his configuration...

------
jadar
It's interesting that this is now necessary on PC laptops to get basic things
like suspend/sleep to work. I remember having to apply DSDT patches to make
suspend, as well as other basic functionality, work on Hackintosh machines
(PCs running macOS.)

------
thinkpadboiiii
Missing S3 standby support is also causing problems with Windows. Leading to
battery draining during standby: [https://forums.lenovo.com/t5/ThinkPad-X-
Series-Laptops/X1-Ca...](https://forums.lenovo.com/t5/ThinkPad-X-Series-
Laptops/X1-Carbon-6th-Gen-Battery-drain-in-sleep/m-p/4075415)

------
jopsen
I bought the X1 6th gen, but ended up returning it for a refund due to poor
Linux support.

There is no excuse for breaking S3 suspend.

~~~
dkhenry
Did you find anything besides S3 that didn't work? I have the 6th gen X1 and
once I patched in ACPI my ubuntu install has worked perfectly.

~~~
kahlonel
Can you please tell me what the battery life is on Ubuntu (with ACPI patch) vs
Windows (with or without ACPI patch)?

~~~
dkhenry
I didn't have windows on long enough to get solid battery numbers, but on
ubuntu I get 8 hours of work use.

------
ScarZy
I have a X270 that's modernish and I'm wondering if this could suffer from the
same issue... I can't get it to suspend at all. I'm hoping the sensor is gone,
but I'm not sure how to verify that... Thinksupport have changed the mainboard
but that didn't fix it.

How to check?

------
GreaterFool
This looks like serious witchcraft. Is it safe?

I have some suspend working on X1 2018, not sure which one! Switching from Mac
is... hard. My true-wireless bluetooth earbuds don't work too well either. I
guess it's gonna take few weeks of tweaking configs to get to a decent
situation.

------
cp9
I have a 2018 X1 Carbon with Ubuntu that has perfectly supported suspend. It's
never been a problem

~~~
fiji-flo
Ubuntu only supports S0i3 (modern standby) not the normal S3 sleep. S0i3 has
some problems like peripheral not working after resume and higher battery
drain during "sleep".

------
sophistication
Can it detect the state of the lid and automatically enter suspend & wake up
based on it?

~~~
dkhenry
Once you have patched it it will. I have the X1 running ubuntu with the
patched initrd and the lid works perfectly.

------
gtirloni
Unnecessary headline editorializing. Could we have it changed to the original?

~~~
1996
If you know why S3 does not work on some brands, the editorializing is not
unwarranted.

There was an active decision to remove working parts of the code. That is
shameful.

~~~
rayiner
There is nothing wrong with throwing away obsolete code.

~~~
nixpulvis
It's not "obsolete"... S3 sleep mode uses _much_ less power.

~~~
rayiner
On a properly designed system, the S0iX sleep modes should totally subsume S3.

