linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: linuxppc-embedded@lists.linuxppc.org
Subject: patch against linuxppc_2_4_devel: ppc405_wdt.c needs to be fixed
Date: Wed, 04 Jun 2003 09:10:52 +0200	[thread overview]
Message-ID: <3EDD9B7C.3080101@esd-electronics.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

Hi,

I noticed that the 405 watchdog driver's ioctl() for GETPERIOD and SETPERIOD
are not working correctly. The ioctls pass the watchdog timer period in microseconds.
The variable wdt_period stores the current period in seconds.

The attached patch fixes this behavior.

Matthias

[-- Attachment #2: ppc405_wdt.p --]
[-- Type: text/plain, Size: 681 bytes --]

--- drivers/char/ppc405_wdt.c	Wed Jun  4 08:58:42 2003
+++ /usr/src/linuxppc_2_4_devel/drivers/char/ppc405_wdt.c	Tue Dec 24 06:00:15 2002
@@ -190,8 +190,7 @@
 			}
 		case WDIOC_GETPERIOD:
 			/* return watchdog period (units = microseconds) */
-			period = wdt_period * MICROSECBASE;
-
+			period = (wdt_period / HZ) * MICROSECBASE;
 			if (copy_to_user((unsigned long *)arg, &period,
 			    sizeof(period))) {
 				return -EFAULT;
@@ -234,7 +233,8 @@
 			if (period == 0)
 				period = MAXONEHOUR * MICROSECBASE;

-			wdt_period = period / MICROSECBASE;
+			heartbeat_count(0) = (period / TENMSBASE) +
+				(period % TENMSBASE ? 1 : 0);
 			ppc405wd_update_timer();

 			break;

             reply	other threads:[~2003-06-04  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-04  7:10 Matthias Fuchs [this message]
2003-06-04 13:06 ` patch against linuxppc_2_4_devel: ppc405_wdt.c needs to be fixed Kenneth Johansson
2003-06-04 13:51   ` Matthias Fuchs

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=3EDD9B7C.3080101@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.com \
    --cc=linuxppc-embedded@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).