Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libata: clear ering on resume

Error timestamps are in jiffies which doesn't run while suspended and
PHY events during resume isn't too uncommon. When the two are
combined, it can lead to unnecessary speed downs if the machine is
suspended and resumed repeatedly. Clear error history on resume.

This was reported and verified in bnc#486803 by Vladimir Botka.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Vladimir Botka <vbotka@novell.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Tejun Heo and committed by
Jeff Garzik
6f9c1ea2 6ad58b24

+13
+13
drivers/ata/libata-eh.c
··· 3507 3507 */ 3508 3508 static void ata_eh_handle_port_resume(struct ata_port *ap) 3509 3509 { 3510 + struct ata_link *link; 3511 + struct ata_device *dev; 3510 3512 unsigned long flags; 3511 3513 int rc = 0; 3512 3514 ··· 3522 3520 spin_unlock_irqrestore(ap->lock, flags); 3523 3521 3524 3522 WARN_ON(!(ap->pflags & ATA_PFLAG_SUSPENDED)); 3523 + 3524 + /* 3525 + * Error timestamps are in jiffies which doesn't run while 3526 + * suspended and PHY events during resume isn't too uncommon. 3527 + * When the two are combined, it can lead to unnecessary speed 3528 + * downs if the machine is suspended and resumed repeatedly. 3529 + * Clear error history. 3530 + */ 3531 + ata_for_each_link(link, ap, HOST_FIRST) 3532 + ata_for_each_dev(dev, link, ALL) 3533 + ata_ering_clear(&dev->ering); 3525 3534 3526 3535 ata_acpi_set_state(ap, PMSG_ON); 3527 3536