linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream 1/2] libata: kill dead code paths in reset path
@ 2008-04-07 16:25 Tejun Heo
  2008-04-07 16:46 ` [PATCH #upstream 2/2] libata: move link onlineness check out of softreset methods Tejun Heo
  2008-04-12  4:35 ` [PATCH #upstream 1/2] libata: kill dead code paths in reset path Jeff Garzik
  0 siblings, 2 replies; 21+ messages in thread
From: Tejun Heo @ 2008-04-07 16:25 UTC (permalink / raw)
  To: Jeff Garzik, Mark Lord, IDE/ATA development list

Some code paths which had been made obsolete by recent reset
simplification were still around.  Kill them.

* ata_eh_reset() checked for ATA_DEV_UNKNOWN to determine
  classification failure.  This is no longer applicable.

* ata_do_reset() should convert ATA_DEV_UNKNOWN to ATA_DEV_NONE
  regardless of reset result (e.g. -EAGAIN).

* LLDs don't need to convert ATA_DEV_UNKNOWN to ATA_DEV_NONE.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-eh.c     |   19 +------------------
 drivers/ata/sata_inic162x.c |    2 --
 drivers/ata/sata_sil24.c    |    3 ---
 3 files changed, 1 insertion(+), 23 deletions(-)

Index: work/drivers/ata/libata-eh.c
===================================================================
--- work.orig/drivers/ata/libata-eh.c
+++ work/drivers/ata/libata-eh.c
@@ -2052,15 +2052,13 @@ static int ata_do_reset(struct ata_link 
 		classes[dev->devno] = ATA_DEV_UNKNOWN;
 
 	rc = reset(link, classes, deadline);
-	if (rc)
-		return rc;
 
 	/* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
 	ata_link_for_each_dev(dev, link)
 		if (classes[dev->devno] == ATA_DEV_UNKNOWN)
 			classes[dev->devno] = ATA_DEV_NONE;
 
-	return 0;
+	return rc;
 }
 
 static int ata_eh_followup_srst_needed(struct ata_link *link,
@@ -2209,21 +2207,6 @@ int ata_eh_reset(struct ata_link *link, 
 	if (rc && rc != -EAGAIN)
 		goto fail;
 
-	/* was classification successful? */
-	if (classify && classes[0] == ATA_DEV_UNKNOWN &&
-	    !(lflags & ATA_LFLAG_ASSUME_CLASS)) {
-		if (try < max_tries) {
-			ata_link_printk(link, KERN_WARNING,
-					"classification failed\n");
-			rc = -EINVAL;
-			goto fail;
-		}
-
-		ata_link_printk(link, KERN_WARNING,
-				"classfication failed, assuming ATA\n");
-		lflags |= ATA_LFLAG_ASSUME_ATA;
-	}
-
  done:
 	ata_link_for_each_dev(dev, link) {
 		/* After the reset, the device state is PIO 0 and the
Index: work/drivers/ata/sata_inic162x.c
===================================================================
--- work.orig/drivers/ata/sata_inic162x.c
+++ work/drivers/ata/sata_inic162x.c
@@ -428,8 +428,6 @@ static int inic_hardreset(struct ata_lin
 
 		ata_sff_tf_read(ap, &tf);
 		*class = ata_dev_classify(&tf);
-		if (*class == ATA_DEV_UNKNOWN)
-			*class = ATA_DEV_NONE;
 	}
 
 	return 0;
Index: work/drivers/ata/sata_sil24.c
===================================================================
--- work.orig/drivers/ata/sata_sil24.c
+++ work/drivers/ata/sata_sil24.c
@@ -693,9 +693,6 @@ static int sil24_softreset(struct ata_li
 	sil24_read_tf(ap, 0, &tf);
 	*class = ata_dev_classify(&tf);
 
-	if (*class == ATA_DEV_UNKNOWN)
-		*class = ATA_DEV_NONE;
-
  out:
 	DPRINTK("EXIT, class=%u\n", *class);
 	return 0;

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

end of thread, other threads:[~2008-04-16 22:19 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 16:25 [PATCH #upstream 1/2] libata: kill dead code paths in reset path Tejun Heo
2008-04-07 16:46 ` [PATCH #upstream 2/2] libata: move link onlineness check out of softreset methods Tejun Heo
2008-04-12  4:35 ` [PATCH #upstream 1/2] libata: kill dead code paths in reset path Jeff Garzik
2008-04-13 16:27   ` Mark Lord
2008-04-14 20:52     ` sata_mv & pmp support Mark Lord
2008-04-15  2:01       ` Tejun Heo
2008-04-15 14:03         ` Mark Lord
2008-04-15 14:04           ` Mark Lord
     [not found]       ` <4803C850.9010901@rtr.ca>
2008-04-15  2:07         ` Tejun Heo
2008-04-15 19:59           ` Mark Lord
2008-04-15 20:14             ` Mark Lord
2008-04-15 22:36               ` Tejun Heo
2008-04-15 22:53                 ` Mark Lord
2008-04-16  2:03                   ` Mark Lord
2008-04-16  2:10                     ` Tejun Heo
2008-04-16  7:05                       ` Gwendal Grignou
2008-04-16 12:43                         ` Mark Lord
2008-04-16 12:37                       ` Mark Lord
2008-04-16 12:45                       ` Mark Lord
2008-04-16 15:41                         ` Mark Lord
2008-04-16 22:19                           ` Tejun Heo

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).