From: Nat Gurumoorthy <natg@google.com>
To: Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <guenter.roeck@ericsson.com>,
Wim Van Sebroeck <wim@iguana.be>
Cc: Mike Waychison <mikew@google.com>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
linux-watchdog@vger.kernel.org, Nat Gurumoorthy <natg@google.com>
Subject: [PATCH v5 2/2] Use "request_muxed_region" in it87 hwmon drivers
Date: Tue, 12 Apr 2011 13:50:18 -0700 [thread overview]
Message-ID: <1302641418-30304-1-git-send-email-natg@google.com> (raw)
In-Reply-To: <1302641290-30212-1-git-send-email-natg@google.com>
02 - Chages to hwmon it87 driver to use "request_muxed_region"
Serialize access to the hardware by using "request_muxed_region" macro defined
by Alan Cox. Call to this macro will hold off the requestor if the resource is
currently busy.
Signed-off-by: Nat Gurumoorthy <natg@google.com>
---
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 316b648..3945569 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -111,6 +111,11 @@ superio_select(int ldn)
static inline void
superio_enter(void)
{
+ /*
+ * Reserve REG and REG + 1 for exclusive access.
+ */
+ (void) request_muxed_region(REG, 2, DRVNAME);
+
outb(0x87, REG);
outb(0x01, REG);
outb(0x55, REG);
@@ -122,6 +127,7 @@ superio_exit(void)
{
outb(0x02, REG);
outb(0x02, VAL);
+ release_region(REG, 2);
}
/* Logical device 4 registers */
--
1.7.3.1
prev parent reply other threads:[~2011-04-12 20:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 20:48 [PATCH v5 0/2] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-04-12 20:49 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy
2011-04-13 6:50 ` [lm-sensors] " Hans de Goede
2011-04-13 8:05 ` Natarajan Gurumoorthy
2011-04-13 8:34 ` Jean Delvare
2011-04-13 17:59 ` Natarajan Gurumoorthy
2011-04-13 20:34 ` Jean Delvare
2011-04-14 9:25 ` Alan Cox
2011-04-14 17:58 ` Guenter Roeck
2011-04-13 7:03 ` Wim Van Sebroeck
2011-04-13 8:15 ` Natarajan Gurumoorthy
2011-04-13 9:29 ` Alan Cox
2011-04-14 19:00 ` Mike Waychison
2011-04-14 20:41 ` Alan Cox
2011-04-12 20:50 ` Nat Gurumoorthy [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=1302641418-30304-1-git-send-email-natg@google.com \
--to=natg@google.com \
--cc=guenter.roeck@ericsson.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=mikew@google.com \
--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).