public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Samuel Tardieu <sam@rfc1149.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: add support for w83697hg chip
Date: Sat, 09 Sep 2006 16:58:42 +0100	[thread overview]
Message-ID: <1157817522.6877.46.camel@localhost.localdomain> (raw)
In-Reply-To: <2006-09-09-17-18-13+trackit+sam@rfc1149.net>

Ar Sad, 2006-09-09 am 17:18 +0200, ysgrifennodd Samuel Tardieu:
> On  9/09, Alan Cox wrote:
> 
> | No kernel level locking anywhere in the driver. Yet you could have two
> | people accessing it at once.
> 
> The device can be open only by one client at a time, this is checked in
> open(), as was done in most other watchdog drivers.

This is insufficient. Many watchdog drivers are broken here but that's
no excuse to continue the problem because people will copy the errror
(as I suspect you did)

	fd = open("/dev/watchdog", O_RDWR);
	switch(fork())
	{

.. one open, two users, two processes, two CPUs


> | > +	default:
> | > +		return -ENOIOCTLCMD;
> | 
> | Should be -ENOTTY
> 
> We have 44 instances of ENOIOCTLCMD in other watchdog drivers
> and zero instances of ENOTTY. Should we change all the instances, adopt
> what has been done or just change the new ones?

-ENOIOCTLCMD should never be returned to userspace. An unknown ioctl
returns -ENOTTY. -ENOIOCTLCMD is an internal magic value used with
helper layers to tell the helper layer "I don't handle this, use your
own handler"




  parent reply	other threads:[~2006-09-09 15:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 10:29 [PATCH] watchdog: add support for w83697hg chip Samuel Tardieu
2006-09-06 11:14 ` Pádraig Brady
2006-09-06 11:29   ` Samuel Tardieu
2006-09-06 11:49     ` Pádraig Brady
2006-09-06 12:07       ` Samuel Tardieu
2006-09-06 12:48         ` Pádraig Brady
2006-09-06 19:41         ` Wim Van Sebroeck
2006-09-07  9:57           ` Samuel Tardieu
2006-09-07 13:24             ` Pádraig Brady
2006-09-07 16:44             ` Samuel Tardieu
2006-09-08  9:16               ` Pádraig Brady
2006-09-08  9:49                 ` Samuel Tardieu
2006-09-07 17:26   ` Jim Cromie
2006-09-07 18:06     ` Samuel Tardieu
2006-09-08 12:22     ` Jean Delvare
2006-09-09 15:25 ` Alan Cox
2006-09-09 15:18   ` Samuel Tardieu
2006-09-09 15:33     ` Samuel Tardieu
2006-09-09 15:58     ` Alan Cox [this message]
2006-09-09 15:38       ` Samuel Tardieu
2006-09-09 16:28         ` Samuel Tardieu
2006-09-09 21:49           ` Alexey Dobriyan
2006-09-09 22:11             ` Samuel Tardieu
2006-09-09 22:27               ` Alexey Dobriyan
2006-09-09 18:02   ` Sergey Vlasov
2006-09-09 18:35     ` Samuel Tardieu
2006-09-11  5:50     ` Evgeniy Polyakov
2006-09-13 19:15     ` Wim Van Sebroeck
2006-09-14  7:15       ` Wim Van Sebroeck
2006-09-14  7:05     ` [RFC-patch 0/3] SuperIO locks coordinator (was: watchdog: add support for w83697hg chip) Jim Cromie
2006-09-14  7:13       ` [RFC-patch 1/3] SuperIO locks coordinator Jim Cromie
2006-09-17 17:23         ` Randy.Dunlap
2006-09-14  7:16       ` [RFC-patch 2/3] " Jim Cromie
2006-09-14  7:20       ` [RFC-patch 3/3] SuperIO locks coordinator - use in pc8736x_gpio Jim Cromie
2006-09-14 21:58       ` [RFC-patch 0/3] SuperIO locks coordinator Jim Cromie
     [not found]         ` <4dfa50520609141753h34e54fdayba62f1b127d58036@mail.gmail.com>
     [not found]           ` <450A54EB.1020305@gmail.com>
     [not found]             ` <4dfa50520609151118s65a980b4td143a9fbbfeb1798@mail.gmail.com>
2006-09-16 17:17               ` [lm-sensors] " Jim Cromie
2006-09-19 13:11       ` Samuel Tardieu

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=1157817522.6877.46.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@rfc1149.net \
    /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