linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata_inic162x: fix a few glitches in hardreset
@ 2007-02-02  6:29 Tejun Heo
  2007-02-03 22:10 ` Bob Stewart
  2007-02-07  0:44 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2007-02-02  6:29 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

* Hardreset must not exit without actually performing reset regardless
  of link status.  We're resetting the link after all.

* Minor message update.

* 150ms delay is meaningful iff link is online after reset is
  complete.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/sata_inic162x.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index b2a6f77..fad2bd3 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -429,11 +429,6 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
 	/* hammer it into sane state */
 	inic_reset_port(port_base);
 
-	if (ata_port_offline(ap)) {
-		*class = ATA_DEV_NONE;
-		return 0;
-	}
-
 	val = readw(idma_ctl);
 	writew(val | IDMA_CTL_RST_ATA, idma_ctl);
 	readw(idma_ctl);	/* flush */
@@ -443,16 +438,17 @@ static int inic_hardreset(struct ata_port *ap, unsigned int *class)
 	rc = sata_phy_resume(ap, timing);
 	if (rc) {
 		ata_port_printk(ap, KERN_WARNING, "failed to resume "
-				"link for reset (errno=%d)\n", rc);
+				"link after reset (errno=%d)\n", rc);
 		return rc;
 	}
 
-	msleep(150);
-
 	*class = ATA_DEV_NONE;
 	if (ata_port_online(ap)) {
 		struct ata_taskfile tf;
 
+		/* wait a while before checking status */
+		msleep(150);
+
 		if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
 			ata_port_printk(ap, KERN_WARNING,
 					"device busy after hardreset\n");
-- 
1.4.4.4


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

* Re: [PATCH] sata_inic162x: fix a few glitches in hardreset
  2007-02-02  6:29 [PATCH] sata_inic162x: fix a few glitches in hardreset Tejun Heo
@ 2007-02-03 22:10 ` Bob Stewart
  2007-02-07  0:44 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Stewart @ 2007-02-03 22:10 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Aaarrgghh, So sorry.  I meant to reply to this subject, not the other
one.  It's the sata_inic162x driver that I'm getting random results
and timeouts from.

Bob


--- Tejun Heo <htejun@gmail.com> wrote:

> * Hardreset must not exit without actually performing reset regardless
>   of link status.  We're resetting the link after all.
> 
> * Minor message update.
> 
> * 150ms delay is meaningful iff link is online after reset is
>   complete.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/ata/sata_inic162x.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
> index b2a6f77..fad2bd3 100644
> --- a/drivers/ata/sata_inic162x.c
> +++ b/drivers/ata/sata_inic162x.c
> @@ -429,11 +429,6 @@ static int inic_hardreset(struct ata_port *ap, unsigned
> int *class)
>  	/* hammer it into sane state */
>  	inic_reset_port(port_base);
>  
> -	if (ata_port_offline(ap)) {
> -		*class = ATA_DEV_NONE;
> -		return 0;
> -	}
> -
>  	val = readw(idma_ctl);
>  	writew(val | IDMA_CTL_RST_ATA, idma_ctl);
>  	readw(idma_ctl);	/* flush */
> @@ -443,16 +438,17 @@ static int inic_hardreset(struct ata_port *ap, unsigned
> int *class)
>  	rc = sata_phy_resume(ap, timing);
>  	if (rc) {
>  		ata_port_printk(ap, KERN_WARNING, "failed to resume "
> -				"link for reset (errno=%d)\n", rc);
> +				"link after reset (errno=%d)\n", rc);
>  		return rc;
>  	}
>  
> -	msleep(150);
> -
>  	*class = ATA_DEV_NONE;
>  	if (ata_port_online(ap)) {
>  		struct ata_taskfile tf;
>  
> +		/* wait a while before checking status */
> +		msleep(150);
> +
>  		if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
>  			ata_port_printk(ap, KERN_WARNING,
>  					"device busy after hardreset\n");
> -- 
> 1.4.4.4
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH] sata_inic162x: fix a few glitches in hardreset
  2007-02-02  6:29 [PATCH] sata_inic162x: fix a few glitches in hardreset Tejun Heo
  2007-02-03 22:10 ` Bob Stewart
@ 2007-02-07  0:44 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-02-07  0:44 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Tejun Heo wrote:
> * Hardreset must not exit without actually performing reset regardless
>   of link status.  We're resetting the link after all.
> 
> * Minor message update.
> 
> * 150ms delay is meaningful iff link is online after reset is
>   complete.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/ata/sata_inic162x.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)

applied



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

end of thread, other threads:[~2007-02-07  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-02  6:29 [PATCH] sata_inic162x: fix a few glitches in hardreset Tejun Heo
2007-02-03 22:10 ` Bob Stewart
2007-02-07  0:44 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).