Skip to contentSkip to conversation

libata: set device class to NONE if phys_offline

PATCH Applied Tejun Heo 3 participants 4 messages Oct 21, 2008 – Oct 23, 2008 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: set device class to NONE if phys_offline

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.

---
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(-)
drivers/ata/libata-eh.c +8 -8
Index: 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 */
#1 lore raw

Hello.

Quoted 7 lines · Tejun Heo

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

More grammar nitpicking: it's either on/offline or on/offlineness. :-)

MBR, Sergei

Applied
#3 lore raw
In reply to Tejun Heo
Quoted 15 lines · Tejun Heo

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.

---
vt8251 incorrectly reports the same signature for unoccupied device if the other device on the channel is present. This patch fixes the problem.

Quoted 4 lines

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

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

applied

author
#2 lore raw
In reply to Sergei Shtylyov
Quoted 4 lines · Sergei Shtylyov
Quoted 2 lines

As on/offliness semantics is strictly defined and used in multiple

More grammar nitpicking: it's either on/offline or on/offlineness. :-)

Right. I'll keep it in mind. I'm so glad that you're reviewing libata changes. Thanks. :-)

Signature · 1 line
tejun