linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: set device class to NONE if phys_offline
@ 2008-10-21 15:31 Tejun Heo
  2008-10-22 10:23 ` Sergei Shtylyov
  2008-10-23  0:42 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Tejun Heo @ 2008-10-21 15:31 UTC (permalink / raw)
  To: Jeff Garzik, IDE/ATA development list

Reset methods don't have access to phys link status for slave links
and may incorrectly indicate device presence causing unnecessary probe
failures for unoccupied links.  This patch clears device class to NONE
during post-reset processing if phys link is offline.

As on/offliness semantics is strictly defined and used in multiple
places by the core layer, this won't change behavior for drivers which
don't use slave links.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
vt8251 incorrectly reports the same signature for unoccupied device if
the other device on the channel is present.  This patch fixes the
problem.

I integrated this patch into separate-sff-bmdma git tree.

 drivers/ata/libata-eh.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: work/drivers/ata/libata-eh.c
===================================================================
--- work.orig/drivers/ata/libata-eh.c
+++ work/drivers/ata/libata-eh.c
@@ -2455,14 +2455,14 @@ int ata_eh_reset(struct ata_link *link,
 		dev->pio_mode = XFER_PIO_0;
 		dev->flags &= ~ATA_DFLAG_SLEEPING;
 
-		if (ata_phys_link_offline(ata_dev_phys_link(dev)))
-			continue;
-
-		/* apply class override */
-		if (lflags & ATA_LFLAG_ASSUME_ATA)
-			classes[dev->devno] = ATA_DEV_ATA;
-		else if (lflags & ATA_LFLAG_ASSUME_SEMB)
-			classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
+		if (!ata_phys_link_offline(ata_dev_phys_link(dev))) {
+			/* apply class override */
+			if (lflags & ATA_LFLAG_ASSUME_ATA)
+				classes[dev->devno] = ATA_DEV_ATA;
+			else if (lflags & ATA_LFLAG_ASSUME_SEMB)
+				classes[dev->devno] = ATA_DEV_SEMB_UNSUP;
+		} else
+			classes[dev->devno] = ATA_DEV_NONE;
 	}
 
 	/* record current link speed */

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

end of thread, other threads:[~2008-10-23  3:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21 15:31 [PATCH #upstream-fixes] libata: set device class to NONE if phys_offline Tejun Heo
2008-10-22 10:23 ` Sergei Shtylyov
2008-10-23  3:01   ` Tejun Heo
2008-10-23  0:42 ` 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).