Welcome to our peer-to-peer forums, where owners help owners. Need help now? Visit eSupport here.

English Community

Linux Operating SystemsOther Linux Discussions
All Forum Topics
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 731 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 2:32 AM

Right, thanks for helping me confirm that.

Reply
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 732 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 2:56 AM

@ osnix wrote:

@ JJGadgets wrote:

S0ix on Xanmod Cacule 5.13.4 seems to sleep and resume properly, except even with the boot command line flags, it seems to take 5 seconds to resume.

 

 

Check dmesg, please. Most probably the SSD in WWAN slot doing something odd.

Even the *supported* NVME slot has those problems, Linux is just adding workarounds to fix up.

Also even with workarounds we still need iommu=pt to avoid VI fault in the device.

So, I have some very weird results. 

 

1. I drained from 58% (29.72Whr, or 29720000 from energy_now) to 39% (20.12Whr, or 20120000 from energy_now) over 6 hours of sleep (I can't fall back asleep either, help)

2. I checked rsyslogd (Void Linux doesn't use systemd, thus no journalctl), only potential error I saw was AMD-Vi.

3. I checked dmesg, no issues with both NVMe's, again only potential error I saw was AMD-Vi.

 

My Grub has iommu=pt and the other flags, and as far as I know the patches were applied successfully (else xbps-src would complain and error out the compile).

 

Looks like I'll have to dig further into this when I have the time. I have a few potential suspects right now:

 

1. BIOS needs to be 1.34?

2. Either the fact that I use Xanmod, or the patch didn't build properly, broke it? I'm supposed to use the 5.13.4 all-in-one patch right?

3. Void Linux doesn't use systemd, but to install GNOME I need to install a component of systemd called elogind. On Void Linux, acpid & elogind would conflict if both are installed and enabled, according to the Void docs. Maybe one or the other isn't putting my laptop to S0ix sleep properly? Not sure how it works, just throwing it out there as a potential variable.

4. AMD-Vi

 

I do have to say, this is kinda fun for me, even if it's totally illogical that one would have to manually compile a kernel just to get their laptop to sleep soundly without a power draining demon haunting it.

 

Also, would you like the dmesg & rsyslogd logs?

Reply
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 733 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 3:12 AM

Or, 5. I could be an idiot at 4am and forget to run update-grub, heh. Whoops, another test I guess.

Reply
Options

389 Posts

03-06-2021

Germany

219 Signins

2345 Page Views

  • Posts: 389
  • Registered: ‎03-06-2021
  • Location: Germany
  • Views: 2345
  • Message 734 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 3:22 AM

@ JJGadgets wrote:

@ osnix wrote:

@ JJGadgets wrote:

S0ix on Xanmod Cacule 5.13.4 seems to sleep and resume properly, except even with the boot command line flags, it seems to take 5 seconds to resume.

 

 

Check dmesg, please. Most probably the SSD in WWAN slot doing something odd.

Even the *supported* NVME slot has those problems, Linux is just adding workarounds to fix up.

Also even with workarounds we still need iommu=pt to avoid VI fault in the device.

So, I have some very weird results. 

 

1. I drained from 58% (29.72Whr, or 29720000 from energy_now) to 39% (20.12Whr, or 20120000 from energy_now) over 6 hours of sleep (I can't fall back asleep either, help)

 

 

Without to-do any exact math this should be >1.5W/h, are you sure BIOS is set to Windoze10 ? :)

Maybe you have to disconnect your battery once, my P14s was @ 1.86W/h in S3 before I did that ;).

 

Well.. now about cat JJGadgets  >/dev/bed ?:)

 

 

