libata: set device class to NONE if phys_offline
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
@@ -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 */
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
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
Jeff Garzik
AppliedQuoted 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.
Signed-off-by Tejun Heo <[email protected]>---
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