spin_lock_irq(ha->host->host_lock); 
if (--wait_iter) break; } if (CMD_SP(cmd)) ret = QLA_FUNCTION_FAILED; 
qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd){#define ABORT_POLLING_PERIOD	HZ#define ABORT_WAIT_TIME		((10 * HZ) / (ABORT_POLLING_PERIOD))	int		found = 0;	int		done = 0;	srb_t		*rp = NULL;	struct list_head *list, *temp;	u_long		max_wait_time = ABORT_WAIT_TIME;	do {		/* Check on done queue */		spin_lock(&ha->list_lock);		list_for_each_safe(list, temp, &ha->done_queue) {			rp = list_entry(list, srb_t, list);			/*			 * Found command. Just exit and wait for the cmd sent			 * to OS.			*/			if (cmd == rp->cmd) {				found++;				DEBUG3(printk("%s: found in done queue.\n",				    __func__);)				break;			}		}		spin_unlock(&ha->list_lock);		/* Complete the cmd right away. */		if (found) { 			qla2x00_delete_from_done_queue(ha, rp);			sp_put(ha, rp);			done++;			break;		}		spin_unlock_irq(ha->host->host_lock);		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(ABORT_POLLING_PERIOD);		spin_lock_irq(ha->host->host_lock);	} while ((max_wait_time--));	if (done)		DEBUG2(printk(KERN_INFO "%s: found cmd=%p.\n", __func__, cmd));	return (done);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f4f051ebb40e74ad0ba02d2cb3a6c16b0393472b/qla_os.c/buggy/drivers/scsi/qla2xxx/qla_os.c