mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: kernel@street-vision.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [2.4.20-pre1] Watchdog Stuff (1/4)
Date: Thu, 8 Aug 2002 13:51:20 -0700	[thread overview]
Message-ID: <20020808205119.GG1038@nic1-pc.us.oracle.com> (raw)
In-Reply-To: <200208081206.g78C6j402355@tench.street-vision.com>

On Thu, Aug 08, 2002 at 12:06:44PM +0000, kernel@street-vision.com wrote:
> You might cc the driver author...

	Sorry, with so many drivers to patch, I went with a recommended
list of "interested parties".  I'll add you to that list.  It is posted
to linux-kernel in the hopes that interested persons do get a chance to
look at it.  I got no responses outside of my "interested parties" when
I posted this patch originally.  It's good to hear from you.

> > +
> > +	case WDIOC_SETTIMEOUT:
> > +		if (get_user(new_margin, (int *)arg))
> > +			return -EFAULT;
> > +		if ((new_margin < 1) || (new_margin > 255))
> > +			return -EINVAL;
> > +		wd_margin = new_margin;
> > +		wafwdt_stop();
> > +		wafwdt_start();
> > +		/* Fall */
> > +	case WDIOC_GETTIMEOUT:
> > +		return put_user(wd_margin, (int *)arg);
> 
> I really wouldnt do wafwdt_stop(); wafwdt_start(); here. The new timeout
> will be set on the next watchdog ping anyway, and you need to spin_lock
> and unlock round this too. Much cleaner just to drop it.

	Um, am I missreading: 

     59 static void wafwdt_ping(void)
     60 {
     61         /* pat watchdog */
     62         spin_lock(&wafwdt_lock);
     63         inb_p(WDT_STOP);
     64         inb_p(WDT_START);
     65         spin_unlock(&wafwdt_lock);
     66 }

I don't see it writing the new timeout.  Also, the semantic of
WDIOC_SETTIMEOUT (at least as I've implemented it in all the drivers
I've touched) is to ping the device to verify the new timeout is active.
	I also note that the calls to wafwdt_stop()/start() in the
open()/close() functions doesn't take the spinlock.  Granted, open() and
close() should be protected by wafwdt_is_open.
	If I add the locking, are you comfortable with the changes?

Joel

-- 

"To fall in love is to create a religion that has a fallible god."
        -Jorge Luis Borges

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

      reply	other threads:[~2002-08-08 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08  0:12 Joel Becker
2002-08-08  0:17 ` [PATCH] [2.4.20-pre1] Watchdog Stuff (2/4) Joel Becker
2002-08-08  0:18 ` [PATCH] [2.4.20-pre1] Watchdog Stuff (3/4) Joel Becker
2002-08-08  0:19 ` [PATCH] [2.4.20-pre1] Watchdog Stuff (4/4) Joel Becker
2002-08-08 12:06 ` [PATCH] [2.4.20-pre1] Watchdog Stuff (1/4) kernel
2002-08-08 20:51   ` Joel Becker [this message]

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=20020808205119.GG1038@nic1-pc.us.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=kernel@street-vision.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®