aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-06-22 02:30:58 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:51 -0400
commite7db8229964365451b8ec48e32b5558100b0a318 (patch)
treebfa7b0a0fd928078d0d644941203cd6fcb052d4e /drivers/scsi
parent9524c6821849bddad4bf592a47276cfb8a8a98c0 (diff)
[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 <yuxiangl@marvell.com> Cc: Luben Tuikov <ltuikov@yahoo.com> Cc: Jack Wang <jack_wang@usish.com> Reviewed-by: Jacek Danecki <jacek.danecki@intel.com> [jacek: modify pm8001_I_T_nexus_reset to return -ENODEV] Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c19
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c3
2 files changed, 10 insertions, 12 deletions
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)
576 return FAILED; 576 return FAILED;
577} 577}
578 578
579/* Attempt to send a phy (bus) reset */
580int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) 579int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
581{ 580{
582 struct domain_device *dev = cmd_to_domain_dev(cmd);
583 struct sas_phy *phy = sas_get_local_phy(dev);
584 struct Scsi_Host *host = cmd->device->host;
585 int res; 581 int res;
582 struct Scsi_Host *host = cmd->device->host;
583 struct domain_device *dev = cmd_to_domain_dev(cmd);
584 struct sas_internal *i = to_sas_internal(host->transportt);
586 585
587 if (current != host->ehandler) 586 if (current != host->ehandler)
588 return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0); 587 return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0);
589 588
590 res = sas_phy_reset(phy, 1); 589 if (!i->dft->lldd_I_T_nexus_reset)
591 if (res) 590 return FAILED;
592 SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
593 kobject_name(&phy->dev.kobj),
594 res);
595 sas_put_local_phy(phy);
596 591
597 if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE) 592 res = i->dft->lldd_I_T_nexus_reset(dev);
593 if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE ||
594 res == -ENODEV)
598 return SUCCESS; 595 return SUCCESS;
599 596
600 return FAILED; 597 return FAILED;
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 3b11edd4a50c..fdbba57a74ae 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -962,8 +962,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
962 struct pm8001_device *pm8001_dev; 962 struct pm8001_device *pm8001_dev;
963 struct pm8001_hba_info *pm8001_ha; 963 struct pm8001_hba_info *pm8001_ha;
964 struct sas_phy *phy; 964 struct sas_phy *phy;
965
965 if (!dev || !dev->lldd_dev) 966 if (!dev || !dev->lldd_dev)
966 return -1; 967 return -ENODEV;
967 968
968 pm8001_dev = dev->lldd_dev; 969 pm8001_dev = dev->lldd_dev;
969 pm8001_ha = pm8001_find_ha_by_dev(dev); 970 pm8001_ha = pm8001_find_ha_by_dev(dev);