All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: clear ering on resume
@ 2009-04-23  0:55 Tejun Heo
  2009-05-11 18:34 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2009-04-23  0:55 UTC (permalink / raw)
  To: Jeff Garzik, IDE/ATA development list, vbotka

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 <tj@kernel.org>
Reported-by: Vladimir Botka <vbotka@novell.com>
---
 drivers/ata/libata-eh.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 0183131..ff0f496 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH #upstream-fixes] libata: clear ering on resume
  2009-04-23  0:55 [PATCH #upstream-fixes] libata: clear ering on resume Tejun Heo
@ 2009-05-11 18:34 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2009-05-11 18:34 UTC (permalink / raw)
  To: Tejun Heo; +Cc: IDE/ATA development list, vbotka

Tejun Heo wrote:
> 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 <tj@kernel.org>
> Reported-by: Vladimir Botka <vbotka@novell.com>
> ---
>  drivers/ata/libata-eh.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 0183131..ff0f496 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -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);

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-11 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23  0:55 [PATCH #upstream-fixes] libata: clear ering on resume Tejun Heo
2009-05-11 18:34 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.