Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47726
b: refs/heads/master
c: b218a0d
h: refs/heads/master
v: v3
  • Loading branch information
Darrick J. Wong authored and James Bottomley committed Jan 13, 2007
1 parent a3cee24 commit a7e3df6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf451207511d049189ddb0a4eae3acdb086a3c82
refs/heads/master: b218a0d8e250e0ae8fd4d4e45bd66a588b380752
9 changes: 9 additions & 0 deletions trunk/drivers/scsi/aic94xx/aic94xx_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ static void asd_task_tasklet_complete(struct asd_ascb *ascb,

spin_lock_irqsave(&task->task_state_lock, flags);
task->task_state_flags &= ~SAS_TASK_STATE_PENDING;
task->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
task->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((task->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&task->task_state_lock, flags);
Expand Down Expand Up @@ -557,6 +558,7 @@ int asd_execute_task(struct sas_task *task, const int num,
struct sas_task *t = task;
struct asd_ascb *ascb = NULL, *a;
struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha;
unsigned long flags;

res = asd_can_queue(asd_ha, num);
if (res)
Expand Down Expand Up @@ -599,6 +601,10 @@ int asd_execute_task(struct sas_task *task, const int num,
}
if (res)
goto out_err_unmap;

spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags |= SAS_TASK_AT_INITIATOR;
spin_unlock_irqrestore(&t->task_state_lock, flags);
}
list_del_init(&alist);

Expand All @@ -617,6 +623,9 @@ int asd_execute_task(struct sas_task *task, const int num,
if (a == b)
break;
t = a->uldd_task;
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
spin_unlock_irqrestore(&t->task_state_lock, flags);
switch (t->task_proto) {
case SATA_PROTO:
case SAS_PROTO_STP:
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/scsi/libsas/sas_scsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,13 @@ enum scsi_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd)
cmd, task);
return EH_HANDLED;
}
if (!(task->task_state_flags & SAS_TASK_AT_INITIATOR)) {
spin_unlock_irqrestore(&task->task_state_lock, flags);
SAS_DPRINTK("command 0x%p, task 0x%p, not at initiator: "
"EH_RESET_TIMER\n",
cmd, task);
return EH_RESET_TIMER;
}
task->task_state_flags |= SAS_TASK_STATE_ABORTED;
spin_unlock_irqrestore(&task->task_state_lock, flags);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/scsi/libsas.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ struct sas_task {
#define SAS_TASK_STATE_DONE 2
#define SAS_TASK_STATE_ABORTED 4
#define SAS_TASK_INITIATOR_ABORTED 8
#define SAS_TASK_AT_INITIATOR 16

static inline struct sas_task *sas_alloc_task(gfp_t flags)
{
Expand Down

0 comments on commit a7e3df6

Please sign in to comment.