1 From: Tejun Heo <tj@kernel.org>
2 Subject: libata: clear ering on resume
5 Error timestamps are in jiffies which doesn't run while suspended and
6 PHY events during resume isn't too uncommon. When the two are
7 combined, it can lead to unnecessary speed downs if the machine is
8 suspended and resumed repeatedly. Clear error history on resume.
10 This was reported and verified in bnc#486803 by Vladimir Botka.
12 Signed-off-by: Tejun Heo <tj@kernel.org>
13 Reported-by: Vladimir Botka <vbotka@novell.com>
14 Signed-off-by: Tejun Heo <teheo@suse.de>
16 drivers/ata/libata-eh.c | 13 +++++++++++++
17 1 file changed, 13 insertions(+)
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
23 static void ata_eh_handle_port_resume(struct ata_port *ap)
25 + struct ata_link *link;
26 + struct ata_device *dev;
30 @@ -3172,6 +3174,17 @@ static void ata_eh_handle_port_resume(st
32 WARN_ON(!(ap->pflags & ATA_PFLAG_SUSPENDED));
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.
41 + ata_port_for_each_link(link, ap)
42 + ata_link_for_each_dev(dev, link)
43 + ata_ering_clear(&dev->ering);
45 ata_acpi_set_state(ap, PMSG_ON);
47 if (ap->ops->port_resume)