linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 0/2] Make all it87 drivers SMP safe
@ 2011-05-09 18:44 Nat Gurumoorthy
  2011-05-09 18:45 ` [PATCH v10 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy
  2011-05-09 18:45 ` [PATCH v10 2/2] Use "request_muxed_region" in it87 hwmon drivers Nat Gurumoorthy
  0 siblings, 2 replies; 9+ messages in thread
From: Nat Gurumoorthy @ 2011-05-09 18:44 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck, lm-sensors,
	linux-kernel
  Cc: mikew, 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 using
"request_muxed_region" macro defined by Alan Cox. Call to this macro
will hold off the requestor if the resource is currently busy.
The use of the above macro makes it possible to get rid of
spinlocks in it8712f_wdt.c and it87_wdt.c watchdog drivers.
This also greatly simplifies the implementation of it87_wdt.c driver.

01 - Changes to it87 watchdog driver to use "request_muxed_region"
 drivers/watchdog/it8712f_wdt.c
 drivers/watchdog/it87_wdt.c

02 - Chages to hwmon it87 driver to use "request_muxed_region"
 drivers/hwmon/it87.c

 drivers/hwmon/it87.c           |   31 +++++---
 drivers/watchdog/it8712f_wdt.c |   62 +++++++++++----
 drivers/watchdog/it87_wdt.c    |  169 +++++++++++++++++++++------------------
 3 files changed, 155 insertions(+), 107 deletions(-)

Signed-off-by: Nat Gurumoorthy <natg@google.com>

Patch History:
v10:
- More clean up in drivers/watchdog/it87_wdt.c in it87_wdt_init
  and it87_wdt_ioctl routines.

v9:
- More clean up in drivers/hwmon/it87.c. More fixes that of
  the type in V8 that got missed in drivers/watchdog/it8712f_wdt.c.

v8:
- Return the error actually returned by superio_enter and not -EBUSY.
  Notifier routines return NOTIFY_DONE even if underlying calls from
  notifier to routines that invoke superio_enter return with error.
  Make sure release routines returns do proper clean up even if calls to
  superio_enter fail.

v7:
- superio_enter return error if call to "request_muxed_region" fails. Rest
  of the changes deal with error returns from superio_enter. Changes to
  it87_wdt.c are untested.

v6:
- Pay attention to value returned by request_muxed_region. The first call to
  request_muxed_region will attempt 10 times to reserve the region before it
  gives up. This will typically get called from the driver init routines. If this
  succeeds then subsequent calls wait forever for the resource to be available.

v5:
- Remove unnecessary while from superio_enter.

v4:
- Remove extra braces in superio_enter routines.

v3:
- Totally abandon the spinlock based approach and use "request_muxed_region" to
  hold off requestors if the resource is busy.

v2:
- More verbose patch headers. Add In-Reply-To: field.


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

end of thread, other threads:[~2011-05-12 12:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 18:44 [PATCH v10 0/2] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-05-09 18:45 ` [PATCH v10 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy
2011-05-11  2:52   ` Guenter Roeck
2011-05-09 18:45 ` [PATCH v10 2/2] Use "request_muxed_region" in it87 hwmon drivers Nat Gurumoorthy
2011-05-11  2:53   ` Guenter Roeck
2011-05-11  7:00     ` Jean Delvare
2011-05-11 13:52       ` Guenter Roeck
2011-05-11 19:35       ` Alan Cox
2011-05-12 12:01   ` Jean Delvare

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