Skip to content

Commit

Permalink
[PATCH] libata: fix eh_skip_recovery condition
Browse files Browse the repository at this point in the history
* (ata_dev_absent() || ata_dev_ready()) test doesn't indicate
  SUSPENDED state properly.  Fix it.

* Link resuming resets shouldn't be skipped.  Don't skip recovery on
  EHI_RESUME_LINK.  This doesn't matter for host ports as EHI_RESUME
  always coincides with EHI_HOTPLUGGED which makes attached disabled
  devices vacant.  However, PMP reset causes non-hotplug link-resuming
  resets which shouldn't be skipped.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jul 19, 2006
1 parent 4528e4d commit 7c8c2cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/scsi/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,15 +1843,16 @@ static int ata_eh_skip_recovery(struct ata_port *ap)
for (i = 0; i < ata_port_max_devices(ap); i++) {
struct ata_device *dev = &ap->device[i];

if (ata_dev_absent(dev) || ata_dev_ready(dev))
if (!(dev->flags & ATA_DFLAG_SUSPENDED))
break;
}

if (i == ata_port_max_devices(ap))
return 1;

/* always thaw frozen port and recover failed devices */
if (ap->pflags & ATA_PFLAG_FROZEN || ata_port_nr_enabled(ap))
/* thaw frozen port, resume link and recover failed devices */
if ((ap->pflags & ATA_PFLAG_FROZEN) ||
(ehc->i.flags & ATA_EHI_RESUME_LINK) || ata_port_nr_enabled(ap))
return 0;

/* skip if class codes for all vacant slots are ATA_DEV_NONE */
Expand Down

0 comments on commit 7c8c2cf

Please sign in to comment.