/* Notes: We do not need to lock this. There is the potential for a race only in that the normal completion handling might run, but if the normal completion function determines that the timer has already fired, then it mustn't do anything.  */
enum blk_eh_timer_return scsi_times_out(struct request *req)
/* Notes: We do not need to lock this. There is the potential for a race only in that the normal completion handling might run, but if the normal completion function determines that the timer has already fired, then it mustn't do anything.  */
enum blk_eh_timer_return scsi_times_out(struct request *req)
{
	struct scsi_cmnd *scmd = req->special;
	enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED;
	scsi_log_completion(scmd, TIMEOUT_ERROR);
	if (scmd->device->host->transportt->eh_timed_out)
		rtn = scmd->device->host->transportt->eh_timed_out(scmd);
	else if (scmd->device->host->hostt->eh_timed_out)
		rtn = scmd->device->host->hostt->eh_timed_out(scmd);
	if (unlikely(rtn == BLK_EH_NOT_HANDLED &&
		     !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
		scmd->result |= DID_TIME_OUT << 16;
		rtn = BLK_EH_HANDLED;
	}
	return rtn;
}