]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Tejun Heo <tj@kernel.org> |
2 | Subject: libata: clear ering on resume | |
3 | References: bnc#486803 | |
4 | ||
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. | |
9 | ||
10 | This was reported and verified in bnc#486803 by Vladimir Botka. | |
11 | ||
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> | |
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) |