You are not logged in.

#26 2018-03-03 05:45:33

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,540

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

After a couple hours plugging away, no success.
I believe my new DSDT is being rejected entirely, though GPRW entries are still promising.
An S3 BIOS from Lenovo would help a massive amount, and then we could have one BIOS to support S0i3 in Windows and S3 in Linux.

Here the diffs of the X1C6 vs X1C5 and X1C6 vs T480s.
Keep in mind, we're looking for changes that are echoed across both diffs.

Has anyone tried going down the road of getting S0i3 in Linux yet, like the Tablet from the blog?

I've also notified the r/ThinkPad community.

Last edited by Ranguvar (2018-03-03 06:07:43)

Offline

#27 2018-03-03 08:53:36

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Thank you for your efforts, Ranguvar. I will closely follow the discussions and continue to do what I can to help resolving that issue. That may include annoying Lenovo as long as it takes.

If a fix doesn't emerge within a reasonable time, I see no other way than to sell my X1, sad as this may be. It's a beautiful piece of hardware.


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#28 2018-03-03 13:54:28

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

[    0.179095] ACPI: (supports S0 S3 S4 S5)
[    0.239773] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]

journalctl - after override:

Mar 03 14:28:41 cuke kernel: PM: Syncing filesystems ... done.
Mar 03 14:28:41 cuke kernel: PM: suspend entry (deep)
Mar 03 14:28:41 cuke systemd-sleep[1495]: Suspending system...
Mar 03 14:28:41 cuke systemd[1]: Starting Suspend...
Mar 03 14:28:41 cuke systemd[1]: Reached target Sleep.

Before it used to say: PM: suspend entry (s2idle)

I think I might have a working DSDT. Thanks Ranguvar for the diffs. I have zero knowledge about iASL and this was mostly a gut feeling.

Here is the patch https://gist.github.com/fiji-flo/a59746 … 946becc620

I'll try to figure out if this is really working. My machine didn't explode so far big_smile

Offline

#29 2018-03-03 16:09:24

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

The battery reports a discharge rate of 310 mW

That's what powertop reported.

∋  cat /sys/class/power_supply/BAT0/energy_now
56940000

after >1h in S3

∋ cat /sys/class/power_supply/BAT0/energy_now
56350000

Looks good.

Offline

#30 2018-03-03 16:36:41

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I can't believe it, I just went through the process and I'm writing this reply after having successfully entered and resumed from deep sleep. Still going through more extensive testing, but that looks really, really good. My system even reported 0.24 watts.

If that proves to be working without serious side-effects on the long term, tell me where to send that crate of beer fiji-flo. Thank you very much!

Last edited by esonn (2018-03-03 16:54:29)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#31 2018-03-03 16:50:30

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

This wouldn't have been possible without all of your groundwork. I just put the pieces together. Thanks y'all.

I still hope Lenovo will provide a BIOS with a toggle. I think that would be the best thing.

Offline

#32 2018-03-03 17:27:04

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,540

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

You are fantastic, fiji-flo!

I used a simplified version of your patch, with as few change as possible, and it still compiles with the February 2018 version of iasl and works great on my X1C6.

-- Note - I advise using the original patch instead, with esonn's guide: http://delta-xi.net/#056

Here is also my compiled dsdt.aml packed into a cpio archive (taken down, may have issues) - just rename it to acpi_override or whatever, place in /boot, and edit your bootloader's config to load it as an initrd before the others, like the DSDT ArchWiki article describes.

Only use this with Lenovo BIOS 1.08!


Now, if we can only get the package C-state past C3....

Last edited by Ranguvar (2018-03-04 18:09:05)

Offline

#33 2018-03-03 17:34:39

progandy
Member
Registered: 2012-05-17
Posts: 3,195

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I still hope Lenovo will provide a BIOS with a toggle. I think that would be the best thing.

Isn't that why OSI strings exist? Something like "If (_OSI ("Linux S3"))" in DSDT and then acpi_osi="Linux S3" in the kernel command line?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#34 2018-03-03 17:42:05

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I had to change /etc/default/grub too, otherwise s2idle was selected as default memory sleep:

