diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-11-18 03:01:38 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-29 22:15:07 +0100 |
commit | 687833a03baae8308900486fa6499ef955fd07a9 (patch) | |
tree | 76da700de1674f42978b58b35dede2b577a6f901 /drivers/scsi/isci/port.c | |
parent | [SCSI] isci: stop interpreting ->lldd_lu_reset() as an ata soft-reset (diff) | |
download | linux-687833a03baae8308900486fa6499ef955fd07a9.tar.xz linux-687833a03baae8308900486fa6499ef955fd07a9.zip |
[SCSI] isci: ->lldd_ata_check_ready handler
Report to libata whether the link to the given domain_device is up and the
signature fis has been received.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/isci/port.c')
-rw-r--r-- | drivers/scsi/isci/port.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index e55ef65f5212..c5ae94dbef48 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c @@ -1675,6 +1675,31 @@ int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *ipor return ret; } +int isci_ata_check_ready(struct domain_device *dev) +{ + struct isci_port *iport = dev->port->lldd_port; + struct isci_host *ihost = dev_to_ihost(dev); + struct isci_remote_device *idev; + unsigned long flags; + int rc = 0; + + spin_lock_irqsave(&ihost->scic_lock, flags); + idev = isci_lookup_device(dev); + spin_unlock_irqrestore(&ihost->scic_lock, flags); + + if (!idev) + goto out; + + if (test_bit(IPORT_RESET_PENDING, &iport->state)) + goto out; + + rc = !!iport->active_phy_mask; + out: + isci_put_device(idev); + + return rc; +} + void isci_port_deformed(struct asd_sas_phy *phy) { struct isci_host *ihost = phy->ha->lldd_ha; |