You are not logged in.

#1 2018-06-01 14:17:57

onexused
Member
Registered: 2009-10-07
Posts: 87

Hard drive sometimes doesn't resume from s2ram

I got a Lenovo Thinkpad T520 and installed Arch Linux 64-bit.  Sometimes when resuming from sleep / s2ram (closing, opening the lid), I suspect the hard drive doesn't spin back up properly as programs work until they try to access the disk, at which point they freeze.  I can't reboot properly and have to hold the power button to shut down.  An SD card inserted before s2ram can still be accessed.  The mouse cursor in X still moves around and things in RAM seem to be able to be accessed.  I cannot predict after which s2ram this will happen.  Downgrading to linux-lts (currently 4.14.44) doesn't solve this as it did for me with a previous machine: https://bbs.archlinux.org/viewtopic.php?id=222669

Edit: My systems haven't reacted to SysRq for years, so I can't use this to assist reboot.

Last edited by onexused (2018-06-01 14:21:18)

Offline

#2 2018-06-01 16:58:59

loqs
Member
Registered: 2014-03-06
Posts: 5,260

Re: Hard drive sometimes doesn't resume from s2ram

onexused wrote:

Edit: My systems haven't reacted to SysRq for years, so I can't use this to assist reboot.

Have you overriden /usr/lib/sysctl.d/50-default.conf setting kernel.sysrq=16 which only allows sync?

Offline

#3 2018-06-01 22:04:44

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

loqs wrote:
onexused wrote:

Edit: My systems haven't reacted to SysRq for years, so I can't use this to assist reboot.

Have you overriden /usr/lib/sysctl.d/50-default.conf setting kernel.sysrq=16 which only allows sync?

I have now.
Of course, the freezing issue still stands.

Offline

#4 2018-06-02 07:55:01

seth
Member
Registered: 2012-09-03
Posts: 7,637

Re: Hard drive sometimes doesn't resume from s2ram

