linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH] watchdog: new option to skip ping in close
Date: Mon, 6 Aug 2012 12:25:03 -0400	[thread overview]
Message-ID: <20120806162503.GA21740@redhat.com> (raw)
In-Reply-To: <501CE688.8070509@redhat.com>

On Sat, Aug 04, 2012 at 11:08:24AM +0200, Hans de Goede wrote:
> Why on earth are you putting that if block there and not simply putting
> the command in the switch-case where it belongs? If you were afraid watchdog_ioctl_op
> could cause issues, then maybe you should have studied the code?
> 
> That would have thought you that it will always return -ENOIOCTLCMD for commands it
> does not know how to handle, so it won't interfere with adding new standard commands.
> 
> Adding this if block there is completely unnecessary and quite ugly IMHO.

It is ugly, but it's also necessary for a couple reasons that you may have
missed at first glance.  First, this ioctl is addressing behavior that
exists in the common framework layer, not in individual drivers, so it
doesn't make too much sense to pass down to the drivers.

That being said, we could do so if ENOIOCTLCMD worked as you suggest, but
it doesn't quite.  Drivers with an ioctl op will return ENOTTY, in which
case the switch statement would work, but drivers with no ioctl op (e.g.
softdog) cause watchdog_ioctl_op to return ENOIOCTLCMD, causing the switch
statement to be skipped.

In the end, we need WDIOC_NOCLOSEPING to be processed by the core,
independent of what drivers do, since as I explained this is targeting the
behavior of the core framework, not the drivers.

For those reasons, I placed the code where it is, but I would be satisfied
with a different approach that also works.

Dave


  reply	other threads:[~2012-08-06 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03 17:40 [PATCH] watchdog: new option to skip ping in close David Teigland
2012-08-04  9:08 ` Hans de Goede
2012-08-06 16:25   ` David Teigland [this message]
2012-08-07  7:53     ` Hans de Goede
2012-08-07 15:23       ` David Teigland
2012-08-08 20:22     ` Wim Van Sebroeck
2012-08-08 21:11       ` David Teigland

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=20120806162503.GA21740@redhat.com \
    --to=teigland@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-watchdog@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).