You are not logged in.

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

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

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,826

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: 90

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: 8,201

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)

Offline

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

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

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: 8,201

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?

Offline

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

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

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: 90

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: 8,201

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.

Offline

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

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

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: 8,201

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.

Offline

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

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

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: 90

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: 16,117

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: 16,117

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: 90

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: 16,117

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 2018-07-23 17:07:50

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

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.
[mod note: Paste sight has advertisements that are NSFW: ]https://s15.postimg.cc/839ltbjm1/hugeas … l.png?dl=1  [NSFW]

Last edited by ewaller (2018-07-23 17:24:17)

Offline

#19 2018-07-23 17:26:27

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 16,117

Re: Hard drive sometimes doesn't resume from s2ram

Sorry, I cannot have that page open at work.  I will take a look this evening.  The site  you choose compliments your image with scantily clad women who apparently have difficulty attracting men hmm


Edit:  Look at your journal that is-- not the aforementioned women.  Mrs. ewaller would not approve.

Last edited by ewaller (2018-07-23 17:29:16)


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

#20 2018-07-23 17:45:14

seth
Member
Registered: 2012-09-03
Posts: 8,201

Re: Hard drive sometimes doesn't resume from s2ram

HEY! I don't get no nude chicks!
***grrrrssupidadblockersgrrrr…*** ;-)

Anyway, it seems the ATA is ACPI configured fine but the HDD and the optical drive timeout on any access.
Speaking of which: is there a disc in the optical drive?

There's also "xfce4-power-man"… does this also happen when suspending from a multi-user.target?
Do you have tlp or laptop-mode-tools or similar installed?

And now, for my y/our entertainment: scantly clad women…

Offline

#21 2018-07-23 17:53:06

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

Re: Hard drive sometimes doesn't resume from s2ram

ewaller wrote:

The site  you choose compliments your image with scantily clad women who apparently have difficulty attracting men hmm

It does?  I use ad- and script- blockers regularly, so I don't see anything.
Here's different link.
https://imagizer.imageshack.us/a/img924/8632/HdV4os.png

Edit:

seth wrote:

HEY! I don't get no nude chicks!
***grrrrssupidadblockersgrrrr…*** ;-)

Anyway, it seems the ATA is ACPI configured fine but the HDD and the optical drive timeout on any access.
Speaking of which: is there a disc in the optical drive?

There's also "xfce4-power-man"… does this also happen when suspending from a multi-user.target?
Do you have tlp or laptop-mode-tools or similar installed?

There's no disk in the optical drive.
xfce4-power-manager starts with openbox, and that's where I've set the laptop to suspend on lid close (pretty much the only way I suspend).
I have tp_smapi installed currently.

Last edited by onexused (2018-07-23 17:59:02)

Offline

#22 2018-07-25 16:12:36

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

Re: Hard drive sometimes doesn't resume from s2ram

This issue happened twice, and nothing showed up in the log file written to the sd card.  Maybe I wasn't patient enough before rebooting, but in one instance, my machine completely stopped responding except for the mouse cursor in X.
The last few lines:
time 3:

Jul 25 09:40:41 Keira systemd[1]: Reached target Sleep.
Jul 25 09:40:41 Keira systemd[1]: Starting Suspend...
Jul 25 09:40:41 Keira systemd-sleep[2991]: Suspending system...
Jul 25 09:40:41 Keira kernel: PM: suspend entry (deep)
Jul 25 09:40:41 Keira wpa_supplicant[8199]: nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jul 25 09:40:41 Keira wpa_supplicant[8199]: nl80211: Failed to set IPv6 unicast in multicast filter
Jul 25 09:40:41 Keira wpa_supplicant[8199]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0

time 2:

Jul 23 19:30:39 Keira systemd-logind[3105]: Lid closed.
Jul 23 19:30:39 Keira systemd-logind[3105]: Suspending...
Jul 23 19:30:39 Keira NetworkManager[3112]: <info>  [1532388639.5529] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jul 23 19:30:39 Keira NetworkManager[3112]: <info>  [1532388639.5532] manager: NetworkManager state is now ASLEEP
Jul 23 19:30:39 Keira NetworkManager[3112]: <info>  [1532388639.5538] device (wlan0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.2162] device (wlan0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
Jul 23 19:30:41 Keira NetworkManager[3112]: <warn>  [1532388641.2166] platform-linux: do-change-link[3]: failure changing link: failure 97 (Address family not supported by protocol)
Jul 23 19:30:41 Keira NetworkManager[3112]: <warn>  [1532388641.2167] device (wlan0): failed to enable userspace IPv6LL address handling (unspecified)
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.2169] dhcp4 (wlan0): canceled DHCP transaction
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.2169] dhcp4 (wlan0): state changed bound -> done
Jul 23 19:30:41 Keira kernel: wlan0: deauthenticating from 70:4d:7b:8d:77:e0 by local choice (Reason: 3=DEAUTH_LEAVING)
Jul 23 19:30:41 Keira wpa_supplicant[7976]: wlan0: CTRL-EVENT-DISCONNECTED bssid=70:4d:7b:8d:77:e0 reason=3 locally_generated=1
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to set IPv6 unicast in multicast filter
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to set IPv6 unicast in multicast filter
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
Jul 23 19:30:41 Keira wpa_supplicant[7976]: nl80211: Failed to set IPv6 unicast in multicast filter
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.2651] device (wlan0): set-hw-addr: set MAC address to E2:E2:55:15:B1:F6 (scanning)
Jul 23 19:30:41 Keira kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
Jul 23 19:30:41 Keira kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
Jul 23 19:30:41 Keira dbus-daemon[3107]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.2' (uid=0 pid=3112 comm="/usr/bin/NetworkManager --no-daemon ")
Jul 23 19:30:41 Keira NetworkManager[3112]: <warn>  [1532388641.7320] sup-iface[0x5627c46344e0,wlan0]: connection disconnected (reason -3)
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.7322] device (wlan0): supplicant interface state: completed -> disconnected
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.7361] device (wlan0): supplicant interface state: disconnected -> disabled
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.7362] device (wlan0): supplicant interface state: disabled -> disconnected
Jul 23 19:30:41 Keira NetworkManager[3112]: <info>  [1532388641.7365] device (wlan0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Jul 23 19:30:41 Keira systemd[1]: Starting Network Manager Script Dispatcher Service...
Jul 23 19:30:41 Keira dbus-daemon[3107]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jul 23 19:30:41 Keira systemd[1]: Started Network Manager Script Dispatcher Service.
Jul 23 19:30:41 Keira nm-dispatcher[4884]: req:1 'down' [wlan0]: new request (0 scripts)
Jul 23 19:30:41 Keira nm-dispatcher[4884]: req:1 'down' [wlan0]: completed: no scripts

time 1:

Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:41:30 2018: un-parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:42:43 2018: parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:42:44 2018: un-parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:43:31 2018: parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:43:32 2018: un-parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:59:03 2018: parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 12:59:04 2018: un-parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 13:04:16 2018: parking
Jul 23 13:08:09 Keira hdapsd(sda)[9954]: Mon Jul 23 13:04:17 2018: un-parking
Jul 23 13:08:10 Keira systemd-logind[9956]: Lid closed.
Jul 23 13:08:10 Keira systemd-logind[9956]: Suspending...

So I guess nothing is written after resuming?

Last edited by onexused (2018-07-25 16:13:45)

Offline

#23 2018-07-25 17:19:21

seth
Member
Registered: 2012-09-03
Posts: 8,201

Re: Hard drive sometimes doesn't resume from s2ram

If the disk times out on ioctls, the log cannot sync there.

Please try to remove variables, remove/blacklist tp_smapi for the moment (lsmod ensure it's not loaded) and no, you don't need that power saving daemon to S3 on lid closes. acpid and even systemd can do that just fine, see /etc/systemd/logind.conf

Offline

#24 2018-07-28 04:07:08

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

Re: Hard drive sometimes doesn't resume from s2ram

Uninstalled tp_smapi for good measure.  Uninstalled xfce4-power-manager and set up the laptop to sleep when the lid closes, via /etc/systemd/logind.conf.
However, this time I typed, "systemctl suspend" (and it did).  Later when I opened the lid, xscreensaver was running as expected, but as soon as I exited it, the screen froze and the keyboard didn't respond to switch to a different terminal.

Update: The next day (today), I suspended and resumed several times successfully by opening/closing the lid in accordance with my normal use pattern.  The most recent time I tried to suspend by closing the lid and resume by opening it, the same issue happened as above: video froze and the keyboard didn't respond.

Last edited by onexused (2018-07-29 02:09:50)

Offline

Board footer

Powered by FluxBB