Did you look at the dmesg tail (more than ten lines, though) on such incident? Might reveal an error response or whether the disk showed up at all.
You could also try to make hdparm talk to the disk (eg. -z) to see whether that works. (best call hdparm before the S3 and copy it to some tmpfs - otherwise you won't be able to call it on a flawed resume)

Online

#5 2018-06-06 16:39:55

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

Though this has happened twice since your post, I haven't been able to find anything out.  I haven't yet been able to call dmesg after the freeze because every terminal emulator has been in use (and if I close a program, I don't get the prompt/shell).  hdparm -z tells me "BLKRRPART failed: Device or resource busy".  Obviously, journalctl isn't useful because nothing's written to disk after a resume where this happens.

I'll pull up a terminal emulator that just sits there unused and wait for the issue to happen again.

Offline

#6 2018-06-06 18:28:28

seth
Member
Registered: 2012-09-03
Posts: 7,637

Re: Hard drive sometimes doesn't resume from s2ram

You can just run "dmesg -w" in an xterm. But you'll likely just get ioctl errors because the drive doesn't respond.
Does this only happen on battery or also on PSU?

Online

#7 2018-06-07 23:54:37

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

seth wrote:

You can just run "dmesg -w" in an xterm. But you'll likely just get ioctl errors because the drive doesn't respond.

That as well as `journalctl -f` are running, waiting for a problem.

seth wrote:

Does this only happen on battery or also on PSU?

I haven't noticed.  I'll pay attention next time.

Offline

#8 2018-06-11 15:49:03

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

During the normal course of use, I've suspended it several times while plugged in, and several while on battery.  Twice it froze when suspended while on battery, but never while plugged in.

Offline

#9 2018-06-11 20:45:41

seth
Member
Registered: 2012-09-03
Posts: 7,637

Re: Hard drive sometimes doesn't resume from s2ram

Assuming the pattern holds, check whether the battery produces enough voltage by comparing

cat /sys/class/power_supply/BAT1/voltage_now

Also compare the charge_full and charge_full_design on whether the battery has aged a lot.

Online

#10 2018-06-12 15:48:47

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

full - 61100000
full_design - 84240000
voltage_now (100%) - 12383000
voltage_now (5%) - 10772000
(battery's label says 11.1v)

Offline

#11 2018-06-12 15:59:49

seth
Member
Registered: 2012-09-03
Posts: 7,637

Re: Hard drive sometimes doesn't resume from s2ram

So on low charge, the battery is undervoltaged and that might be too low to spin up the drive.
=> The interesting question is whether the low charge correlates to the low voltage correlates to the spin up failure.

Online

#12 2018-06-24 19:14:37

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

Low voltage correlates to low charge, at least in alkaline batteries, judging by how I was taught to test them with a multimeter.  However, the battery reports 10.189 (?) volts now at 41%, and reported 10.772 earlier at 5%.
After 12 days, I haven't been able to get the sleep/resume to fail while the laptop is plugged in, but it's not always possible to keep it plugged in while sleeping, so I don't consider this a good workaround.
I perhaps should make a point of sleeping and resuming the laptop more often to collect data.

Offline

#13 2018-07-21 14:17:08

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

Well, this problem has also happened with the battery reporting 85% charge.  It still has never happened when the AC power is plugged in from before s2ram until after resume, but it does happen sometimes if the AC power is unplugged while the laptop is asleep.
This is frustrating.  The battery I'm using is supposed to be just over a year old (supposedly new when I got it) and I haven't used it that heavily.

Offline

#14 2018-07-21 15:50:33

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 15,940

Re: Hard drive sometimes doesn't resume from s2ram

A couple comments.  First, the discharge curve of a li-ion battery is fairly flat.  It is difficult to determine state of charge based upon the terminal voltage.  That voltage is also a strong function of battery temperature; as voltage is a weak function of  SOC and a fairly strong function of temperature and a strong function of dynamic load, it becomes difficult to figure out what you are actually measuring by looking at the terminal voltage.

Second, nothing in a laptop runs off of 11V.  Everything runs off of switch mode power supplies[1]; and these supplies are very good at efficiently supplying the requisite 5V, 3.3V, 1.8V, 1.2V and other core voltages.  These switchers typically have a broad input voltage range, so I doubt that a low battery voltage is going to cause issues for a well designed supply.  Li-ion batteries tend to fall off a cliff at the end of their discharge curve at which point the voltage plunges dangerously.  At this point, it is imperative to stop discharging the batteries as they will reach a point of no return from which they cannot be recharged.  Most Li-Ion batteries have internal protection to prevent over discharge.  The point being, the switch mode supplies will generally operate just fine all the way down to where the batteries go into self protection mode.

As a side note, SOC in most "smart batteries", i.e. batteries that communicate over the SMBus (as yours seems to do) use Coulomb counters to literally track the current (dQ/dt)  into and out of the battery and integrate it WRT time Integrate ((dQ/Dt))dt) to get Q (charge).

tl;dr -- I do not think your issue is caused by a weak battery.  Not to argue the battery is not wearing out.

[1] There may well be some linear supplies in the system, but these are typically of the LDO (Low Drop Out) variety, and are used to generate core voltages such as 1.8V from a 3.3V rail.  But, in there cases, the 3.3V is still being stepped down from the 11V.  Nothing in system is going to use dissipative mode linear supplies for more than a volt or two drop.

Last edited by ewaller (2018-07-21 16:12:08)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#15 2018-07-21 16:10:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 15,940

Re: Hard drive sometimes doesn't resume from s2ram

onexused wrote:

My systems haven't reacted to SysRq for years, so I can't use this to assist reboot.

You have to enable it https://wiki.archlinux.org/index.php/Ke … uts#Kernel

What controller is being used by this disk?  What is the interface?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#16 2018-07-21 16:50:21

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

ewaller wrote:

[...] tl;dr -- I do not think your issue is caused by a weak battery.  Not to argue the battery is not wearing out. [...]

Thanks for a knowledgable answer.

ewaller wrote:

What controller is being used by this disk?  What is the interface?

00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port Mobile SATA AHCI Controller (rev 04)
        Subsystem: Lenovo ThinkPad T520
        Kernel driver in use: ahci
        Kernel modules: ahci

I'm not sure whether this answers your question.

Offline

#17 2018-07-21 18:45:15

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 15,940

Re: Hard drive sometimes doesn't resume from s2ram

It does.  It is a SATA drive running off of a well supported chipset.  I was checking that we were not dealing with USB drives that might be re-enumerating on wake up; does not seem to be the case.

At this point, I think the best thing is to wait for the failure to occur and see what is on the terminals showing the log tails.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#18 Today 17:07:50

onexused
Member
Registered: 2009-10-07
Posts: 87

Re: Hard drive sometimes doesn't resume from s2ram

Here are blurry photos of what appeared in journalctl.  I have running now `journalctl -f` writing to an inserted sdcard for next time.
https://s15.postimg.cc/839ltbjm1/hugeas … l.png?dl=1

Offline

Board footer

Powered by FluxBB