diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-23 09:55:28 +0900 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-05-11 14:30:59 -0400 |
commit | 6f9c1ea2c1cea2de3e5670a7cd98d9f7316b0952 (patch) | |
tree | cd0059f189700e0762c55bb4488f15a5d4f61734 /drivers/ata/libata-eh.c | |
parent | 6ad58b245a543461bd55d51b8303f555419687b2 (diff) | |
download | blackbird-op-linux-6f9c1ea2c1cea2de3e5670a7cd98d9f7316b0952.tar.gz blackbird-op-linux-6f9c1ea2c1cea2de3e5670a7cd98d9f7316b0952.zip |
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>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index eb8b94016c01..94919ad03df1 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -3507,6 +3507,8 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap) */ static void ata_eh_handle_port_resume(struct ata_port *ap) { + struct ata_link *link; + struct ata_device *dev; unsigned long flags; int rc = 0; @@ -3521,6 +3523,17 @@ static void ata_eh_handle_port_resume(struct ata_port *ap) WARN_ON(!(ap->pflags & ATA_PFLAG_SUSPENDED)); + /* + * 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. + */ + ata_for_each_link(link, ap, HOST_FIRST) + ata_for_each_dev(dev, link, ALL) + ata_ering_clear(&dev->ering); + ata_acpi_set_state(ap, PMSG_ON); if (ap->ops->port_resume) |