GRUB_CMDLINE_LINUX_DEFAULT="quiet mem_sleep_default=deep"

Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#35 2018-03-03 18:01:16

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Ranguvar: Out of curiosity, I just tried your precompiled binary on my system, and the kernel threw a lot of ACPI errors and exceptions upon boot.

It doesn't affect me and maybe they are irrelevant anyway, but there may also be a possibility that users who are technically not too confident and just using a precompiled image run into troubles.

Also: is there a sane way to tell Grub to automatically include that acpi_override when running grub-mkconfig, especially when it's done  during a system upgrade? I don't want to mess around in /etc/grub.d/10_linux where actual initrd and intel-ucode is included and I'm unsure whether 40_custom is the correct place to do that, and if messing with ${initrd_extra} there is a good idea.

Edit: Should I mark this thread solved by now? Or is it too soon? wink

Last edited by esonn (2018-03-03 18:02:39)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#36 2018-03-03 18:15:41

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Thanks for the great work!

Ranguvar wrote:

Now, if we can only get the package C-state past C3....

Is this related to the S0i3 sleep or another problem?

Offline

#37 2018-03-03 19:06:49

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,540

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

esonn wrote:

Ranguvar: Out of curiosity, I just tried your precompiled binary on my system, and the kernel threw a lot of ACPI errors and exceptions upon boot.

It doesn't affect me and maybe they are irrelevant anyway, but there may also be a possibility that users who are technically not too confident and just using a precompiled image run into troubles.

Interesting, I don't have any errors.

Do you have to use boot flags to see them?

Perhaps I should take down the image in that case.

esonn wrote:

Also: is there a sane way to tell Grub to automatically include that acpi_override when running grub-mkconfig, especially when it's done  during a system upgrade? I don't want to mess around in /etc/grub.d/10_linux where actual initrd and intel-ucode is included and I'm unsure whether 40_custom is the correct place to do that, and if messing with ${initrd_extra} there is a good idea.

Not sure. I only use mkconfig to generate the initial conf, and edit that after - sue me smile

Up to you if you want to call it solved. We could still see s0i3 support in Linux or an official Lenvo BIOS ifdef'd for Linux, which would be great.

johannesg00, it's unrelated.

Offline

#38 2018-03-03 19:16:47

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Do you have to use boot flags to see them?

No flags besides mem_sleep_default. It gets printed on the console before the switch to userspace happens, and is greppable via dmesg. Maybe I'll write a quick, easily understandable howto for others on how to get the thing compiled and installed by themselves step by step without too much trouble. I've seen the first Ubuntu people recognize the problem.

Edit: quite write-up here.

Last edited by esonn (2018-03-04 11:04:22)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#39 2018-03-03 19:30:44

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

esonn wrote:

Ranguvar: Out of curiosity, I just tried your precompiled binary on my system, and the kernel threw a lot of ACPI errors and exceptions upon boot.

I think most of these errors are caused by the lines Ranguvar didn't remove in his version of my patch.

You see the errors with my original patch, too?

Offline

#40 2018-03-03 19:36:43

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

No, I don't see any error or exception with your patch. Did you specifically remove those lines by trial and error to get rid of those errors on your machine when writing the patch?

Edit: But I haven't tried Ranguvar's patch by compiling it myself, only tested his binary.

Last edited by esonn (2018-03-03 19:37:51)


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#41 2018-03-03 19:48:02

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I removed them because they threw compiler errors. From what I understand these were redundant anyway.

Offline

#42 2018-03-03 21:57:42

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Ranguvar wrote:

johannesg00, it's unrelated.

Do you have an idea what's causing the missing C states? I consider buying a X1C6 and this seems to be a show stopper, too.

edit: Do the cores enter C10? Have you tested if this problem also exists under windows? The T480s seems to work fine: https://www.reddit.com/r/thinkpad/comme … _and_linux

Last edited by johannesg00 (2018-03-03 22:13:38)

Offline

