[lm-sensors] [PATCH v7 0/2] Make all it87 drivers SMP safe
natg at google.com
Mon Apr 18 20:58:47 CEST 2011
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"
02 - Chages to hwmon it87 driver to use "request_muxed_region"
drivers/hwmon/it87.c | 14 ++++-
drivers/watchdog/it8712f_wdt.c | 53 ++++++++++++------
drivers/watchdog/it87_wdt.c | 119 ++++++++++++++++++++++------------------
3 files changed, 113 insertions(+), 73 deletions(-)
Signed-off-by: Nat Gurumoorthy <natg at google.com>
- 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.
- 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.
- Remove unnecessary while from superio_enter.
- Remove extra braces in superio_enter routines.
- Totally abandon the spinlock based approach and use "request_muxed_region" to
hold off requestors if the resource is busy.
- More verbose patch headers. Add In-Reply-To: field.
More information about the lm-sensors