scmd->device->host->eh_action = &sem; 
shost->eh_action = &sem; 
static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout){	struct Scsi_Host *host = scmd->device->host;	DECLARE_MUTEX_LOCKED(sem);	unsigned long flags;	int rtn = SUCCESS;	/*	 * we will use a queued command if possible, otherwise we will	 * emulate the queuing and calling of completion function ourselves.	 */	scmd->owner = SCSI_OWNER_LOWLEVEL;	if (scmd->device->scsi_level <= SCSI_2)		scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |			(scmd->device->lun << 5 & 0xe0);	scsi_add_timer(scmd, timeout, scsi_eh_times_out);	/*	 * set up the semaphore so we wait for the command to complete.	 */	scmd->device->host->eh_action = &sem;	scmd->request->rq_status = RQ_SCSI_BUSY;	spin_lock_irqsave(scmd->device->host->host_lock, flags);	scsi_log_send(scmd);	host->hostt->queuecommand(scmd, scsi_eh_done);	spin_unlock_irqrestore(scmd->device->host->host_lock, flags);	down(&sem);	scsi_log_completion(scmd, SUCCESS);	scmd->device->host->eh_action = NULL;	/*	 * see if timeout.  if so, tell the host to forget about it.	 * in other words, we don't want a callback any more.	 */	if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) {		scsi_eh_eflags_clr(scmd,  SCSI_EH_REC_TIMEOUT);		scmd->owner = SCSI_OWNER_LOWLEVEL;		/*		 * as far as the low level driver is		 * concerned, this command is still active, so		 * we must give the low level driver a chance		 * to abort it. (db) 		 *		 * FIXME(eric) - we are not tracking whether we could		 * abort a timed out command or not.  not sure how		 * we should treat them differently anyways.		 */		spin_lock_irqsave(scmd->device->host->host_lock, flags);		if (scmd->device->host->hostt->eh_abort_handler)			scmd->device->host->hostt->eh_abort_handler(scmd);		spin_unlock_irqrestore(scmd->device->host->host_lock, flags);					scmd->request->rq_status = RQ_SCSI_DONE;		scmd->owner = SCSI_OWNER_ERROR_HANDLER;					rtn = FAILED;	}	SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n",					  __FUNCTION__, scmd, rtn));	/*	 * now examine the actual status codes to see whether the command	 * actually did complete normally.	 */	if (rtn == SUCCESS) {		rtn = scsi_eh_completed_normally(scmd);		SCSI_LOG_ERROR_RECOVERY(3,			printk("%s: scsi_eh_completed_normally %x\n",			       __FUNCTION__, rtn));		switch (rtn) {		case SUCCESS:		case NEEDS_RETRY:		case FAILED:			break;		default:			rtn = FAILED;			break;		}	}	return rtn;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f59114b7b5dc677bbd7cc7e26a5fcb3572a3445c/scsi_error.c/buggy/drivers/scsi/scsi_error.c