All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH #upstream] libata: clear eh_info on reset completion
@ 2009-07-17  2:58 Tejun Heo
  2009-07-17 14:32 ` Zdenek Kaspar
  2009-07-29  1:20 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2009-07-17  2:58 UTC (permalink / raw)
  To: Jeff Garzik, IDE/ATA development list, Zdenek Kaspar

Resets are done with port frozen but some controllers still issue
interrupts during reset and they may end up recording error conditions
in ehi leading to unnecessary EH retrials.

This patch makes ata_eh_reset() clear ehi on reset completion.  As
reset is the most severe recovery action, there's nothing to lose by
clearing ehi on its completion.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Zdenek Kaspar <zkaspar82@gmail.com>
---
Zdenek, I moved the clearing above a bit.  It should work the same but
can you please test this one too?

Jeff, after Zdenek's verification, please commit this to #upstream.

Thanks.

 drivers/ata/libata-eh.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index a3df9fe..924a8de 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2572,11 +2572,17 @@ int ata_eh_reset(struct ata_link *link, int classify,
 			postreset(slave, classes);
 	}

-	/* clear cached SError */
+	/*
+	 * Some controllers can't be frozen very well and may set
+	 * spuruious error conditions during reset.  Clear accumulated
+	 * error information.  As reset is the final recovery action,
+	 * nothing is lost by doing this.
+	 */
 	spin_lock_irqsave(link->ap->lock, flags);
-	link->eh_info.serror = 0;
+	memset(&link->eh_info, 0, sizeof(link->eh_info));
 	if (slave)
-		slave->eh_info.serror = 0;
+		memset(&slave->eh_info, 0, sizeof(link->eh_info));
+	ap->pflags &= ~ATA_PFLAG_EH_PENDING;
 	spin_unlock_irqrestore(link->ap->lock, flags);

 	/* Make sure onlineness and classification result correspond.

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

* Re: [PATCH #upstream] libata: clear eh_info on reset completion
  2009-07-17  2:58 [PATCH #upstream] libata: clear eh_info on reset completion Tejun Heo
@ 2009-07-17 14:32 ` Zdenek Kaspar
  2009-07-29  1:20 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Zdenek Kaspar @ 2009-07-17 14:32 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Jeff Garzik, IDE/ATA development list

Tejun Heo napsal(a):
> Resets are done with port frozen but some controllers still issue
> interrupts during reset and they may end up recording error conditions
> in ehi leading to unnecessary EH retrials.
> 
> This patch makes ata_eh_reset() clear ehi on reset completion.  As
> reset is the most severe recovery action, there's nothing to lose by
> clearing ehi on its completion.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Zdenek Kaspar <zkaspar82@gmail.com>
> ---
> Zdenek, I moved the clearing above a bit.  It should work the same but
> can you please test this one too?
> 
> Jeff, after Zdenek's verification, please commit this to #upstream.
> 
> Thanks.
> 
>  drivers/ata/libata-eh.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index a3df9fe..924a8de 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -2572,11 +2572,17 @@ int ata_eh_reset(struct ata_link *link, int classify,
>  			postreset(slave, classes);
>  	}
> 
> -	/* clear cached SError */
> +	/*
> +	 * Some controllers can't be frozen very well and may set
> +	 * spuruious error conditions during reset.  Clear accumulated
> +	 * error information.  As reset is the final recovery action,
> +	 * nothing is lost by doing this.
> +	 */
>  	spin_lock_irqsave(link->ap->lock, flags);
> -	link->eh_info.serror = 0;
> +	memset(&link->eh_info, 0, sizeof(link->eh_info));
>  	if (slave)
> -		slave->eh_info.serror = 0;
> +		memset(&slave->eh_info, 0, sizeof(link->eh_info));
> +	ap->pflags &= ~ATA_PFLAG_EH_PENDING;
>  	spin_unlock_irqrestore(link->ap->lock, flags);
> 
>  	/* Make sure onlineness and classification result correspond.

Successfully tested with ICH8 and ICH7R controllers on two different
machines with 2.6.31-rc3.

Z.

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

* Re: [PATCH #upstream] libata: clear eh_info on reset completion
  2009-07-17  2:58 [PATCH #upstream] libata: clear eh_info on reset completion Tejun Heo
  2009-07-17 14:32 ` Zdenek Kaspar
@ 2009-07-29  1:20 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-07-29  1:20 UTC (permalink / raw)
  To: Tejun Heo; +Cc: IDE/ATA development list, Zdenek Kaspar

Tejun Heo wrote:
> Resets are done with port frozen but some controllers still issue
> interrupts during reset and they may end up recording error conditions
> in ehi leading to unnecessary EH retrials.
> 
> This patch makes ata_eh_reset() clear ehi on reset completion.  As
> reset is the most severe recovery action, there's nothing to lose by
> clearing ehi on its completion.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Zdenek Kaspar <zkaspar82@gmail.com>
> ---
> Zdenek, I moved the clearing above a bit.  It should work the same but
> can you please test this one too?
> 
> Jeff, after Zdenek's verification, please commit this to #upstream.
> 
> Thanks.
> 
>  drivers/ata/libata-eh.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

applied



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

end of thread, other threads:[~2009-07-29  1:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-17  2:58 [PATCH #upstream] libata: clear eh_info on reset completion Tejun Heo
2009-07-17 14:32 ` Zdenek Kaspar
2009-07-29  1:20 ` 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.