From: Tejun Heo Date: Tue, 21 Oct 2008 15:31:34 +0000 (+0900) Subject: libata: set device class to NONE if phys_offline X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=816ab89782ac139a8b65147cca990822bb7e8675;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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/offlineness 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7ccd0ce0e7d4..5d687d7cffae 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2455,14 +2455,14 @@ int ata_eh_reset(struct ata_link *link, int classify, 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 */