From fa0774a56f82106fdcb2dbd939741221c2bd65ce Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 23 Apr 2009 09:55:28 +0900 Subject: [PATCH] --- yaml --- r: 144847 b: refs/heads/master c: 6f9c1ea2c1cea2de3e5670a7cd98d9f7316b0952 h: refs/heads/master i: 144845: 288e04ff8bbc6a9fd6454d71bd478cbd030ff40a 144843: 35fef43540a8959e3e331df7a4a80b7fabeeb746 144839: 5d636aae2b8140f12eb43b2776c05b22506ecf90 144831: ddaa80ffb98c26b20edeb51bdada5cbbbb158b87 v: v3 --- [refs] | 2 +- trunk/drivers/ata/libata-eh.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3a9e067305d6..f284b2be67e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6ad58b245a543461bd55d51b8303f555419687b2 +refs/heads/master: 6f9c1ea2c1cea2de3e5670a7cd98d9f7316b0952 diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index eb8b94016c01..94919ad03df1 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/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)