Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 06-09-2011, 02:53 AM   #1
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?


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 06:06 AM
My browser, all day today: 'waiting for' ..waiting.. waiting .. GrapefruiTgirl LQ Suggestions & Feedback 18 05-25-2007 06:35 AM
poll_wait LinLove Linux - Hardware 0 10-01-2006 12:23 AM
poll_wait got_no_clue Linux - General 0 02-16-2006 10:35 AM
poll_wait related rupeshk73 Linux - Newbie 2 03-24-2005 08:12 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:07 PM.

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