linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Make all it87 drivers SMP safe.
@ 2011-04-07 21:26 Nat Gurumoorthy
  2011-04-08  0:37 ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Nat Gurumoorthy @ 2011-04-07 21:26 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck
  Cc: Mike Waychison, lm-sensors, linux-kernel, linux-watchdog,
	Nat Gurumoorthy

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.

01 - Adds the relevant lock files.
 drivers/watchdog/Kconfig
 drivers/watchdog/Makefile
 drivers/watchdog/it87_lock.c
 include/linux/it87_lock.h

02 - Adds changes to watchdog drivers to use the new lock.
 drivers/watchdog/it8712f_wdt.c
 drivers/watchdog/it87_wdt.c

03 - Adds changes to hwmon driver to use the new lock.
 drivers/hwmon/Kconfig
 drivers/hwmon/it87.c


 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, 96 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-08  6:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-07 21:26 [PATCH v2 0/3] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-04-08  0:37 ` Guenter Roeck
2011-04-08  4:58   ` Natarajan Gurumoorthy
2011-04-08  6:02     ` Guenter Roeck

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).