lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	11 Sep 2012 13:39:44 +0000
From:	"Oskar Schirmer" <oskar@...ra.com>
To:	"Wim Van Sebroeck" <wim@...ana.be>
Cc:	"Oskar Schirmer" <oskar@...ra.com>,
	"Sascha Hauer" <kernel@...gutronix.de>,
	linux-kernel@...r.kernel.org,
	"Wolfram Sang" <w.sang@...gutronix.de>,
	" Andrew Morton" <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2] watchdog/imx2+: add support for pretimeout interrupt functionality

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@...ra.com>
> > Cc: Wim Van Sebroeck <wim@...ana.be>
> > Cc: Wolfram Sang <w.sang@...gutronix.de>
> > Cc: Sascha Hauer <kernel@...gutronix.de>
> > Cc: Andrew Morton <akpm@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