libata: clear ering on resume
PATCH 1/1 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.
--- drivers/ata/libata-eh.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/ata/libata-eh.c +13 -0
@@ -3494,6 +3494,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 ;
@@ -3508,6 +3510,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)
Jeff Garzik
AppliedQuoted 32 lines · Tejun Heo
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 <[email protected]>Reported-by Vladimir Botka <[email protected]>--- drivers/ata/libata-eh.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/ata/libata-eh.c +4
-0@@ -3494,6 +3494,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 ;@@ -3508,6 +3510,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
drivers/ata/libata-eh.c static void ata_eh_handle_port_resume(struct ata_port *ap) · line 3524
Quoted 10 lines
drivers/ata/libata-eh.c +9
-0+* 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 );
applied