PDA

View Full Version : system hangs at poll_wait



sandhya
26th April 2006, 10:09 AM
hi there!

i am testing sdl card driver on kernel 2.6. it was actually developed for kernel2.2 but i have ported it to kernel 2.6....... i have written one test program. when i run this program the system gets hung at select() call.

To handle this select(), i have written 'poll' function in driver. In poll i have used 'poll_wait'. This is where the system is getting hung ....
--------------------------------------------------------------------------------------------------------
unsigned int TdmPoll(struct file* pFile,struct poll_table_struct* pPollTable)
{
DBG_FUNC("TdmPoll()");
unsigned int PollMask = 0;
PTDM_CALL pLocTdmCall = pFile->private_data;
volatile ulong* ReadPtr = (ulong*)&(pLocTdmCall->pReadPtr);
volatile ulong* WritePtr = (ulong*)&(pLocTdmCall->pWritePtr);
DBG_DEBUG("Function starting...\n");

----------->poll_wait(pFile, &(pLocTdmCall->ReadWaitQueue), pPollTable);//here it hangs

if ( signal_pending(current) )
{
DBG_WARN("Received blocked signal!\n");
return -ERESTARTSYS;
}
if (*ReadPtr != *WritePtr)
PollMask = POLLIN | POLLRDNORM;
PollMask |= POLLOUT | POLLWRNORM;

DBG_DEBUG("Function done.\n");
return PollMask;
}
--------------------------------------------------------------------------------------------------------
can anybody help me in finding out what might be the problem there? Is there any thing i need to take care of?

tashirosgt
26th April 2006, 03:36 PM
There have been some heated discussions on the theme that poll_wait returns immediately.
http://www.ussg.iu.edu/hypermail/linux/kernel/0403.0/0344.html
I don't claim to be an expert on this, but are you sure that the code hands in poll_wait()?

sandhya
27th April 2006, 06:00 AM
ya i have checked with kdb.