From b558edddb1c42c70a30cfe494984d4be409f7b2b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 24 Jan 2008 00:05:14 +0900 Subject: libata: kill ata_ehi_schedule_probe() ata_ehi_schedule_probe() was created to hide details of link-resuming reset magic. Now that all the softreset workarounds are gone, scheduling probe is very simple - set probe_mask and request RESET. Kill ata_ehi_schedule_probe() and open code it. This also increases consistency as ata_ehi_schedule_probe() couldn't cover individual device probings so they were open-coded even when the helper existed. While at it, define ATA_ALL_DEVICES as mask of all possible devices on a link and always use it when requesting probe on link level for simplicity and consistency. Setting extra bits in the probe_mask doesn't hurt anybody. Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 3 +-- drivers/ata/libata-eh.c | 2 +- drivers/ata/libata-pmp.c | 12 ++++++++---- drivers/ata/libata-scsi.c | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'drivers/ata') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index baef749ec52..4dc429fd005 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -7156,8 +7156,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) /* kick EH for boot probing */ spin_lock_irqsave(ap->lock, flags); - ehi->probe_mask = - (1 << ata_link_max_devices(&ap->link)) - 1; + ehi->probe_mask |= ATA_ALL_DEVICES; ehi->action |= ATA_EH_RESET; ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index e6584fa7f45..0d0a2c0ab9e 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1746,7 +1746,7 @@ static void ata_eh_link_autopsy(struct ata_link *link) ata_eh_analyze_serror(link); } else if (rc != -EOPNOTSUPP) { /* SError read failed, force reset and probing */ - ata_ehi_schedule_probe(&ehc->i); + ehc->i.probe_mask |= ATA_ALL_DEVICES; ehc->i.action |= ATA_EH_RESET; ehc->i.err_mask |= AC_ERR_OTHER; } diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index df1d3252b9e..39e036c8a2b 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c @@ -435,7 +435,7 @@ static int sata_pmp_init_links(struct ata_port *ap, int nr_ports) struct ata_eh_context *ehc = &link->eh_context; link->flags = 0; - ehc->i.probe_mask |= 1; + ehc->i.probe_mask |= ATA_ALL_DEVICES; ehc->i.action |= ATA_EH_RESET; } @@ -831,8 +831,12 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap, ata_eh_thaw_port(ap); /* PMP is reset, SErrors cannot be trusted, scan all */ - ata_port_for_each_link(tlink, ap) - ata_ehi_schedule_probe(&tlink->eh_context.i); + ata_port_for_each_link(tlink, ap) { + struct ata_eh_context *ehc = &tlink->eh_context; + + ehc->i.probe_mask |= ATA_ALL_DEVICES; + ehc->i.action |= ATA_EH_RESET; + } } /* If revalidation is requested, revalidate and reconfigure; @@ -847,7 +851,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap, tries--; if (rc == -ENODEV) { - ehc->i.probe_mask |= 1; + ehc->i.probe_mask |= ATA_ALL_DEVICES; detach = 1; /* give it just two more chances */ tries = min(tries, 2); diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index caffca7dd76..798ba5e4571 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3507,7 +3507,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, ata_port_for_each_link(link, ap) { struct ata_eh_info *ehi = &link->eh_info; - ehi->probe_mask |= (1 << ata_link_max_devices(link)) - 1; + ehi->probe_mask |= ATA_ALL_DEVICES; ehi->action |= ATA_EH_RESET; } } else { -- cgit v1.2.3