Commit 9524c682 authored by Dan Williams's avatar Dan Williams Committed by James Bottomley

[SCSI] libsas: add sas_eh_abort_handler

When recovering failed eh-cmnds let the lldd attempt an abort via
scsi_abort_eh_cmnd before escalating.
Reviewed-by: default avatarJacek Danecki <jacek.danecki@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 5db45bdc
...@@ -531,6 +531,27 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type, int lun, i ...@@ -531,6 +531,27 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type, int lun, i
return FAILED; return FAILED;
} }
int sas_eh_abort_handler(struct scsi_cmnd *cmd)
{
int res;
struct sas_task *task = TO_SAS_TASK(cmd);
struct Scsi_Host *host = cmd->device->host;
struct sas_internal *i = to_sas_internal(host->transportt);
if (current != host->ehandler)
return FAILED;
if (!i->dft->lldd_abort_task)
return FAILED;
res = i->dft->lldd_abort_task(task);
if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
return SUCCESS;
return FAILED;
}
EXPORT_SYMBOL_GPL(sas_eh_abort_handler);
/* Attempt to send a LUN reset message to a device */ /* Attempt to send a LUN reset message to a device */
int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
{ {
......
...@@ -720,6 +720,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); ...@@ -720,6 +720,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
void sas_init_dev(struct domain_device *); void sas_init_dev(struct domain_device *);
void sas_task_abort(struct sas_task *); void sas_task_abort(struct sas_task *);
int sas_eh_abort_handler(struct scsi_cmnd *cmd);
int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment