LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-09-2011, 01:53 AM   #1
tanniru
LQ Newbie
 
Registered: Mar 2006
Posts: 24

Rep: Reputation: 0
Red face poll_wait( ) is not waiting in the driver


Hello All,

I am writing a simple char device driver on 2.6.28 linux kernel, in which it needs a polling feature implemented.

I have created device's poll method as in the LDD book:

unsigned int scull_p_poll(struct file *filp, poll_table *wait)
{
....
poll_wait(filp, &dev->inq, wait);
poll_wait(filp, &dev->outq, wait);
.....

return mask;
}

As per documentation : when user application tries to poll on this char device, driver's poll method gets called and poll_wait( ) gets called to add the current process to wait_queue(which was already defined).

So, when there is any data to read or write, we can call wake_up( ) syscall to wakeup the process.

But, that is not happening as it is document. poll_wait() is not waiting for any wake_up call. It is just returning out without waiting.

Could you please help me in developing polling feature for the char device driver?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard Drive Problems: timeout waiting for DMA; error waiting for DMA mintee Linux - Hardware 10 09-21-2007 05:06 AM
My browser, all day today: 'waiting for linuxquestions.org...' ..waiting.. waiting .. GrapefruiTgirl LQ Suggestions & Feedback 18 05-25-2007 05:35 AM
poll_wait LinLove Linux - Hardware 0 09-30-2006 11:23 PM
poll_wait got_no_clue Linux - General 0 02-16-2006 09:35 AM
poll_wait related rupeshk73 Linux - Newbie 2 03-24-2005 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration