[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#773976: Aggressive link power management breaks devices without sleep support



Control: retitle -1 ALPM between Intel 8 AHCI and Micron M550 causes errors

On Fri, 2014-12-26 at 15:46 +0100, Yuri D'Elia wrote:
> Package: src:linux
> Version: 3.16.7-ckt2-1
> Severity: important
> 
> I've recently switched to a laptop with an Intel 8 SATA controller (AHCI).
> 
> I was experiencing significant latency delays, which I tracked down to the
> aggressive link power management. It looks like that the SSD that came with the
> laptop (A Micron M550 by looking at the device model) doesn't support full
> device sleep:
> 
> ahci 0000:00:1f.2: port does not support device sleep

Device sleep is a optional extension to SATA and this port does not
support it; never mind whether the drive does.

Link power management is different; it's a core feature that drives must
support.  ALPM means that the AHCI performs link power management
without being directed by the driver.

> When setting the host controller to min_power (as done by laptop-mode-tools),
> the following often happens as the link is transitions back from the SLUMBER
> state:
> 
> ata1.00: exception Emask 0x0 SAct 0x4000000 SErr 0x50000 action 0x6 frozen
> ata1: SError: { PHYRdyChg CommWake }
> ata1.00: failed command: WRITE FPDMA QUEUED
> ata1.00: cmd 61/08:d0:48:7f:96/00:00:08:00:00/40 tag 26 ncq 4096 out res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> ata1.00: status: { DRDY }
> ata1: hard resetting link
> 
> It might take as long as 7 seconds for the device to become responsive again.
> This behavior eventually resulted in a corrupted EXT4 filesystem, thus I'm
> flagging this as important.
> 
> Shouldn't the driver avoid entering the lower power levels if it knows that
> there's a connected device doesn't support it?

As link power management is a core feature, by default the AHCI driver
expects devices to support it and allows you to enable ALPM.  However,
it does support blacklisting of drives that are buggy.

Can you test whether the attached patch works for you?

Ben.

-- 
Ben Hutchings
Theory and practice are closer in theory than in practice.
                                - John Levine, moderator of comp.compilers
From f6209cb41c0178fe22e859be7a3a1559cd66dd32 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 2 Jan 2015 04:55:37 +0000
Subject: [PATCH] libata: Blacklist Micron M500/M550 SSDs for LPM

References: https://bugs.debian.org/773976
Reported-by: Yuri D'Elia <wavexx@thregr.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/ata/libata-core.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e7f30b5..39834fc 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4223,11 +4223,15 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	{ "PIONEER DVD-RW  DVR-212D",	NULL,	ATA_HORKAGE_NOSETXFER },
 	{ "PIONEER DVD-RW  DVR-216D",	NULL,	ATA_HORKAGE_NOSETXFER },
 
-	/* devices that don't properly handle queued TRIM commands */
-	{ "Micron_M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Crucial_CT???M500SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Micron_M550*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
-	{ "Crucial_CT*M550SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
+	/* devices that don't properly handle queued TRIM commands or LPM */
+	{ "Micron_M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_NOLPM, },
+	{ "Crucial_CT???M500SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_NOLPM, },
+	{ "Micron_M550*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_NOLPM, },
+	{ "Crucial_CT*M550SSD*",	NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_NOLPM, },
 
 	/*
 	 * Some WD SATA-I drives spin up and down erratically when the link

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: