]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/libata-clear-ering-on-resume
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / libata-clear-ering-on-resume
CommitLineData
00e5a55c
BS
1From: Tejun Heo <tj@kernel.org>
2Subject: libata: clear ering on resume
3References: bnc#486803
4
5Error timestamps are in jiffies which doesn't run while suspended and
6PHY events during resume isn't too uncommon. When the two are
7combined, it can lead to unnecessary speed downs if the machine is
8suspended and resumed repeatedly. Clear error history on resume.
9
10This was reported and verified in bnc#486803 by Vladimir Botka.
11
12Signed-off-by: Tejun Heo <tj@kernel.org>
13Reported-by: Vladimir Botka <vbotka@novell.com>
14Signed-off-by: Tejun Heo <teheo@suse.de>
15---
16 drivers/ata/libata-eh.c | 13 +++++++++++++
17 1 file changed, 13 insertions(+)
18
19--- a/drivers/ata/libata-eh.c
20+++ b/drivers/ata/libata-eh.c
21@@ -3158,6 +3158,8 @@ static void ata_eh_handle_port_suspend(s
22 */
23 static void ata_eh_handle_port_resume(struct ata_port *ap)
24 {
25+ struct ata_link *link;
26+ struct ata_device *dev;
27 unsigned long flags;
28 int rc = 0;
29
30@@ -3172,6 +3174,17 @@ static void ata_eh_handle_port_resume(st
31
32 WARN_ON(!(ap->pflags & ATA_PFLAG_SUSPENDED));
33
34+ /*
35+ * Error timestamps are in jiffies which doesn't run while
36+ * suspended and PHY events during resume isn't too uncommon.
37+ * When the two are combined, it can lead to unnecessary speed
38+ * downs if the machine is suspended and resumed repeatedly.
39+ * Clear error history.
40+ */
41+ ata_port_for_each_link(link, ap)
42+ ata_link_for_each_dev(dev, link)
43+ ata_ering_clear(&dev->ering);
44+
45 ata_acpi_set_state(ap, PMSG_ON);
46
47 if (ap->ops->port_resume)