set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); 
schedule_timeout_uninterruptible(1); 
static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba){	u8 *status;	u32 __iomem *msg = NULL;	int i;	ulong timeout = jiffies + TMOUT_INITOUTBOUND*HZ;	u32* ptr;	u32 outbound_frame;  // This had to be a 32 bit address	u32 m;	do {		rmb();		m = readl(pHba->post_port);		if (m != EMPTY_QUEUE) {			break;		}		if(time_after(jiffies,timeout)){			printk(KERN_WARNING"%s: Timeout waiting for message frame\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);	status = kmalloc(4,GFP_KERNEL|ADDR32);	if (status==NULL) {		adpt_send_nop(pHba, m);		printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n",			pHba->name);		return -ENOMEM;	}	memset(status, 0, 4);	writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]);	writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]);	writel(0, &msg[2]);	writel(0x0106, &msg[3]);	/* Transaction context */	writel(4096, &msg[4]);		/* Host page frame size */	writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]);	/* Outbound msg frame size and Initcode */	writel(0xD0000004, &msg[6]);		/* Simple SG LE, EOB */	writel(virt_to_bus(status), &msg[7]);	writel(m, pHba->post_port);	wmb();	// Wait for the reply status to come back	do {		if (*status) {			if (*status != 0x01 /*I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS*/) {				break;			}		}		rmb();		if(time_after(jiffies,timeout)){			printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);			return -ETIMEDOUT;		}		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(1);	} while (1);	// If the command was successful, fill the fifo with our reply	// message packets	if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {		kfree((void*)status);		return -2;	}	kfree((void*)status);	if(pHba->reply_pool != NULL){		kfree(pHba->reply_pool);	}	pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);	if(!pHba->reply_pool){		printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name);		return -1;	}	memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4);	ptr = pHba->reply_pool;	for(i = 0; i < pHba->reply_fifo_size; i++) {		outbound_frame = (u32)virt_to_bus(ptr);		writel(outbound_frame, pHba->reply_port);		wmb();		ptr +=  REPLY_FRAME_SIZE;	}	adpt_i2o_status_get(pHba);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a9a3047dd8ae43ff24caae5ec733a93df129568e/dpt_i2o.c/buggy/drivers/scsi/dpt_i2o.c