From: Clemens Ladisch <clemens@ladisch.de>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: character driver - poll() timeout
Date: Wed, 28 Oct 2015 08:24:10 +0100 [thread overview]
Message-ID: <5630781A.2000005@ladisch.de> (raw)
In-Reply-To: <CAHhAz+hDuENBKUXLnP9W4VzjtZL0xu6EA2LY_ZO6GShTpaLdaQ@mail.gmail.com>
Muni Sekhar wrote:
> On Tue, Oct 27, 2015 at 8:48 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
>> Muni Sekhar wrote:
>>> I need to find out when exactly driver's poll callback returned timeout.
>>
>> Your poll callback _cannot_ return a timeout.
>>
>> Why do you think you need this information for?
>
> During stress test, my test application fails and throws poll() timeout error.
>
> I need to debug what is the state of my driver during that time. I
> added prints in driver poll(), but I gets lots of debug prints if
> poll() timeout is more.
Your poll() callback does not really change the state of the driver.
It just returns the wait queue and the current state of the device.
(Which means it is likely to get called _twice_, before poll() goes
to sleep, and just before it returns.)
Your driver's state changes only when
1) you start some operation (such as read() or write()), or when
2) you finish some operation (which wakes up anyone waiting on
that wait queue).
If you time out, it means that some wake_up() happens too late or
not at all, or that you do not return the correct state.
Regards,
Clemens
next prev parent reply other threads:[~2015-10-28 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 6:54 character driver - poll() timeout Muni Sekhar
2015-10-27 8:11 ` Clemens Ladisch
2015-10-27 14:56 ` Muni Sekhar
2015-10-27 15:18 ` Clemens Ladisch
2015-10-28 6:41 ` Muni Sekhar
2015-10-28 7:24 ` Clemens Ladisch [this message]
2015-10-28 10:15 ` Muni Sekhar
2015-10-27 15:20 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5630781A.2000005@ladisch.de \
--to=clemens@ladisch.de \
--cc=linux-kernel@vger.kernel.org \
--cc=munisekharrms@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).