From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Nat Gurumoorthy <natg@google.com>
Cc: Jean Delvare <khali@linux-fr.org>,
Wim Van Sebroeck <wim@iguana.be>,
Mike Waychison <mikew@google.com>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>
Subject: Re: [PATCH] Make all it87 drivers SMP safe.
Date: Tue, 5 Apr 2011 15:38:14 -0700 [thread overview]
Message-ID: <20110405223814.GA21350@ericsson.com> (raw)
In-Reply-To: <1302038697-28985-1-git-send-email-natg@google.com>
On Tue, Apr 05, 2011 at 05:24:57PM -0400, Nat Gurumoorthy wrote:
> There are 3 different drivers that touch the it87 hardware registers.
> The 3 drivers have been written independently and access the it87 hardware
> registers assuming they are the only driver accessing it. This change
> attempts to serialize access to the hardware by defining a global spinlock
> it87_io_lock in a file it87_lock.c. This lock has to be acquired by each
> of the it87 drivers before it can access the hardware. We have defined
> a new Kconfig option IT87_LOCK. When it is selected it87_lock.c is compiled
> into the kernel thereby making the lock global and accessable to the it87
> drivers which are typically built as loadable modules. All the it87 drivers
> select IT87_LOCK to compile the lock into the kernel.
> The routines accessing the hardware are being called from module init,
> open, ioctl and module exit routines and hence it is sufficient to use
> calls to spin_lock and spin_unlock to acquire and release the locks. For
> the same reasons it87_wdt.c has extensive changes to remove calls to
> spin_lock_irqsave and spin_unlock_irqrestore. The lock is now acquired
> in superio_enter and released in superio_exit. This is now identical
> to the code in drivers/hwmon/it87.c and drivers/watchdog/it8712f_wdt.c.
> Added __acquire and __release annotations wherever needed.
> ---
> drivers/hwmon/Kconfig | 1 +
> drivers/hwmon/it87.c | 14 ++++++++++++-
> drivers/watchdog/Kconfig | 12 +++++++++++
> drivers/watchdog/Makefile | 1 +
> drivers/watchdog/it8712f_wdt.c | 10 ++++----
> drivers/watchdog/it87_lock.c | 27 +++++++++++++++++++++++++
> drivers/watchdog/it87_wdt.c | 42 ++++++---------------------------------
> include/linux/it87_lock.h | 28 ++++++++++++++++++++++++++
> 8 files changed, 94 insertions(+), 41 deletions(-)
> create mode 100644 drivers/watchdog/it87_lock.c
> create mode 100644 include/linux/it87_lock.h
>
> Signed-off-by: Nat Gurumoorthy <natg@google.com>
>
Seems to me those should be separate patches, one per affected subsystem.
Guenter
next prev parent reply other threads:[~2011-04-05 22:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 21:24 [PATCH] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-04-05 22:38 ` Guenter Roeck [this message]
2011-04-05 23:05 ` Natarajan Gurumoorthy
[not found] ` <BANLkTimQDVYe53K-M173iQtmkHzKg6Djyg@mail.gmail.com>
2011-04-06 0:05 ` Guenter Roeck
2011-04-06 0:13 ` Natarajan Gurumoorthy
2011-04-06 0:43 ` Guenter Roeck
2011-04-06 2:50 ` Natarajan Gurumoorthy
2011-04-06 3:02 ` Guenter Roeck
2011-04-06 7:04 ` Natarajan Gurumoorthy
2011-04-06 21:35 ` Paul Gortmaker
2011-04-06 21:45 ` Natarajan Gurumoorthy
2011-04-06 7:19 ` Jean Delvare
2011-04-08 12:25 ` Alan Cox
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=20110405223814.GA21350@ericsson.com \
--to=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=natg@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