From: "Oskar Schirmer" <oskar@scara.com>
To: "Wim Van Sebroeck" <wim@iguana.be>
Cc: "Oskar Schirmer" <oskar@scara.com>,
"Sascha Hauer" <kernel@pengutronix.de>,
linux-kernel@vger.kernel.org,
"Wolfram Sang" <w.sang@pengutronix.de>,
" Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] watchdog/imx2+: add support for pretimeout interrupt functionality
Date: 11 Sep 2012 13:39:44 +0000 [thread overview]
Message-ID: <20120911133944.GA2537@curry> (raw)
In-Reply-To: <20120911110021.GG27604@spo001.leaseweb.com>
Hi Wim,
On Tue, Sep 11, 2012 at 13:00:21 +0200, Wim Van Sebroeck wrote:
> Hi Oskar,
>
> > This watchdog device provides pretimeout facilities:
> > Set some timeout value and get informed about imminent
> > watchdog activity thru interrupt.
> >
> > Allow user to wait for this interrupt thru poll(2),
> > and to clear it thru read(2).
> >
> > Signed-off-by: Oskar Schirmer <oskar@scara.com>
> > Cc: Wim Van Sebroeck <wim@iguana.be>
> > Cc: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Sascha Hauer <kernel@pengutronix.de>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
>
> I have a problem with the read and poll.
> We had "read()" in the past so we have a possible issue here (different function but userspace apps could still use the old read)...
> Can you explain what the read and poll does and where you want to use it.
To wait for some hardware event without blocking,
poll is used, primarily in places where it's about
data transmission. Ioctl would be an alternative
for cases without data transmission, but poll is
more generic.
Events causing pollin to return usually provide
data for read access, or, where no data is involved,
at least allow to clear the event thru read.
Now, checking current kernel for precedent, there
is only one driver that comes with pretimeouts: ipmi_watchdog.
It allows to set/get pretimeout, wait for it thru poll,
and clear it's occurence thru read.
So the obvious approach is to have a similar api for
the imx watchdog, as well, to avoid conflicting designs
right away.
Documentation does introduce set/get pretimeout, but
does not define how to detect and clear events.
Actually it does not define any meaning of poll or read.
Maybe this should be added.
For the past use of read, could You point me to where
imx2_wdt.c did have it?
There are watchdog drivers around that do implement a
read function, most of them to read temperature values.
Temperature sensor and watchdog are quite
different functionalities, so even where provided by
a single piece of hardware they probably should go
along two distinct drivers to make it a clean design.
Grüße,
Oskar
next prev parent reply other threads:[~2012-09-11 13:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 10:37 [PATCH] watchdog/imx2+: add support for pretimeout interrupt functionality Oskar Schirmer
2012-07-03 9:10 ` [PATCH] watchdog/imx2+: add support for pretimeout interrupt Oskar Schirmer
2012-09-05 7:23 ` Oskar Schirmer
2012-09-11 10:00 ` [PATCH v2] watchdog/imx2+: add support for pretimeout interrupt functionality Oskar Schirmer
2012-09-11 11:00 ` Wim Van Sebroeck
2012-09-11 13:39 ` Oskar Schirmer [this message]
2012-09-20 15:37 ` [PATCH v3] " Oskar Schirmer
2012-09-27 13:08 ` Oskar Schirmer
2012-09-27 21:24 ` Wim Van Sebroeck
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=20120911133944.GA2537@curry \
--to=oskar@scara.com \
--cc=akpm@linux-foundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=w.sang@pengutronix.de \
--cc=wim@iguana.be \
/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