From e7db8229964365451b8ec48e32b5558100b0a318 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Jun 2012 23:30:58 -0700 Subject: [SCSI] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler sas_eh_bus_reset_handler() amounts to sas_phy_reset() without notification of the reset to the lldd. If this is triggered from eh-cmnd recovery there may be sas_tasks for the lldd to terminate, so ->lldd_I_T_nexus_reset is warranted. Cc: Xiangliang Yu Cc: Luben Tuikov Cc: Jack Wang Reviewed-by: Jacek Danecki [jacek: modify pm8001_I_T_nexus_reset to return -ENODEV] Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- drivers/scsi/libsas/sas_scsi_host.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'drivers/scsi/libsas') diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 875b87112c50..676414859872 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -576,25 +576,22 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) return FAILED; } -/* Attempt to send a phy (bus) reset */ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) { - struct domain_device *dev = cmd_to_domain_dev(cmd); - struct sas_phy *phy = sas_get_local_phy(dev); - struct Scsi_Host *host = cmd->device->host; int res; + struct Scsi_Host *host = cmd->device->host; + struct domain_device *dev = cmd_to_domain_dev(cmd); + struct sas_internal *i = to_sas_internal(host->transportt); if (current != host->ehandler) return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0); - res = sas_phy_reset(phy, 1); - if (res) - SAS_DPRINTK("Bus reset of %s failed 0x%x\n", - kobject_name(&phy->dev.kobj), - res); - sas_put_local_phy(phy); + if (!i->dft->lldd_I_T_nexus_reset) + return FAILED; - if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE) + res = i->dft->lldd_I_T_nexus_reset(dev); + if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE || + res == -ENODEV) return SUCCESS; return FAILED; -- cgit v1.2.3