From: Denis Turischev <denis@compulab.co.il>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Wim Van Sebroeck <wim@iguana.be>, Andrey Panin <pazke@centrinvest.ru>
Subject: SBC-FITPC2 watchdog driver fix
Date: Thu, 21 Jan 2010 16:10:07 +0200 [thread overview]
Message-ID: <4B58603F.5030407@compulab.co.il> (raw)
In-Reply-To: <4AF2B7D8.1010903@compulab.co.il>
sbc_fitpc2_wdt: fix I/O space access technique.
The mdelay function was used between I/O access commands, that causes peak
in CPU usage. Fix it by substitution mdelay to msleep.
Expand usage on fitPC2 compatible boards according to DMI identification.
Signed-off-by: Denis Turischev <denis@compulab.co.il>
diff -Nru linux-2.6.33-rc4.orig/drivers/watchdog/Kconfig linux-2.6.33-rc4/drivers/watchdog/Kconfig
--- linux-2.6.33-rc4.orig/drivers/watchdog/Kconfig 2010-01-13 07:15:00.000000000 +0200
+++ linux-2.6.33-rc4/drivers/watchdog/Kconfig 2010-01-20 13:47:18.000000000 +0200
@@ -396,8 +396,8 @@
tristate "Compulab SBC-FITPC2 watchdog"
depends on X86
---help---
- This is the driver for the built-in watchdog timer on the fit-PC2
- Single-board computer made by Compulab.
+ This is the driver for the built-in watchdog timer on the fit-PC2,
+ fit-PC2i, CM-iAM single-board computers made by Compulab.
It`s possible to enable watchdog timer either from BIOS (F2) or from booted Linux.
When "Watchdog Timer Value" enabled one can set 31-255 s operational range.
diff -Nru linux-2.6.33-rc4.orig/drivers/watchdog/sbc_fitpc2_wdt.c linux-2.6.33-rc4/drivers/watchdog/sbc_fitpc2_wdt.c
--- linux-2.6.33-rc4.orig/drivers/watchdog/sbc_fitpc2_wdt.c 2010-01-13 07:15:00.000000000 +0200
+++ linux-2.6.33-rc4/drivers/watchdog/sbc_fitpc2_wdt.c 2010-01-20 15:28:19.000000000 +0200
@@ -46,9 +46,9 @@
static void wdt_send_data(unsigned char command, unsigned char data)
{
outb(command, COMMAND_PORT);
- mdelay(100);
+ msleep(100);
outb(data, DATA_PORT);
- mdelay(200);
+ msleep(200);
}
static void wdt_enable(void)
@@ -202,11 +202,10 @@
{
int err;
- if (strcmp("SBC-FITPC2", dmi_get_system_info(DMI_BOARD_NAME))) {
- pr_info("board name is: %s. Should be SBC-FITPC2\n",
- dmi_get_system_info(DMI_BOARD_NAME));
+ if (!strstr(dmi_get_system_info(DMI_BOARD_NAME), "SBC-FITPC2"))
return -ENODEV;
- }
+
+ pr_info("%s found\n", dmi_get_system_info(DMI_BOARD_NAME));
if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
next prev parent reply other threads:[~2010-01-21 14:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-20 15:53 [PATCH] add SBC-FITPC2 watchdog driver Mike Rapoport
2009-07-20 16:43 ` Joe Perches
2009-07-21 4:34 ` [PATCH 0/3] drivers/watchdog: Use pr_<level> Joe Perches
2009-07-21 4:35 ` [PATCH 1/3] include/linux: kernel.h dynamic_debug.h device.h - Use section fmts Joe Perches
2009-07-21 4:35 ` [PATCH 2/3] drivers/watchdog: Convert printk(KERN_<level> to pr_<level>( Joe Perches
2009-07-21 4:35 ` [PATCH 3/3] drivers/watchdog: use pr_fmt Joe Perches
2009-11-05 11:32 ` SBC-FITPC2 watchdog driver fix Denis Turischev
2009-11-05 11:51 ` Wim Van Sebroeck
2010-01-21 14:10 ` Denis Turischev [this message]
2010-04-22 16:50 ` I/O operations order fix for SBC-FITPC2 watchdog Denis Turischev
2010-04-22 16:54 ` "scheduling while atomic" bug in " Denis Turischev
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=4B58603F.5030407@compulab.co.il \
--to=denis@compulab.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=pazke@centrinvest.ru \
--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