2. I checked rsyslogd (Void Linux doesn't use systemd, thus no journalctl), only potential error I saw was AMD-Vi.

3. I checked dmesg, no issues with both NVMe's, again only potential error I saw was AMD-Vi.

 

 

Yes, AMD-Vi faults on the nvme controller..

 

 

My Grub has iommu=pt and the other flags, and as far as I know the patches were applied successfully (else xbps-src would complain and error out the compile).

 

Looks like I'll have to dig further into this when I have the time. I have a few potential suspects right now:

 

1. BIOS needs to be 1.34?

 

No, but <1.30 has the weird TSC bug too and makes a hell of wakeups in either mode+ you run Linux with an unstable clock.

While >1.30 fixed the one bug they introduced another one :P is why you need tsc=nowatchdog. 

 

2. Either the fact that I use Xanmod, or the patch didn't build properly, broke it? I'm supposed to use the 5.13.4 all-in-one patch right?

 

 

Point me to that Xanmod patchset, please. And yes all in one patch is fine for 5.13.

 

3. Void Linux doesn't use systemd, but to install GNOME I need to install a component of systemd called elogind. On Void Linux, acpid & elogind would conflict if both are installed and enabled, according to the Void docs. Maybe one or the other isn't putting my laptop to S0ix sleep properly? Not sure how it works, just throwing it out there as a potential variable.

 

 

You can check that.. Just do:

 

sudo cat /sys/kernel/debug/amd_pmc/smu_fw_info

sudo cat /sys/kernel/debug/amd_pmc/s0ix_stats

 

 

4. AMD-Vi

 

 

That's only the long wakeup, bc the fault, should not make a difference in drain numbers.

 

 

I do have to say, this is kinda fun for me, even if it's totally illogical that one would have to manually compile a kernel just to get their laptop to sleep soundly without a power draining demon haunting it.

 

Also, would you like the dmesg & rsyslogd logs?

 

dmesg please.

Reply
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 735 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 3:38 AM
I'll update you once I complete this 2nd test (~30 mins in), this time I actually remembered to update Grub and I also checked BIOS was on S0ix sleep mode (it was), and then I disconnected the battery, waited 5 seconds, and reconnected the charger to re-engage the battery. dmesg & other troubleshooting after this test.
Reply
Options

21 Posts

11-17-2013

Toronto

24 Signins

105 Page Views

  • Posts: 21
  • Registered: ‎11-17-2013
  • Location: Toronto
  • Views: 105
  • Message 736 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 4:46 AM

@ osnix wrote:

@ joni1101 wrote:

 

Updates: T14s with Ryzen 7 Pro 4750U 

 

BIOS 1.34 / USB always ON (disabled) 

Ubuntu Mate 21.04 kernel 5.11.0-25-generic / 32 MB Ram

NVMe SKHynix HFS512GD9TNI-L2B0B  / no fingerprint reader / no smartcard / yes WWAN  (Fibocom 850)

 

In 21.66 hours of S3 sleep spent 0.4W per hour

 

This is acceptable. Improved over BIOS 1.30. 

 

Once patches S0 patches trickle down to stable kernel I will update S0 results on T14s

 

----------------

 

With respect to POWER OFF consumption. Still not tested. But with BIOS 1.30 after a couple of days of computer being powered off the battery was completely dead. 

 

 

One interesting note. People with the WWAN slot populated seem to see less drain in general.

 

What revision is this T14s?

 

 

It's a gen 1

Reply
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 737 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-30, 5:39 AM

I went to livestream the kernel compile because why not, and so I caught the patch being applied on the output (it was too far for me to scrollback when the compile finished), so it seems like the patch applied successfully on 5.13.4-xanmod1-cacule.

 

Xanmod is available at https://xanmod.org.

 

My dmesg is available at https://pastebin.com/VWFVGcVd.

 

If you want I could try to upgrade my BIOS to 1.34, given that I have confirmation that NVMe SSDs in WWAN still work on 1.34?

 

Latest test with Grub updated with the command line flags, and after disconnecting battery, still did 29.25Whr to 27.94Whr in 1 hour 11 mins, so that's still around (29.25-27.94)/(1+(11/60)) = 1.107W/hour. Improvement I guess but not below 1W and certainly nowhere even near 0.5W. Instead of shutting the lid I followed the S0ix post on Intel's blog and ran the following to put it to sleep (I'm trying to make sure acpid/elogind don't interfere yet): 

date && cat /sys/class/power_supply/BAT0/energy_now && echo 1 | sudo tee /sys/power/pm_debug_messages && echo s2idle | sudo tee /sys/power/mem_sleep && echo mem | sudo tee /sys/power/state

It prints a time for reference, prints current battery capacity before sleep, enables PM debug (in dmesg I think?), forces s2idle (seems like it was already set to that but hey no harm), and then puts the system to sleep. I also ran this with the Starship prompt, so I got the exact time that the computer spent sleeping, 1h11m30s.

 

Lastly, weirdly enough I checked /boot/config and it showed CONFIG_AMD_PMC=y, but somehow I don't have the kernel debug sysfs files that you asked me to cat. Any potential ideas on why? In fact my entire /sys/kernel/debug folder is blank, even when checking with ls -Alh which should show all hidden files.

Reply
Options

23 Posts

03-01-2021

Singapore

19 Signins

115 Page Views

  • Posts: 23
  • Registered: ‎03-01-2021
  • Location: Singapore
  • Views: 115
  • Message 738 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-07-31, 20:51 PM

Quick update only on the missing /sys/kernel/debug: Void Linux (or me, not sure) doesn't have debugfs mounted by default, I mounted it manually and then added it to my fstab to make it persistent. Haven't done much sleeping, both me and my laptop, due to school projects.

Reply
Options

61 Posts

12-04-2020

Portugal

64 Signins

360 Page Views

  • Posts: 61
  • Registered: ‎12-04-2020
  • Location: Portugal
  • Views: 360
  • Message 739 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-08-01, 9:34 AM

Hello all,

Made a few runs with different setups for comparison...and at this point (at least for me ) I am not seeing any advantages on running S0ix against S3.

See the results and PLEASE share your thoughts.

 

P14S Gen 1 AMD 32GB Ram 1Tb SSD with LGC battery


Pop!_os 21.04 Kernel 5.14 RC3 Mainline Ubuntu

 

NOTE: All attempts made with USB always ON=OFF

 

1ST ATTEMPT WITH TLP ON S0IX

 

jul 29 07:54:01 pop-os systemd-sleep[6846]: Suspend duration: 10h 10m.
jul 29 07:54:01 pop-os systemd-sleep[6817]: Discharge rate: .42777 W/h.

 

2ND ATTEMPT NO TLP ON SOIX

 

jul 29 22:03:15 pop-os systemd-sleep[30081]: Suspend duration: 09h 44m.
jul 29 22:03:15 pop-os systemd-sleep[30050]: Discharge rate: .42771 W/h.
jul 29 22:03:15 pop-os systemd-sleep[30058]: Error: TLP power save is disabled. Set TLP_ENABLE=1 in /etc/tlp.conf.

 

3RD ATTEMPT NO TLP AND POWERTOP with WOL=OFF ON S0IX

 

0 18:51:24 pop-os systemd-sleep[8171]: Suspend duration: 02h 00m.
jul 30 18:51:24 pop-os systemd-sleep[8140]: Discharge rate: .43476 W/h.
jul 30 18:51:24 pop-os systemd-sleep[8146]: Error: TLP power save is disabled. Set TLP_ENABLE=1 in /etc/tlp.conf.

 

4th ATTEMPT SLIMBOOK BATTERY APP  (USES TLP TWEAKED) SETTINGS TO ECONOMY MODE ON S0IX

 

jul 31 13:58:44 pop-os systemd-sleep[7552]: Suspend duration: 02h 17m.
jul 31 13:58:44 pop-os systemd-sleep[7523]: Discharge rate: .43510 W/h.

 

5TH ATTEMPT WITH SLIMBOOK BATTERY APP (USES TLP TWEAKED)  SETTINGS TO ECONOMY ON S3 !!!

 

jul 31 16:05:40 pop-os systemd-sleep[6642]: Suspend duration: 02h 01m.
jul 31 16:05:40 pop-os systemd-sleep[6313]: System resumed.
jul 31 16:05:40 pop-os systemd-sleep[6602]: Discharge rate: .42075 W/h.


6TH ATTEMPT (LONG RUN)  WITH SLIMBOOK BATTERY APP SETTINGS TO ECONOMY ON S3 

 

ago 01 09:36:20 pop-os systemd-sleep[7970]: Suspend duration: 12h 26m.
ago 01 09:36:20 pop-os systemd-sleep[7931]: Discharge rate: .42112 W/h.

 

 

 

Reply
Options

389 Posts

03-06-2021

Germany

219 Signins

2345 Page Views

  • Posts: 389
  • Registered: ‎03-06-2021
  • Location: Germany
  • Views: 2345
  • Message 740 of 841

Re:T14 AMD battery drain in standby (Linux)

2021-08-01, 10:01 AM

@linuxmad ,

 

no idea tbh. I don't get to <0.6 on S3, it happened once after I disconnected the bat the first time.

 

I'm now on vacation for a week, but S0ix has different numbers here even with DASH & TSME ON it stays

below <0.4 W/h..

 

```

Jul 28 11:43:34 ThinkPad-P14s systemd-sleep[2232]: Suspend duration: 07h 23m.
Jul 28 11:43:34 ThinkPad-P14s systemd-sleep[2232]: Discharge rate: .31796 W/h.

 

Jul 29 11:22:14 ThinkPad-P14s systemd-sleep[2054]: Suspend duration: 10h 02m.
Jul 29 11:22:14 ThinkPad-P14s systemd-sleep[2054]: Discharge rate: .31543 W/h.

 

 

Jul 29 15:07:33 ThinkPad-P14s systemd-sleep[2286]: Suspend duration: 03h 41m.
Jul 29 15:07:33 ThinkPad-P14s systemd-sleep[2286]: Discharge rate: .31453 W/h.

 

Jul 30 22:58:56 ThinkPad-P14s systemd-sleep[1863]: Suspend duration: 02h 55m.
Jul 30 22:58:56 ThinkPad-P14s systemd-sleep[1863]: Discharge rate: .32890 W/h.

 

Jul 31 02:35:44 ThinkPad-P14s systemd-sleep[2175]: Suspend duration: 03h 34m.
Jul 31 02:35:44 ThinkPad-P14s systemd-sleep[2175]: Discharge rate: .32458 W/h.

 

and so on.. 

 

```

 

Then I have one I didn't say a word till now bc I cannot reproduce that at all again. 

I wanted to try reproducing when I'm back, but let me post you that too:

 

```

 

Jul 28 13:11:34 ThinkPad-P14s systemd-sleep[3078]: Suspend duration: 01h 03m.
Jul 28 13:11:34 ThinkPad-P14s systemd-sleep[3078]: Discharge rate: .15797 W/h.  <---- No changes here on the setup, no IDEA right now

 

```

 

S3 is always around 0.61+ W/h here.

 

 

 

 

 

Reply
Forum Home

Community Guidelines

Please review our Guidelines before posting.

Learn More

Check out current deals!

Go Shop
X

Save

X

Delete

X

No, I don’t want to share ideas Yes, I agree to these terms