#43 2018-03-03 23:15:53

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

johannesg00: here's a snapshot of my powertop output:

          Package   |             Core    |            CPU 0       CPU 4
                    |                     | C0 active   2.3%        2.3%
                    |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C1E         0.1%    0.2 ms  1.4%    3.6 ms
C2 (pc2)   13.9%    |                     |
C3 (pc3)    0.4%    | C3 (cc3)    0.1%    | C3          0.1%    0.2 ms  0.0%    0.0 ms
C6 (pc6)    0.1%    | C6 (cc6)    4.3%    | C6          3.6%    0.6 ms  1.6%    1.8 ms
C7 (pc7)    0.0%    | C7 (cc7)   85.1%    | C7s         0.0%    0.0 ms  0.0%    0.0 ms
C8 (pc8)   24.7%    |                     | C8         40.6%    3.6 ms 44.8%    4.1 ms
C9 (pc9)    0.0%    |                     | C9          0.0%    0.0 ms  0.0%    0.0 ms
C10 (pc10)  0.0%    |                     | C10        50.8%    6.4 ms 48.5%    6.3 ms

                    |             Core    |            CPU 1       CPU 5
                    |                     | C0 active   2.1%        2.4%
                    |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C1E         0.1%    0.3 ms  0.0%    0.0 ms
                    |                     |
                    | C3 (cc3)    0.8%    | C3          0.8%    1.3 ms  0.0%    0.1 ms
                    | C6 (cc6)    4.4%    | C6          2.5%    1.1 ms  2.6%    0.9 ms
                    | C7 (cc7)   86.7%    | C7s         0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C8         40.3%    3.8 ms 39.7%    3.9 ms
                    |                     | C9          0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C10        52.6%    7.1 ms 53.9%    6.0 ms

                    |             Core    |            CPU 2       CPU 6
                    |                     | C0 active   2.0%        6.1%
                    |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C1E         0.1%    0.1 ms  0.8%    0.7 ms
                    |                     |
                    | C3 (cc3)    1.5%    | C3          1.6%    2.7 ms  0.2%    0.9 ms
                    | C6 (cc6)    2.8%    | C6          1.9%    1.2 ms  2.8%    1.5 ms
                    | C7 (cc7)   58.1%    | C7s         0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C8         45.5%    5.5 ms 15.6%    2.9 ms
                    |                     | C9          0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C10        45.1%    5.9 ms 46.4%   10.0 ms

                    |             Core    |            CPU 3       CPU 7
                    |                     | C0 active   3.4%        6.5%
                    |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C1E         0.1%    0.4 ms  0.0%    0.0 ms
                    |                     |
                    | C3 (cc3)    0.2%    | C3          0.0%    0.0 ms  0.5%    1.1 ms
                    | C6 (cc6)    0.7%    | C6          0.6%    0.3 ms  0.5%    0.8 ms
                    | C7 (cc7)   55.1%    | C7s         0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C8         18.0%    5.9 ms  6.2%    3.7 ms
                    |                     | C9          0.0%    0.0 ms  0.0%    0.0 ms
                    |                     | C10        74.6%   10.8 ms 51.2%   11.8 ms

                    |             GPU     |
                    |                     |
                    | Powered On  1.3%    |
                    | RC6        98.7%    |
                    | RC6p        0.0%    |
                    | RC6pp       0.0%    |
                    |                     |
                    |                     |
                    |                     |

Offline

#44 2018-03-03 23:30:13

PastExcitement
Member
Registered: 2018-03-01
Posts: 21

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

Not to conflate issues, but even without the fix, I don't see pc10 (or anything above pc2) on my X1C6 in Arch. That's a complete different issue, right?

Last edited by PastExcitement (2018-03-03 23:39:26)

Offline

#45 2018-03-04 00:33:52

fiji-flo
Member
From: Berlin
Registered: 2013-03-19
Posts: 15

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

PastExcitement wrote:

Not to conflate issues, but even without the fix, I don't see pc10 (or anything above pc2) on my X1C6 in Arch. That's a complete different issue, right?

