Skip to content

Commit

Permalink
[SCSI] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Luben Tuikov <[email protected]>
Cc: Jack Wang <[email protected]>
Reviewed-by: Jacek Danecki <[email protected]>
[jacek: modify pm8001_I_T_nexus_reset to return -ENODEV]
Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
djbw authored and James Bottomley committed Jul 20, 2012
1 parent 9524c68 commit e7db822
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
19 changes: 8 additions & 11 deletions drivers/scsi/libsas/sas_scsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/pm8001/pm8001_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
struct pm8001_device *pm8001_dev;
struct pm8001_hba_info *pm8001_ha;
struct sas_phy *phy;

if (!dev || !dev->lldd_dev)
return -1;
return -ENODEV;

pm8001_dev = dev->lldd_dev;
pm8001_ha = pm8001_find_ha_by_dev(dev);
Expand Down

0 comments on commit e7db822

Please sign in to comment.