Getting the ADATA SP600 to Work with ALPM

[Update 09/02/17: This guide is for the M.2 version of the SP600not the 2.5″ SATA version, which has firmware updates available and might not encounter this problem]

When I upgraded my C720’s SSD, I unexpectedly started running into weird errors that would hang the system. Checking the system logs provided little insight, beyond showing non-ASCII characters littering the timestamps just before the crash. Hmmn!

Eventually, I was able to confirm the hangs only occurred when on battery. I was able to reproduce the error when hanging around in TTY1, which meant I could view the kernel errors not going to log. I got the following:

ata1: COMRESET failed (errno=-16)

The disk connection was dropping entirely, which explained why nothing was in the logs beyond garbage data. Double-checking the drive’s SMART health was equally revealing:

9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 8
10 Unknown_SSD_Attribute 0x0013 100 100 050 Pre-fail Always - 0
12 Power_Cycle_Count 0x0012 100 100 000 Old_age Always - 4153

Only 8 power-on hours, but thousands of power cycles? At this point I had been running the computer for many days, so uptime alone was definitely higher than 8 hours. This indicated that the drive was throttling off when in powersave mode. Perhaps the default mode was too severe?

I run TLP which is a modern replacement for laptop-mode-tools, which luck has it, has SATA Aggressive Link Power Management (ALPM) set to maximum power savings by default. Editing /etc/default/tlp and replacing

# SATA aggressive link power management (ALPM):
# min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=max_performance
SATA_LINKPWR_ON_BAT=min_power

with

# SATA aggressive link power management (ALPM):
# min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=max_performance
SATA_LINKPWR_ON_BAT=medium_power

was all that was needed to disable the most aggressive powersave modes. Since the fix, no more crashes have occurred. The SMART power_on_hours attribute is also now closely tracking the actual uptime, and the number of power cycles is not increasing as quickly.

Leave a Reply

Your email address will not be published. Required fields are marked *