set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); 
schedule_timeout_uninterruptible(1); 
static int try_get_dev_id(struct smi_info *smi_info){	unsigned char      msg[2];	unsigned char      *resp;	unsigned long      resp_len;	enum si_sm_result smi_result;	int               rv = 0;	resp = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);	if (! resp)		return -ENOMEM;	/* Do a Get Device ID command, since it comes back with some	   useful info. */	msg[0] = IPMI_NETFN_APP_REQUEST << 2;	msg[1] = IPMI_GET_DEVICE_ID_CMD;	smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);	smi_result = smi_info->handlers->event(smi_info->si_sm, 0);	for (;;)	{		if (smi_result == SI_SM_CALL_WITH_DELAY) {			set_current_state(TASK_UNINTERRUPTIBLE);			schedule_timeout(1);			smi_result = smi_info->handlers->event(				smi_info->si_sm, 100);		}		else if (smi_result == SI_SM_CALL_WITHOUT_DELAY)		{			smi_result = smi_info->handlers->event(				smi_info->si_sm, 0);		}		else			break;	}	if (smi_result == SI_SM_HOSED) {		/* We couldn't get the state machine to run, so whatever's at		   the port is probably not an IPMI SMI interface. */		rv = -ENODEV;		goto out;	}	/* Otherwise, we got some data. */	resp_len = smi_info->handlers->get_result(smi_info->si_sm,						  resp, IPMI_MAX_MSG_LENGTH);	if (resp_len < 6) {		/* That's odd, it should be longer. */		rv = -EINVAL;		goto out;	}	if ((resp[1] != IPMI_GET_DEVICE_ID_CMD) || (resp[2] != 0)) {		/* That's odd, it shouldn't be able to fail. */		rv = -EINVAL;		goto out;	}	/* Record info from the get device id, in case we need it. */	memcpy(&smi_info->device_id, &resp[3],	       min_t(unsigned long, resp_len-3, sizeof(smi_info->device_id))); out:	kfree(resp);	return rv;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/da4cd8dfe18ee901b880f94ca0fa79d5cc1cd0eb/ipmi_si_intf.c/clean/drivers/char/ipmi/ipmi_si_intf.c