/* (Bugzilla:fibrebugs, #513) * Bug fix (part 1)!  20010905 -sralston *	Prevent calling wait_event() (below), if caller happens 
/*	Prevent calling wait_event() (below), if caller happens 
mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg){	Config_t	*pReq;	MPT_FRAME_HDR	*mf;	unsigned long	 flags;	int		 ii, rc;	u32		 flagsLength;	int		 in_isr;	/* (Bugzilla:fibrebugs, #513)	 * Bug fix (part 1)!  20010905 -sralston	 *	Prevent calling wait_event() (below), if caller happens	 *	to be in ISR context, because that is fatal!	 */	in_isr = in_interrupt();	if (in_isr) {		dcprintk((MYIOC_s_WARN_FMT "Config request not allowed in ISR context!\n",				ioc->name));		return -EPERM;	}	/* Get and Populate a free Frame	 */	if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {		dcprintk((MYIOC_s_WARN_FMT "mpt_config: no msg frames!\n",				ioc->name));		return -EAGAIN;	}	pReq = (Config_t *)mf;	pReq->Action = pCfg->action;	pReq->Reserved = 0;	pReq->ChainOffset = 0;	pReq->Function = MPI_FUNCTION_CONFIG;	pReq->ExtPageLength = 0;	pReq->ExtPageType = 0;	pReq->MsgFlags = 0;	for (ii=0; ii < 8; ii++)		pReq->Reserved2[ii] = 0;	pReq->Header.PageVersion = pCfg->hdr->PageVersion;	pReq->Header.PageLength = pCfg->hdr->PageLength;	pReq->Header.PageNumber = pCfg->hdr->PageNumber;	pReq->Header.PageType = (pCfg->hdr->PageType & MPI_CONFIG_PAGETYPE_MASK);	pReq->PageAddress = cpu_to_le32(pCfg->pageAddr);	/* Add a SGE to the config request.	 */	if (pCfg->dir)		flagsLength = MPT_SGE_FLAGS_SSIMPLE_WRITE;	else		flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ;	flagsLength |= pCfg->hdr->PageLength * 4;	mpt_add_sge((char *)&pReq->PageBufferSGE, flagsLength, pCfg->physAddr);	dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n",		ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action));	/* Append pCfg pointer to end of mf	 */	*((void **) (((u8 *) mf) + (ioc->req_sz - sizeof(void *)))) =  (void *) pCfg;	/* Initalize the timer	 */	init_timer(&pCfg->timer);	pCfg->timer.data = (unsigned long) ioc;	pCfg->timer.function = mpt_timer_expired;	pCfg->wait_done = 0;	/* Set the timer; ensure 10 second minimum */	if (pCfg->timeout < 10)		pCfg->timer.expires = jiffies + HZ*10;	else		pCfg->timer.expires = jiffies + HZ*pCfg->timeout;	/* Add to end of Q, set timer and then issue this command */	spin_lock_irqsave(&ioc->FreeQlock, flags);	list_add_tail(&pCfg->linkage, &ioc->configQ);	spin_unlock_irqrestore(&ioc->FreeQlock, flags);	add_timer(&pCfg->timer);	mpt_put_msg_frame(mpt_base_index, ioc, mf);	wait_event(mpt_waitq, pCfg->wait_done);	/* mf has been freed - do not access */	rc = pCfg->status;	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7fadc87e5c3dd96a36cd9b9500d2ccff39048dd4/mptbase.c/clean/drivers/message/fusion/mptbase.c