Yes. Let's move this to another topic. FYI I'm on kernel 4.16rc3.

Offline

#46 2018-03-04 09:08:35

johannesg00
Member
Registered: 2010-11-30
Posts: 70

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

fiji-flo wrote:
PastExcitement wrote:

Not to conflate issues, but even without the fix, I don't see pc10 (or anything above pc2) on my X1C6 in Arch. That's a complete different issue, right?

Yes. Let's move this to another topic. FYI I'm on kernel 4.16rc3.

I opened another thread for this problem: https://bbs.archlinux.org/viewtopic.php?pid=1771825

Last edited by johannesg00 (2018-03-04 09:08:45)

Offline

#47 2018-03-04 15:40:14

similuke
Member
Registered: 2018-03-04
Posts: 2

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

esonn wrote:

Do you have to use boot flags to see them?

No flags besides mem_sleep_default. It gets printed on the console before the switch to userspace happens, and is greppable via dmesg. Maybe I'll write a quick, easily understandable howto for others on how to get the thing compiled and installed by themselves step by step without too much trouble. I've seen the first Ubuntu people recognize the problem.

Edit: quite write-up here.

firs of all thank you guys fiji-flo, Ranguvar and esonn for investigating the problem situation (S3 vs S0i3).
I just stumlbed upon the situation since I was interested in buying an X1 Carbon G6/X1 Yoga G3. having an option to buy a X1 Yoga G3 for student price I'm also looking forward to install a Linux only system (no dualboot). having a notebook change to power state S3 (aka suspend-to-ram) is a no-brainer of course.
as guided here quite write-up here and using the patch X1C6_S3_DSDT.patch I'm interested if that patch is specific to X1C6 (given the instruction only to use it on 1.08) or also usable for a X1Y3 (as in the official lenovo forums S0i3 situation is true for X1Y3 as well)? I could also modify the lines by myself if one of you could give me the relevant changes you made for the patch

Last edited by similuke (2018-03-04 15:54:00)

Offline

#48 2018-03-04 16:19:40

esonn
Member
From: Austria
Registered: 2015-10-01
Posts: 54

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I'm interested if that patch is specific to X1C6 (given the instruction only to use it on 1.08) or also usable for a X1Y3 (as in the official lenovo forums S0i3 situation is true for X1Y3 as well)? I could also modify the lines by myself if one of you could give me the relevant changes you made for the patch

According to the Lenovo driver downloads for the Yoga G3, it uses UEFI v1.07 - so for starters, that's a different version. I don't think that patch will work out of the box for the Yoga, but since no Yoga G3 owner has shown up here so far we can't say anything for sure. However, I would expect that the firmware and the patching process remains quite similar.

What my gut feeling tells me: Once you extract and decompile the Yoga DSDT table, it will probably be a rather simple task to patch it manually yourself by looking at the lines changed by fiji-flo's patch and proceeding step by step. The patch is rather small, and only the hunk containing the few insert lines at the end make the sleep magic happen - all deletes are simply for eliminating errors when re-compiling. Again, that's only a gut feeling.


Anyone who quotes me in their sig is an idiot. -- Rusty Russell

Offline

#49 2018-03-04 18:07:01

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,540

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

I also want to note here that the laptop is still quite slow to sleep, and slow to resume - if I wait, it may take five or six seconds, or I'll use the power button to wake it faster.

Is that the case for you guys, esonn and fiji-flo?

esonn, thank you for the guide, I've shared it on reddit and the Lenovo forums.

I've also posted in johannesg00's thread re: package states.

Last edited by Ranguvar (2018-03-04 18:35:45)

Offline

#50 2018-03-04 18:53:23

progandy
Member
Registered: 2012-05-17
Posts: 3,195

Re: [SOLVED] Lenovo X1C6 / X1Y3 (2018): No deep sleep (S3)?

This would be a great addition to the wiki. There is no article for Gen6 yet.
https://wiki.archlinux.org/index.php/Le … _X1_Carbon


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

Board footer

Powered by FluxBB