Commit 42961ee8 authored by malahal@us.ibm.com's avatar malahal@us.ibm.com Committed by James Bottomley

[SCSI] aic94xx SCSI timeout fix: SMP retry fix.

Updating DDB0 inside aic94xx driver itself caused SMP command timeout. I
hit this SMP timeout problem twice but I am not able to reproduce it since
then. Here is a fix that retries an SMP command.
Signed-off-by: default avatarMalahal Naineni <malahal@us.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 3f048109
...@@ -71,11 +71,13 @@ static void smp_task_done(struct sas_task *task) ...@@ -71,11 +71,13 @@ static void smp_task_done(struct sas_task *task)
static int smp_execute_task(struct domain_device *dev, void *req, int req_size, static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
void *resp, int resp_size) void *resp, int resp_size)
{ {
int res; int res, retry;
struct sas_task *task = sas_alloc_task(GFP_KERNEL); struct sas_task *task = NULL;
struct sas_internal *i = struct sas_internal *i =
to_sas_internal(dev->port->ha->core.shost->transportt); to_sas_internal(dev->port->ha->core.shost->transportt);
for (retry = 0; retry < 3; retry++) {
task = sas_alloc_task(GFP_KERNEL);
if (!task) if (!task)
return -ENOMEM; return -ENOMEM;
...@@ -110,16 +112,24 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size, ...@@ -110,16 +112,24 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
} }
} }
if (task->task_status.resp == SAS_TASK_COMPLETE && if (task->task_status.resp == SAS_TASK_COMPLETE &&
task->task_status.stat == SAM_GOOD) task->task_status.stat == SAM_GOOD) {
res = 0; res = 0;
else break;
} else {
SAS_DPRINTK("%s: task to dev %016llx response: 0x%x " SAS_DPRINTK("%s: task to dev %016llx response: 0x%x "
"status 0x%x\n", __FUNCTION__, "status 0x%x\n", __FUNCTION__,
SAS_ADDR(dev->sas_addr), SAS_ADDR(dev->sas_addr),
task->task_status.resp, task->task_status.resp,
task->task_status.stat); task->task_status.stat);
sas_free_task(task);
task = NULL;
}
}
ex_err: ex_err:
BUG_ON(retry == 3 && task != NULL);
if (task != NULL) {
sas_free_task(task); sas_free_task(task);
}
return res; return res;
} }
......
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