set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); 
schedule_timeout_uninterruptible(1); 
static s32 adpt_i2o_status_get(adpt_hba* pHba){	ulong timeout;	u32 m;	u32 __iomem *msg;	u8 *status_block=NULL;	ulong status_block_bus;	if(pHba->status_block == NULL) {		pHba->status_block = (i2o_status_block*)			kmalloc(sizeof(i2o_status_block),GFP_KERNEL|ADDR32);		if(pHba->status_block == NULL) {			printk(KERN_ERR			"dpti%d: Get Status Block failed; Out of memory. \n", 			pHba->unit);			return -ENOMEM;		}	}	memset(pHba->status_block, 0, sizeof(i2o_status_block));	status_block = (u8*)(pHba->status_block);	status_block_bus = virt_to_bus(pHba->status_block);	timeout = jiffies+TMOUT_GETSTATUS*HZ;	do {		rmb();		m = readl(pHba->post_port);		if (m != EMPTY_QUEUE) {			break;		}		if(time_after(jiffies,timeout)){			printk(KERN_ERR "%s: Timeout waiting for message !\n",					pHba->name);			return -ETIMEDOUT;		}		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(1);	} while(m==EMPTY_QUEUE);		msg=(u32 __iomem *)(pHba->msg_addr_virt+m);	writel(NINE_WORD_MSG_SIZE|SGL_OFFSET_0, &msg[0]);	writel(I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID, &msg[1]);	writel(1, &msg[2]);	writel(0, &msg[3]);	writel(0, &msg[4]);	writel(0, &msg[5]);	writel(((u32)status_block_bus)&0xffffffff, &msg[6]);	writel(0, &msg[7]);	writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes	//post message	writel(m, pHba->post_port);	wmb();	while(status_block[87]!=0xff){		if(time_after(jiffies,timeout)){			printk(KERN_ERR"dpti%d: Get status timeout.\n",				pHba->unit);			return -ETIMEDOUT;		}		rmb();		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(1);	}	// Set up our number of outbound and inbound messages	pHba->post_fifo_size = pHba->status_block->max_inbound_frames;	if (pHba->post_fifo_size > MAX_TO_IOP_MESSAGES) {		pHba->post_fifo_size = MAX_TO_IOP_MESSAGES;	}	pHba->reply_fifo_size = pHba->status_block->max_outbound_frames;	if (pHba->reply_fifo_size > MAX_FROM_IOP_MESSAGES) {		pHba->reply_fifo_size = MAX_FROM_IOP_MESSAGES;	}	// Calculate the Scatter Gather list size	pHba->sg_tablesize = (pHba->status_block->inbound_frame_size * 4 -40)/ sizeof(struct sg_simple_element);	if (pHba->sg_tablesize > SG_LIST_ELEMENTS) {		pHba->sg_tablesize = SG_LIST_ELEMENTS;	}#ifdef DEBUG	printk("dpti%d: State = ",pHba->unit);	switch(pHba->status_block->iop_state) {		case 0x01:			printk("INIT\n");			break;		case 0x02:			printk("RESET\n");			break;		case 0x04:			printk("HOLD\n");			break;		case 0x05:			printk("READY\n");			break;		case 0x08:			printk("OPERATIONAL\n");			break;		case 0x10:			printk("FAILED\n");			break;		case 0x11:			printk("FAULTED\n");			break;		default:			printk("%x (unknown!!)\n",pHba->status_block->iop_state);	}#endif	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a9a3047dd8ae43ff24caae5ec733a93df129568e/dpt_i2o.c/buggy/drivers/scsi/dpt_i2o.c