提交 e7db8229 编写于 作者: D Dan Williams 提交者: James Bottomley

[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: NJacek Danecki <jacek.danecki@intel.com>
[jacek: modify pm8001_I_T_nexus_reset to return -ENODEV]
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 9524c682
...@@ -576,25 +576,22 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) ...@@ -576,25 +576,22 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
return FAILED; return FAILED;
} }
/* Attempt to send a phy (bus) reset */
int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) 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; 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) if (current != host->ehandler)
return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0); return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0);
res = sas_phy_reset(phy, 1); if (!i->dft->lldd_I_T_nexus_reset)
if (res) return FAILED;
SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
kobject_name(&phy->dev.kobj),
res);
sas_put_local_phy(phy);
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 SUCCESS;
return FAILED; return FAILED;
......
...@@ -962,8 +962,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev) ...@@ -962,8 +962,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
struct pm8001_device *pm8001_dev; struct pm8001_device *pm8001_dev;
struct pm8001_hba_info *pm8001_ha; struct pm8001_hba_info *pm8001_ha;
struct sas_phy *phy; struct sas_phy *phy;
if (!dev || !dev->lldd_dev) if (!dev || !dev->lldd_dev)
return -1; return -ENODEV;
pm8001_dev = dev->lldd_dev; pm8001_dev = dev->lldd_dev;
pm8001_ha = pm8001_find_ha_by_dev(dev); pm8001_ha = pm8001_find_ha_by_dev(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册