* [lm-sensors] (no subject) @ 2005-05-29 14:39 John WICKS 2008-09-23 13:29 ` gaming ` (9 more replies) 0 siblings, 10 replies; 30+ messages in thread From: John WICKS @ 2005-05-29 14:39 UTC (permalink / raw) To: lm-sensors G'day gentlemen/women, please excuse any fumbling questions as I am new to Linux sensors-detect failed to see my SMbus, I have a Dell Inspiron 8500 laptop with an Intel 82801 DBM SMbus controller (ICH4-M) my question is do I use/will the i801 driver work? and what is the best way to get it to work? would Ilja Rauhut's p4b hack do the trick? any lead would be greatfully appreciated regards kensai -- * John Wicks kensai@tassie.net.au Ph: +61 3 6343 4358* ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS @ 2008-09-23 13:29 ` gaming 2011-05-04 7:03 ` Jeremy Harmon ` (8 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: gaming @ 2008-09-23 13:29 UTC (permalink / raw) To: lm-sensors Hi together, with this email I want to request the driver for the AMD Phenom / K10 as stated on your website: > (2007-10-07) To be written. Please contact us if you have such CPU and > willing to write or test the driver. Currenty I am using a Gentoo Linux x64 with a 2.6.25 kernel (gentoo-sources-2.6.25-r7), the system is running on a Phenom X3 8600 and Asus M2N-VM HDMI mainboard (which works quite well with the kernel's it87 driver). Please let me know if I can participate in the beta test program and if there are special requirements I need to fulfil. Thank you very much for your reply. Rgds Marcus Wiedemann _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS 2008-09-23 13:29 ` gaming @ 2011-05-04 7:03 ` Jeremy Harmon 2011-05-10 18:53 ` Jeremy Harmon ` (7 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: Jeremy Harmon @ 2011-05-04 7:03 UTC (permalink / raw) To: lm-sensors http://foto-licious.com/wp-content/themes/default/friends.html _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS 2008-09-23 13:29 ` gaming 2011-05-04 7:03 ` Jeremy Harmon @ 2011-05-10 18:53 ` Jeremy Harmon 2011-11-26 18:26 ` su_pyrow ` (6 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: Jeremy Harmon @ 2011-05-10 18:53 UTC (permalink / raw) To: lm-sensors http://ervianto.com/wp-content/themes/twentyten/work.html _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (2 preceding siblings ...) 2011-05-10 18:53 ` Jeremy Harmon @ 2011-11-26 18:26 ` su_pyrow 2011-12-08 18:31 ` Guenter Roeck ` (5 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: su_pyrow @ 2011-11-26 18:26 UTC (permalink / raw) To: lm-sensors [-- Attachment #1.1: Type: text/plain, Size: 83 bytes --] http://realdealcasinoparty.com/components/com_ag_google_analytics2/html.php?html143 [-- Attachment #1.2: Type: text/html, Size: 206 bytes --] [-- Attachment #2: Type: text/plain, Size: 153 bytes --] _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (3 preceding siblings ...) 2011-11-26 18:26 ` su_pyrow @ 2011-12-08 18:31 ` Guenter Roeck 2011-12-08 18:36 ` Guenter Roeck ` (4 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2011-12-08 18:31 UTC (permalink / raw) To: lm-sensors Fix checkpatch errors and warnings, rename attributes to use standardized names, fix rpm mode value range, and initialize pwm_mode and pwm_enable if there is not platform data. If we agree on this set of patches, the pending patches to add support for F75383 should probably be applied on top of it. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (4 preceding siblings ...) 2011-12-08 18:31 ` Guenter Roeck @ 2011-12-08 18:36 ` Guenter Roeck 2012-11-07 20:09 ` 郭�园 ` (3 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2011-12-08 18:36 UTC (permalink / raw) To: lm-sensors On Thu, 2011-12-08 at 13:31 -0500, Guenter Roeck wrote: > Fix checkpatch errors and warnings, rename attributes to use standardized names, > fix rpm mode value range, and initialize pwm_mode and pwm_enable if there is not > platform data. > > If we agree on this set of patches, the pending patches to add support for > F75383 should probably be applied on top of it. > Oops .. I'll resend the series with proper subject. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (5 preceding siblings ...) 2011-12-08 18:36 ` Guenter Roeck @ 2012-11-07 20:09 ` 郭�园 2012-12-04 7:22 ` Dok Sander ` (2 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: 郭�园 @ 2012-11-07 20:09 UTC (permalink / raw) To: lm-sensors _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (6 preceding siblings ...) 2012-11-07 20:09 ` 郭�园 @ 2012-12-04 7:22 ` Dok Sander 2013-08-23 23:53 ` Robert Hinson 2013-10-29 17:51 ` morgan chong 9 siblings, 0 replies; 30+ messages in thread From: Dok Sander @ 2012-12-04 7:22 UTC (permalink / raw) To: lm-sensors [-- Attachment #1.1: Type: text/plain, Size: 65 bytes --] http://thesoulofthebay.com/wp-content/themes/listings/google.html [-- Attachment #1.2: Type: text/html, Size: 344 bytes --] [-- Attachment #2: Type: text/plain, Size: 153 bytes --] _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (7 preceding siblings ...) 2012-12-04 7:22 ` Dok Sander @ 2013-08-23 23:53 ` Robert Hinson 2013-10-29 17:51 ` morgan chong 9 siblings, 0 replies; 30+ messages in thread From: Robert Hinson @ 2013-08-23 23:53 UTC (permalink / raw) To: lm-sensors CvCfmo0KU2VudCBmcm9tIG15IGlQb2QKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX18KbG0tc2Vuc29ycyBtYWlsaW5nIGxpc3QKbG0tc2Vuc29yc0BsbS1zZW5z b3JzLm9yZwpodHRwOi8vbGlzdHMubG0tc2Vuc29ycy5vcmcvbWFpbG1hbi9saXN0aW5mby9sbS1z ZW5zb3Jz ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS ` (8 preceding siblings ...) 2013-08-23 23:53 ` Robert Hinson @ 2013-10-29 17:51 ` morgan chong 9 siblings, 0 replies; 30+ messages in thread From: morgan chong @ 2013-10-29 17:51 UTC (permalink / raw) To: lm-sensors I have an MSI FM2-A55M-E33 Micro ATX FM2 Motherboard and I'm told it has a Fintek F71868AD sensor chip. ANy plans/ideas when lm-sensors might have support for this? Thanks. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* (no subject) 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS @ 2011-05-06 18:52 ` Nat Gurumoorthy 2011-05-04 7:03 ` Jeremy Harmon ` (8 subsequent siblings) 9 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:52 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 | 14 +++- drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- 3 files changed, 152 insertions(+), 87 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c Signed-off-by: Nat Gurumoorthy <natg@google.com> Patch History: 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] 30+ messages in thread
* [lm-sensors] (no subject) @ 2011-05-06 18:52 ` Nat Gurumoorthy 0 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:52 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 | 14 +++- drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- 3 files changed, 152 insertions(+), 87 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c Signed-off-by: Nat Gurumoorthy <natg@google.com> Patch History: 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. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v8 1/2] Use "request_muxed_region" in it87 watchdog drivers 2011-05-06 18:52 ` [lm-sensors] (no subject) Nat Gurumoorthy @ 2011-05-06 18:54 ` Nat Gurumoorthy -1 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:54 UTC (permalink / raw) To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck, lm-sensors, linux-kernel Cc: mikew, Nat Gurumoorthy 01 - Changes to it87 watchdog 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. 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. "superio_enter" will return an error if call to "request_muxed_region" fails. Rest of the code change is to ripple an error return from superio_enter to the top level. Signed-off-by: Nat Gurumoorthy <natg@google.com> --- diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index 6143f52..84447d9 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c @@ -51,7 +51,6 @@ MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); static unsigned long wdt_open; static unsigned expect_close; -static spinlock_t io_lock; static unsigned char revision; /* Dog Food address - We use the game port address */ @@ -121,20 +120,27 @@ static inline void superio_select(int ldn) outb(ldn, VAL); } -static inline void superio_enter(void) +static inline int +superio_enter(void) { - spin_lock(&io_lock); + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, NAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); - spin_unlock(&io_lock); + release_region(REG, 2); } static inline void it8712f_wdt_ping(void) @@ -173,10 +179,13 @@ static int it8712f_wdt_get_status(void) return 0; } -static void it8712f_wdt_enable(void) +static int it8712f_wdt_enable(void) { + int ret = superio_enter(); + if (ret) + return ret; + printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); - superio_enter(); superio_select(LDN_GPIO); superio_outb(wdt_control_reg, WDT_CONTROL); @@ -186,13 +195,18 @@ static void it8712f_wdt_enable(void) superio_exit(); it8712f_wdt_ping(); + + return 0; } -static void it8712f_wdt_disable(void) +static int it8712f_wdt_disable(void) { - printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); + int ret = superio_enter(); + + if (ret) + return ret; - superio_enter(); + printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); superio_select(LDN_GPIO); superio_outb(0, WDT_CONFIG); @@ -202,6 +216,7 @@ static void it8712f_wdt_disable(void) superio_outb(0, WDT_TIMEOUT); superio_exit(); + return 0; } static int it8712f_wdt_notify(struct notifier_block *this, @@ -252,6 +267,7 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, WDIOF_MAGICCLOSE, }; int value; + int ret; switch (cmd) { case WDIOC_GETSUPPORT: @@ -259,7 +275,9 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, return -EFAULT; return 0; case WDIOC_GETSTATUS: - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(LDN_GPIO); value = it8712f_wdt_get_status(); @@ -280,7 +298,9 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, if (value > (max_units * 60)) return -EINVAL; margin = value; - superio_enter(); + ret = superio_enter(); + if (ret) + return -EBUSY; superio_select(LDN_GPIO); it8712f_wdt_update_margin(); @@ -299,10 +319,14 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, static int it8712f_wdt_open(struct inode *inode, struct file *file) { + int ret; /* only allow one at a time */ if (test_and_set_bit(0, &wdt_open)) return -EBUSY; - it8712f_wdt_enable(); + + ret = it8712f_wdt_enable(); + if (ret) + return ret; return nonseekable_open(inode, file); } @@ -313,7 +337,8 @@ static int it8712f_wdt_release(struct inode *inode, struct file *file) ": watchdog device closed unexpectedly, will not" " disable the watchdog timer\n"); } else if (!nowayout) { - it8712f_wdt_disable(); + if (it8712f_wdt_disable()) + printk(KERN_WARNING NAME "Watchdog disable failed\n"); } expect_close = 0; clear_bit(0, &wdt_open); @@ -340,8 +365,10 @@ static int __init it8712f_wdt_find(unsigned short *address) { int err = -ENODEV; int chip_type; + int ret = superio_enter(); + if (ret) + return ret; - superio_enter(); chip_type = superio_inw(DEVID); if (chip_type != IT8712F_DEVID) goto exit; @@ -382,8 +409,6 @@ static int __init it8712f_wdt_init(void) { int err = 0; - spin_lock_init(&io_lock); - if (it8712f_wdt_find(&address)) return -ENODEV; @@ -392,7 +417,8 @@ static int __init it8712f_wdt_init(void) return -EBUSY; } - it8712f_wdt_disable(); + if (it8712f_wdt_disable()) + return -EBUSY; err = register_reboot_notifier(&it8712f_wdt_notifier); if (err) { diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index b1bc72f..4def56d 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c @@ -137,7 +137,6 @@ static unsigned int base, gpact, ciract, max_units, chip_type; static unsigned long wdt_status; -static DEFINE_SPINLOCK(spinlock); static int nogameport = DEFAULT_NOGAMEPORT; static int exclusive = DEFAULT_EXCLUSIVE; @@ -163,18 +162,27 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started, default=" /* Superio Chip */ -static inline void superio_enter(void) +static inline int +superio_enter(void) { + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, WATCHDOG_NAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); + release_region(REG, 2); } static inline void superio_select(int ldn) @@ -255,12 +263,11 @@ static void wdt_keepalive(void) set_bit(WDTS_KEEPALIVE, &wdt_status); } -static void wdt_start(void) +static int wdt_start(void) { - unsigned long flags; - - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); if (test_bit(WDTS_USE_GP, &wdt_status)) @@ -270,15 +277,15 @@ static void wdt_start(void) wdt_update_timeout(); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); + + return 0; } -static void wdt_stop(void) +static int wdt_stop(void) { - unsigned long flags; - - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); superio_outb(0x00, WDTCTRL); @@ -288,7 +295,7 @@ static void wdt_stop(void) superio_outb(0x00, WDTVALMSB); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); + return 0; } /** @@ -303,8 +310,6 @@ static void wdt_stop(void) static int wdt_set_timeout(int t) { - unsigned long flags; - if (t < 1 || t > max_units * 60) return -EINVAL; @@ -313,14 +318,15 @@ static int wdt_set_timeout(int t) else timeout = t; - spin_lock_irqsave(&spinlock, flags); if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; + superio_select(GPIO); wdt_update_timeout(); superio_exit(); } - spin_unlock_irqrestore(&spinlock, flags); return 0; } @@ -339,12 +345,12 @@ static int wdt_set_timeout(int t) static int wdt_get_status(int *status) { - unsigned long flags; - *status = 0; if (testmode) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; + superio_select(GPIO); if (superio_inb(WDTCTRL) & WDT_ZERO) { superio_outb(0x00, WDTCTRL); @@ -353,7 +359,6 @@ static int wdt_get_status(int *status) } superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } if (test_and_clear_bit(WDTS_KEEPALIVE, &wdt_status)) *status |= WDIOF_KEEPALIVEPING; @@ -379,9 +384,17 @@ static int wdt_open(struct inode *inode, struct file *file) if (exclusive && test_and_set_bit(WDTS_DEV_OPEN, &wdt_status)) return -EBUSY; if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret; if (nowayout && !test_and_set_bit(WDTS_LOCKED, &wdt_status)) __module_get(THIS_MODULE); - wdt_start(); + + ret = wdt_start(); + if (ret) { + clear_bit(WDTS_LOCKED, &wdt_status); + clear_bit(WDTS_TIMER_RUN, &wdt_status); + clear_bit(WDTS_DEV_OPEN, &wdt_status); + return ret; + } } return nonseekable_open(inode, file); } @@ -403,7 +416,16 @@ static int wdt_release(struct inode *inode, struct file *file) { if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { if (test_and_clear_bit(WDTS_EXPECTED, &wdt_status)) { - wdt_stop(); + int ret = wdt_stop(); + if (ret) { + /* + * Stop failed. Just keep the watchdog alive + * and hope nothing bad happens. + */ + set_bit(WDTS_EXPECTED, &wdt_status); + wdt_keepalive(); + return ret; + } clear_bit(WDTS_TIMER_RUN, &wdt_status); } else { wdt_keepalive(); @@ -484,7 +506,8 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) &ident, sizeof(ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: - wdt_get_status(&status); + if (wdt_get_status(&status)) + return -EBUSY; return put_user(status, uarg.i); case WDIOC_GETBOOTSTATUS: @@ -500,14 +523,22 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) switch (new_options) { case WDIOS_DISABLECARD: - if (test_bit(WDTS_TIMER_RUN, &wdt_status)) - wdt_stop(); + if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret = wdt_stop(); + if (ret) + return ret; + } clear_bit(WDTS_TIMER_RUN, &wdt_status); return 0; case WDIOS_ENABLECARD: - if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) - wdt_start(); + if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret = wdt_start(); + if (ret) { + clear_bit(WDTS_TIMER_RUN, &wdt_status); + return ret; + } + } return 0; default: @@ -560,16 +591,17 @@ static int __init it87_wdt_init(void) int rc = 0; int try_gameport = !nogameport; u8 chip_rev; - unsigned long flags; + int ret; wdt_status = 0; - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + chip_type = superio_inw(CHIPID); chip_rev = superio_inb(CHIPREV) & 0x0f; superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); switch (chip_type) { case IT8702_ID: @@ -603,8 +635,9 @@ static int __init it87_wdt_init(void) return -ENODEV; } - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); superio_outb(WDT_TOV1, WDTCFG); @@ -621,18 +654,17 @@ static int __init it87_wdt_init(void) gpact = superio_inb(ACTREG); superio_outb(0x01, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); if (request_region(base, 1, WATCHDOG_NAME)) set_bit(WDTS_USE_GP, &wdt_status); else rc = -EIO; } else { superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } /* If we haven't Gameport support, try to get CIR support */ if (!test_bit(WDTS_USE_GP, &wdt_status)) { + int ret; if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { if (rc == -EIO) printk(KERN_ERR PFX @@ -646,8 +678,9 @@ static int __init it87_wdt_init(void) goto err_out; } base = CIR_BASE; - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(CIR); superio_outw(base, BASEREG); @@ -660,7 +693,6 @@ static int __init it87_wdt_init(void) } superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } if (timeout < 1 || timeout > max_units * 60) { @@ -711,21 +743,23 @@ err_out_reboot: err_out_region: release_region(base, test_bit(WDTS_USE_GP, &wdt_status) ? 1 : 8); if (!test_bit(WDTS_USE_GP, &wdt_status)) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + superio_select(CIR); superio_outb(ciract, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } err_out: if (try_gameport) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + superio_select(GAMEPORT); superio_outb(gpact, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } return rc; @@ -733,27 +767,22 @@ err_out: static void __exit it87_wdt_exit(void) { - unsigned long flags; - int nolock; - - nolock = !spin_trylock_irqsave(&spinlock, flags); - superio_enter(); - superio_select(GPIO); - superio_outb(0x00, WDTCTRL); - superio_outb(0x00, WDTCFG); - superio_outb(0x00, WDTVALLSB); - if (max_units > 255) - superio_outb(0x00, WDTVALMSB); - if (test_bit(WDTS_USE_GP, &wdt_status)) { - superio_select(GAMEPORT); - superio_outb(gpact, ACTREG); - } else { - superio_select(CIR); - superio_outb(ciract, ACTREG); + if (superio_enter() == 0) { + superio_select(GPIO); + superio_outb(0x00, WDTCTRL); + superio_outb(0x00, WDTCFG); + superio_outb(0x00, WDTVALLSB); + if (max_units > 255) + superio_outb(0x00, WDTVALMSB); + if (test_bit(WDTS_USE_GP, &wdt_status)) { + superio_select(GAMEPORT); + superio_outb(gpact, ACTREG); + } else { + superio_select(CIR); + superio_outb(ciract, ACTREG); + } + superio_exit(); } - superio_exit(); - if (!nolock) - spin_unlock_irqrestore(&spinlock, flags); misc_deregister(&wdt_miscdev); unregister_reboot_notifier(&wdt_notifier); ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [lm-sensors] [PATCH v8 1/2] Use "request_muxed_region" in it87 @ 2011-05-06 18:54 ` Nat Gurumoorthy 0 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:54 UTC (permalink / raw) To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck, lm-sensors, linux-kernel Cc: mikew, Nat Gurumoorthy 01 - Changes to it87 watchdog 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. 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. "superio_enter" will return an error if call to "request_muxed_region" fails. Rest of the code change is to ripple an error return from superio_enter to the top level. Signed-off-by: Nat Gurumoorthy <natg@google.com> --- diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index 6143f52..84447d9 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c @@ -51,7 +51,6 @@ MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); static unsigned long wdt_open; static unsigned expect_close; -static spinlock_t io_lock; static unsigned char revision; /* Dog Food address - We use the game port address */ @@ -121,20 +120,27 @@ static inline void superio_select(int ldn) outb(ldn, VAL); } -static inline void superio_enter(void) +static inline int +superio_enter(void) { - spin_lock(&io_lock); + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, NAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); - spin_unlock(&io_lock); + release_region(REG, 2); } static inline void it8712f_wdt_ping(void) @@ -173,10 +179,13 @@ static int it8712f_wdt_get_status(void) return 0; } -static void it8712f_wdt_enable(void) +static int it8712f_wdt_enable(void) { + int ret = superio_enter(); + if (ret) + return ret; + printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); - superio_enter(); superio_select(LDN_GPIO); superio_outb(wdt_control_reg, WDT_CONTROL); @@ -186,13 +195,18 @@ static void it8712f_wdt_enable(void) superio_exit(); it8712f_wdt_ping(); + + return 0; } -static void it8712f_wdt_disable(void) +static int it8712f_wdt_disable(void) { - printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); + int ret = superio_enter(); + + if (ret) + return ret; - superio_enter(); + printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); superio_select(LDN_GPIO); superio_outb(0, WDT_CONFIG); @@ -202,6 +216,7 @@ static void it8712f_wdt_disable(void) superio_outb(0, WDT_TIMEOUT); superio_exit(); + return 0; } static int it8712f_wdt_notify(struct notifier_block *this, @@ -252,6 +267,7 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, WDIOF_MAGICCLOSE, }; int value; + int ret; switch (cmd) { case WDIOC_GETSUPPORT: @@ -259,7 +275,9 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, return -EFAULT; return 0; case WDIOC_GETSTATUS: - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(LDN_GPIO); value = it8712f_wdt_get_status(); @@ -280,7 +298,9 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, if (value > (max_units * 60)) return -EINVAL; margin = value; - superio_enter(); + ret = superio_enter(); + if (ret) + return -EBUSY; superio_select(LDN_GPIO); it8712f_wdt_update_margin(); @@ -299,10 +319,14 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, static int it8712f_wdt_open(struct inode *inode, struct file *file) { + int ret; /* only allow one at a time */ if (test_and_set_bit(0, &wdt_open)) return -EBUSY; - it8712f_wdt_enable(); + + ret = it8712f_wdt_enable(); + if (ret) + return ret; return nonseekable_open(inode, file); } @@ -313,7 +337,8 @@ static int it8712f_wdt_release(struct inode *inode, struct file *file) ": watchdog device closed unexpectedly, will not" " disable the watchdog timer\n"); } else if (!nowayout) { - it8712f_wdt_disable(); + if (it8712f_wdt_disable()) + printk(KERN_WARNING NAME "Watchdog disable failed\n"); } expect_close = 0; clear_bit(0, &wdt_open); @@ -340,8 +365,10 @@ static int __init it8712f_wdt_find(unsigned short *address) { int err = -ENODEV; int chip_type; + int ret = superio_enter(); + if (ret) + return ret; - superio_enter(); chip_type = superio_inw(DEVID); if (chip_type != IT8712F_DEVID) goto exit; @@ -382,8 +409,6 @@ static int __init it8712f_wdt_init(void) { int err = 0; - spin_lock_init(&io_lock); - if (it8712f_wdt_find(&address)) return -ENODEV; @@ -392,7 +417,8 @@ static int __init it8712f_wdt_init(void) return -EBUSY; } - it8712f_wdt_disable(); + if (it8712f_wdt_disable()) + return -EBUSY; err = register_reboot_notifier(&it8712f_wdt_notifier); if (err) { diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index b1bc72f..4def56d 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c @@ -137,7 +137,6 @@ static unsigned int base, gpact, ciract, max_units, chip_type; static unsigned long wdt_status; -static DEFINE_SPINLOCK(spinlock); static int nogameport = DEFAULT_NOGAMEPORT; static int exclusive = DEFAULT_EXCLUSIVE; @@ -163,18 +162,27 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started, default=" /* Superio Chip */ -static inline void superio_enter(void) +static inline int +superio_enter(void) { + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, WATCHDOG_NAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); + release_region(REG, 2); } static inline void superio_select(int ldn) @@ -255,12 +263,11 @@ static void wdt_keepalive(void) set_bit(WDTS_KEEPALIVE, &wdt_status); } -static void wdt_start(void) +static int wdt_start(void) { - unsigned long flags; - - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); if (test_bit(WDTS_USE_GP, &wdt_status)) @@ -270,15 +277,15 @@ static void wdt_start(void) wdt_update_timeout(); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); + + return 0; } -static void wdt_stop(void) +static int wdt_stop(void) { - unsigned long flags; - - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); superio_outb(0x00, WDTCTRL); @@ -288,7 +295,7 @@ static void wdt_stop(void) superio_outb(0x00, WDTVALMSB); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); + return 0; } /** @@ -303,8 +310,6 @@ static void wdt_stop(void) static int wdt_set_timeout(int t) { - unsigned long flags; - if (t < 1 || t > max_units * 60) return -EINVAL; @@ -313,14 +318,15 @@ static int wdt_set_timeout(int t) else timeout = t; - spin_lock_irqsave(&spinlock, flags); if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; + superio_select(GPIO); wdt_update_timeout(); superio_exit(); } - spin_unlock_irqrestore(&spinlock, flags); return 0; } @@ -339,12 +345,12 @@ static int wdt_set_timeout(int t) static int wdt_get_status(int *status) { - unsigned long flags; - *status = 0; if (testmode) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + int ret = superio_enter(); + if (ret) + return ret; + superio_select(GPIO); if (superio_inb(WDTCTRL) & WDT_ZERO) { superio_outb(0x00, WDTCTRL); @@ -353,7 +359,6 @@ static int wdt_get_status(int *status) } superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } if (test_and_clear_bit(WDTS_KEEPALIVE, &wdt_status)) *status |= WDIOF_KEEPALIVEPING; @@ -379,9 +384,17 @@ static int wdt_open(struct inode *inode, struct file *file) if (exclusive && test_and_set_bit(WDTS_DEV_OPEN, &wdt_status)) return -EBUSY; if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret; if (nowayout && !test_and_set_bit(WDTS_LOCKED, &wdt_status)) __module_get(THIS_MODULE); - wdt_start(); + + ret = wdt_start(); + if (ret) { + clear_bit(WDTS_LOCKED, &wdt_status); + clear_bit(WDTS_TIMER_RUN, &wdt_status); + clear_bit(WDTS_DEV_OPEN, &wdt_status); + return ret; + } } return nonseekable_open(inode, file); } @@ -403,7 +416,16 @@ static int wdt_release(struct inode *inode, struct file *file) { if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { if (test_and_clear_bit(WDTS_EXPECTED, &wdt_status)) { - wdt_stop(); + int ret = wdt_stop(); + if (ret) { + /* + * Stop failed. Just keep the watchdog alive + * and hope nothing bad happens. + */ + set_bit(WDTS_EXPECTED, &wdt_status); + wdt_keepalive(); + return ret; + } clear_bit(WDTS_TIMER_RUN, &wdt_status); } else { wdt_keepalive(); @@ -484,7 +506,8 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) &ident, sizeof(ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: - wdt_get_status(&status); + if (wdt_get_status(&status)) + return -EBUSY; return put_user(status, uarg.i); case WDIOC_GETBOOTSTATUS: @@ -500,14 +523,22 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) switch (new_options) { case WDIOS_DISABLECARD: - if (test_bit(WDTS_TIMER_RUN, &wdt_status)) - wdt_stop(); + if (test_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret = wdt_stop(); + if (ret) + return ret; + } clear_bit(WDTS_TIMER_RUN, &wdt_status); return 0; case WDIOS_ENABLECARD: - if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) - wdt_start(); + if (!test_and_set_bit(WDTS_TIMER_RUN, &wdt_status)) { + int ret = wdt_start(); + if (ret) { + clear_bit(WDTS_TIMER_RUN, &wdt_status); + return ret; + } + } return 0; default: @@ -560,16 +591,17 @@ static int __init it87_wdt_init(void) int rc = 0; int try_gameport = !nogameport; u8 chip_rev; - unsigned long flags; + int ret; wdt_status = 0; - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + chip_type = superio_inw(CHIPID); chip_rev = superio_inb(CHIPREV) & 0x0f; superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); switch (chip_type) { case IT8702_ID: @@ -603,8 +635,9 @@ static int __init it87_wdt_init(void) return -ENODEV; } - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(GPIO); superio_outb(WDT_TOV1, WDTCFG); @@ -621,18 +654,17 @@ static int __init it87_wdt_init(void) gpact = superio_inb(ACTREG); superio_outb(0x01, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); if (request_region(base, 1, WATCHDOG_NAME)) set_bit(WDTS_USE_GP, &wdt_status); else rc = -EIO; } else { superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } /* If we haven't Gameport support, try to get CIR support */ if (!test_bit(WDTS_USE_GP, &wdt_status)) { + int ret; if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { if (rc = -EIO) printk(KERN_ERR PFX @@ -646,8 +678,9 @@ static int __init it87_wdt_init(void) goto err_out; } base = CIR_BASE; - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; superio_select(CIR); superio_outw(base, BASEREG); @@ -660,7 +693,6 @@ static int __init it87_wdt_init(void) } superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } if (timeout < 1 || timeout > max_units * 60) { @@ -711,21 +743,23 @@ err_out_reboot: err_out_region: release_region(base, test_bit(WDTS_USE_GP, &wdt_status) ? 1 : 8); if (!test_bit(WDTS_USE_GP, &wdt_status)) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + superio_select(CIR); superio_outb(ciract, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } err_out: if (try_gameport) { - spin_lock_irqsave(&spinlock, flags); - superio_enter(); + ret = superio_enter(); + if (ret) + return ret; + superio_select(GAMEPORT); superio_outb(gpact, ACTREG); superio_exit(); - spin_unlock_irqrestore(&spinlock, flags); } return rc; @@ -733,27 +767,22 @@ err_out: static void __exit it87_wdt_exit(void) { - unsigned long flags; - int nolock; - - nolock = !spin_trylock_irqsave(&spinlock, flags); - superio_enter(); - superio_select(GPIO); - superio_outb(0x00, WDTCTRL); - superio_outb(0x00, WDTCFG); - superio_outb(0x00, WDTVALLSB); - if (max_units > 255) - superio_outb(0x00, WDTVALMSB); - if (test_bit(WDTS_USE_GP, &wdt_status)) { - superio_select(GAMEPORT); - superio_outb(gpact, ACTREG); - } else { - superio_select(CIR); - superio_outb(ciract, ACTREG); + if (superio_enter() = 0) { + superio_select(GPIO); + superio_outb(0x00, WDTCTRL); + superio_outb(0x00, WDTCFG); + superio_outb(0x00, WDTVALLSB); + if (max_units > 255) + superio_outb(0x00, WDTVALMSB); + if (test_bit(WDTS_USE_GP, &wdt_status)) { + superio_select(GAMEPORT); + superio_outb(gpact, ACTREG); + } else { + superio_select(CIR); + superio_outb(ciract, ACTREG); + } + superio_exit(); } - superio_exit(); - if (!nolock) - spin_unlock_irqrestore(&spinlock, flags); misc_deregister(&wdt_miscdev); unregister_reboot_notifier(&wdt_notifier); _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v8 2/2] Use "request_muxed_region" in it87 hwmon drivers 2011-05-06 18:52 ` [lm-sensors] (no subject) Nat Gurumoorthy @ 2011-05-06 18:55 ` Nat Gurumoorthy -1 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:55 UTC (permalink / raw) To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck, lm-sensors, linux-kernel Cc: mikew, Nat Gurumoorthy 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. "superio_enter" will return an error if call to "request_muxed_region" fails. Rest of the code change is to ripple an error return from superio_enter to the top level. Signed-off-by: Nat Gurumoorthy <natg@google.com> --- diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 316b648..fa3ff02 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -108,13 +108,20 @@ superio_select(int ldn) outb(ldn, VAL); } -static inline void +static inline int superio_enter(void) { + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, DRVNAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void @@ -122,6 +129,7 @@ superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); + release_region(REG, 2); } /* Logical device 4 registers */ @@ -1546,7 +1554,9 @@ static int __init it87_find(unsigned short *address, u16 chip_type; const char *board_vendor, *board_name; - superio_enter(); + if (superio_enter()) + return -EBUSY; + chip_type = force_id ? force_id : superio_inw(DEVID); switch (chip_type) { -- 1.7.3.1 ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [lm-sensors] [PATCH v8 2/2] Use "request_muxed_region" in it87 @ 2011-05-06 18:55 ` Nat Gurumoorthy 0 siblings, 0 replies; 30+ messages in thread From: Nat Gurumoorthy @ 2011-05-06 18:55 UTC (permalink / raw) To: Jean Delvare, Guenter Roeck, Wim Van Sebroeck, lm-sensors, linux-kernel Cc: mikew, Nat Gurumoorthy 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. "superio_enter" will return an error if call to "request_muxed_region" fails. Rest of the code change is to ripple an error return from superio_enter to the top level. Signed-off-by: Nat Gurumoorthy <natg@google.com> --- diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 316b648..fa3ff02 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -108,13 +108,20 @@ superio_select(int ldn) outb(ldn, VAL); } -static inline void +static inline int superio_enter(void) { + /* + * Try to reserve REG and REG + 1 for exclusive access. + */ + if (!request_muxed_region(REG, 2, DRVNAME)) + return -EBUSY; + outb(0x87, REG); outb(0x01, REG); outb(0x55, REG); outb(0x55, REG); + return 0; } static inline void @@ -122,6 +129,7 @@ superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); + release_region(REG, 2); } /* Logical device 4 registers */ @@ -1546,7 +1554,9 @@ static int __init it87_find(unsigned short *address, u16 chip_type; const char *board_vendor, *board_name; - superio_enter(); + if (superio_enter()) + return -EBUSY; + chip_type = force_id ? force_id : superio_inw(DEVID); switch (chip_type) { -- 1.7.3.1 _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: 2011-05-06 18:52 ` [lm-sensors] (no subject) Nat Gurumoorthy @ 2011-05-06 19:13 ` Guenter Roeck -1 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2011-05-06 19:13 UTC (permalink / raw) To: Nat Gurumoorthy Cc: Jean Delvare, Wim Van Sebroeck, lm-sensors, linux-kernel, mikew On Fri, 2011-05-06 at 14:52 -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 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 | 14 +++- > drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- > drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- > 3 files changed, 152 insertions(+), 87 deletions(-) > diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c > > Signed-off-by: Nat Gurumoorthy <natg@google.com> > > Patch History: > v8: > - Return the error actually returned by superio_enter and not -EBUSY. Hi Nat, Your use of -EBUSY vs. the returned error code is still inconsistent, for superio_enter() as well as for other functions returning an error code. Also, the following line split is really unnecessary. -static inline void superio_enter(void) +static inline int +superio_enter(void) Guenter ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) @ 2011-05-06 19:13 ` Guenter Roeck 0 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2011-05-06 19:13 UTC (permalink / raw) To: Nat Gurumoorthy Cc: Jean Delvare, Wim Van Sebroeck, lm-sensors, linux-kernel, mikew On Fri, 2011-05-06 at 14:52 -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 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 | 14 +++- > drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- > drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- > 3 files changed, 152 insertions(+), 87 deletions(-) > diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c > > Signed-off-by: Nat Gurumoorthy <natg@google.com> > > Patch History: > v8: > - Return the error actually returned by superio_enter and not -EBUSY. Hi Nat, Your use of -EBUSY vs. the returned error code is still inconsistent, for superio_enter() as well as for other functions returning an error code. Also, the following line split is really unnecessary. -static inline void superio_enter(void) +static inline int +superio_enter(void) Guenter _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: 2011-05-06 19:13 ` [lm-sensors] (no subject) Guenter Roeck @ 2011-05-06 20:00 ` Natarajan Gurumoorthy -1 siblings, 0 replies; 30+ messages in thread From: Natarajan Gurumoorthy @ 2011-05-06 20:00 UTC (permalink / raw) To: guenter.roeck Cc: Jean Delvare, Wim Van Sebroeck, lm-sensors, linux-kernel, mikew Guenter, Good catch. Forgot to checkin drivers/hwmon/it87.c. Also found a couple of places I missed in driver/watch/it8712_wdt.c. Patch #9 will be shipped later tonight. Got pulled off to do something else. Expect patch late tonight. Regards Nat On Fri, May 6, 2011 at 12:13 PM, Guenter Roeck <guenter.roeck@ericsson.com> wrote: > On Fri, 2011-05-06 at 14:52 -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 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 | 14 +++- >> drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- >> drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- >> 3 files changed, 152 insertions(+), 87 deletions(-) >> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c >> >> Signed-off-by: Nat Gurumoorthy <natg@google.com> >> >> Patch History: >> v8: >> - Return the error actually returned by superio_enter and not -EBUSY. > > Hi Nat, > > Your use of -EBUSY vs. the returned error code is still inconsistent, > for superio_enter() as well as for other functions returning an error > code. > > Also, the following line split is really unnecessary. > > -static inline void superio_enter(void) > +static inline int > +superio_enter(void) > > Guenter > > > -- Regards Nat Gurumoorthy AB6SJ ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) @ 2011-05-06 20:00 ` Natarajan Gurumoorthy 0 siblings, 0 replies; 30+ messages in thread From: Natarajan Gurumoorthy @ 2011-05-06 20:00 UTC (permalink / raw) To: guenter.roeck Cc: Jean Delvare, Wim Van Sebroeck, lm-sensors, linux-kernel, mikew Guenter, Good catch. Forgot to checkin drivers/hwmon/it87.c. Also found a couple of places I missed in driver/watch/it8712_wdt.c. Patch #9 will be shipped later tonight. Got pulled off to do something else. Expect patch late tonight. Regards Nat On Fri, May 6, 2011 at 12:13 PM, Guenter Roeck <guenter.roeck@ericsson.com> wrote: > On Fri, 2011-05-06 at 14:52 -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 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 | 14 +++- >> drivers/watchdog/it8712f_wdt.c | 60 ++++++++++---- >> drivers/watchdog/it87_wdt.c | 165 +++++++++++++++++++++++---------------- >> 3 files changed, 152 insertions(+), 87 deletions(-) >> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c >> >> Signed-off-by: Nat Gurumoorthy <natg@google.com> >> >> Patch History: >> v8: >> - Return the error actually returned by superio_enter and not -EBUSY. > > Hi Nat, > > Your use of -EBUSY vs. the returned error code is still inconsistent, > for superio_enter() as well as for other functions returning an error > code. > > Also, the following line split is really unnecessary. > > -static inline void superio_enter(void) > +static inline int > +superio_enter(void) > > Guenter > > > -- Regards Nat Gurumoorthy AB6SJ _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
[parent not found: <200703231349.l2NDnj1q025087@whb1.seed.net.tw>]
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> @ 2007-07-24 14:40 ` cilly 2009-11-09 3:39 ` jack ` (7 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: cilly @ 2007-07-24 14:40 UTC (permalink / raw) To: lm-sensors Hi all, I have a problem with vt1211-isa-6000 and VIA EPIA PE 10000 (1GHz), the vid is reported as: vid: +1.850 V (VRM Version 9.1) and VCore: +1.22 V. Those values aren't correct, VCore is 1.4 V. I tried to set the vid manually, which does not work. Any hints? Thx. Regards, c. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> 2007-07-24 14:40 ` cilly @ 2009-11-09 3:39 ` jack 2012-02-29 9:23 ` sravan vasu ` (6 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: jack @ 2009-11-09 3:39 UTC (permalink / raw) To: lm-sensors [-- Attachment #1.1: Type: text/plain, Size: 3658 bytes --] Dear all, Why I cannot read data form i2c? while in interrupt handler function. The "printk" output is always 0. Could anybody tell me how to fix me code for correctly reading the data send by i2c. #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/input.h> #include <linux/delay.h> #include <linux/clk.h> #include <linux/gpio.h> #include <asm/io.h> #include "../../../arch/arm/mach-mx51/crm_regs.h" #include "../../../arch/arm/mach-mx51/iomux.h" #define ABC_I2C_ADDR 0x03 #define I2C_DEV_NAME "i2c-0" #define ABC_DD_NAME "abc_dd" struct abc_dd_priv { struct i2c_client *client; struct input_dev *input; int irq; }; static irqreturn_t abc_event_handler(int irq, void *dev_id){ int i; u_int8_t dd_data[10]={0}; struct abc_dd_priv *priv = dev_id; memset(dd_data, 0, sizeof(dd_data)); i2c_master_recv(priv->client,dd_data,sizeof(dd_data)); for(i=0;i<10;i++){ printk(KERN_INFO "dd_data[%d]=%d\n",i,dd_data[i]); } return IRQ_HANDLED; } /* ------------------------------------------------------------------------- */ static int abc_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id){ struct input_dev *abc_inputdev; struct abc_dd_priv *priv; unsigned long tmp; int retval; int res; priv = kzalloc(sizeof(struct abc_dd_priv), GFP_KERNEL); if (!priv) { dev_err(&client->dev, "failed to allocate driver data\n"); return -ENOMEM; } i2c_set_clientdata(client, priv); priv->client = client; priv->irq = client->irq; if(priv->irq){ tmp=readl(MXC_CCM_CWDR); writel(tmp|0x00000008, MXC_CCM_CWDR); res=mxc_request_iomux(MX51_PIN_GPIO1_5, IOMUX_CONFIG_ALT0); gpio_config(0,5,false,GPIO_INT_HIGH_LEV); gpio_request_irq(0,5,GPIO_LOW_PRIO,abc_event_handler,0,ABC_DD_NAME,priv); } abc_inputdev = input_allocate_device(); if (!abc_inputdev) { printk(KERN_ERR "not enough memory for input device\n"); return -ENOMEM; } priv->input = abc_inputdev; input_set_drvdata(abc_inputdev,priv); abc_inputdev->name = ABC_DD_NAME; retval = input_register_device(priv->input); if (retval < 0) { input_free_device(abc_inputdev); return retval; } return 0; } static const struct i2c_device_id abc_dd_id[] = { { "abc_dd", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, abc_dd_id); static struct i2c_driver abc_driver = { .driver = { .name = ABC_DD_NAME, .owner = THIS_MODULE, }, .probe = abc_i2c_probe, .id_table = abc_dd_id, }; /* * module load/unload record keeping */ static int __init abc_dd_init(void) { printk(KERN_INFO "Diver Initiating...\n"); return i2c_add_driver(&abc_driver); } static void __exit abc_dd_exit(void) { i2c_del_driver(&abc_driver); } MODULE_AUTHOR("ABC International Inc."); MODULE_DESCRIPTION("DD driver"); MODULE_LICENSE("GPL"); module_init(abc_dd_init); module_exit(abc_dd_exit); [-- Attachment #1.2: Type: text/html, Size: 27212 bytes --] [-- Attachment #2: Type: text/plain, Size: 153 bytes --] _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> 2007-07-24 14:40 ` cilly 2009-11-09 3:39 ` jack @ 2012-02-29 9:23 ` sravan vasu 2012-02-29 14:40 ` Guenter Roeck ` (5 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: sravan vasu @ 2012-02-29 9:23 UTC (permalink / raw) To: lm-sensors [-- Attachment #1.1: Type: text/plain, Size: 45 bytes --] winbond display drives we want w 83667hg-B [-- Attachment #1.2: Type: text/html, Size: 58 bytes --] [-- Attachment #2: Type: text/plain, Size: 153 bytes --] _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (2 preceding siblings ...) 2012-02-29 9:23 ` sravan vasu @ 2012-02-29 14:40 ` Guenter Roeck 2012-04-23 20:35 ` Crunchy Toast ` (4 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2012-02-29 14:40 UTC (permalink / raw) To: lm-sensors On Wed, Feb 29, 2012 at 04:23:08AM -0500, sravan vasu wrote: > winbond display drives we want > > > w 83667hg-B Not sure I understand what you are trying to say. W83667HG-B is supported by the w83627ehf driver. Guenter _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (3 preceding siblings ...) 2012-02-29 14:40 ` Guenter Roeck @ 2012-04-23 20:35 ` Crunchy Toast 2012-04-25 7:18 ` Mr. Tux ` (3 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: Crunchy Toast @ 2012-04-23 20:35 UTC (permalink / raw) To: lm-sensors I've installed and configured the latest lm_sensors on CentOS 6, but still does not show temp. ========================================= # sensors k10temp-pci-00c3 Adapter: PCI adapter temp1: +0.0째C (high = +70.0째C) ========================================= Here is the output to sensors-detect ========================================= # sensors-detect Stopping lm_sensors: [ OK ] # sensors-detect revision 6031 (2012-03-07 17:14:01 +0100) # System: MSI MS-7599 [4.0] # Board: MSI 870S-G46 (MS-7599) This program will help you determine which kernel modules you need to load to use lm_sensors most effectively. It is generally safe and recommended to accept the default answers to all questions, unless you know what you're doing. Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): yes Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... Success! (driver `k10temp') AMD Family 11h thermal sensors... No AMD Family 12h and 14h thermal sensors... No AMD Family 15h thermal sensors... No AMD Family 15h power sensors... No Intel digital thermal sensor... No Intel AMB FB-DIMM thermal sensor... No VIA C7 thermal sensor... No VIA Nano thermal sensor... No Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): yes Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor/ITE'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor/ITE'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... Yes Found `Fintek F71889ED Super IO Sensors' Success! (address 0x600, driver `f71882fg') Some systems (mainly servers) implement IPMI, a set of common interfaces through which system health data may be retrieved, amongst other things. We first try to get the information from SMBIOS. If we don't find it there, we have to read from arbitrary I/O ports to probe for such interfaces. This is normally safe. Do you want to scan for IPMI interfaces? (YES/no): yes Probing for `IPMI BMC KCS' at 0xca0... No Probing for `IPMI BMC SMIC' at 0xca8... No Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): yes Probing for `National Semiconductor LM78' at 0x290... No Probing for `National Semiconductor LM79' at 0x290... No Probing for `Winbond W83781D' at 0x290... No Probing for `Winbond W83782D' at 0x290... No Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): yes Using driver `i2c-piix4' for device 0000:00:14.0: ATI Technologies Inc SB600/SB700/SB800 SMBus Next adapter: nouveau-0000:01:05.0-2 (i2c-0) Do you want to scan it? (YES/no/selectively): yes Next adapter: nouveau-0000:01:05.0-0 (i2c-1) Do you want to scan it? (YES/no/selectively): yes Client found at address 0x50 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... No Probing for `EDID EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Client found at address 0x51 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... No Client found at address 0x52 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... No Client found at address 0x53 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... No Next adapter: SMBus PIIX4 adapter at 0b00 (i2c-2) Do you want to scan it? (yes/NO/selectively): yes Client found at address 0x28 Probing for `National Semiconductor LM78'... No Probing for `National Semiconductor LM79'... No Probing for `National Semiconductor LM80'... No Probing for `National Semiconductor LM96080'... No Probing for `Winbond W83781D'... No Probing for `Winbond W83782D'... No Probing for `Winbond W83627HF'... No Probing for `Winbond W83627EHF'... No Probing for `Winbond W83627DHG/W83667HG/W83677HG'... No Probing for `Asus AS99127F (rev.1)'... No Probing for `Asus AS99127F (rev.2)'... No Probing for `Asus ASB100 Bach'... No Probing for `Analog Devices ADM1029'... No Probing for `ITE IT8712F'... No Client found at address 0x50 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Probing for `EDID EEPROM'... No Client found at address 0x51 Probing for `Analog Devices ADM1033'... No Probing for `Analog Devices ADM1034'... No Probing for `SPD EEPROM'... Yes (confidence 8, not a hardware monitoring chip) Now follows a summary of the probes I have just done. Just press ENTER to continue: Driver `k10temp' (autoloaded): * Chip `AMD Family 10h thermal sensors' (confidence: 9) Driver `f71882fg': * ISA bus, address 0x600 Chip `Fintek F71889ED Super IO Sensors' (confidence: 9) Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): yes Starting lm_sensors: loading module f71882fg [ OK ] # sensors k10temp-pci-00c3 Adapter: PCI adapter temp1: +0.0째C (high = +70.0째C) ========================================= MB Model: MSI 870S-G46 Any additional info can be provided if needed. Thanks in advance. _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (4 preceding siblings ...) 2012-04-23 20:35 ` Crunchy Toast @ 2012-04-25 7:18 ` Mr. Tux 2012-07-11 14:16 ` Stevie Trujillo ` (2 subsequent siblings) 8 siblings, 0 replies; 30+ messages in thread From: Mr. Tux @ 2012-04-25 7:18 UTC (permalink / raw) To: lm-sensors [-- Attachment #1.1: Type: text/plain, Size: 1552 bytes --] Hi list How can I set sensor limits to an Asus m4a89gtd pro usb3 board using Debian/Squeeze? The sensors output looks reasonable (compared to the BIOS values) . What I'm missing is critical limits for the fan speeds in case of 0 RPM. I forced the chassis fan to stop, got 0 RPM but no ALARM output. I assume the crit value is missing. Usually I set this in a /etc/sensors.d/<configfile> Now this fails, because sensors3.conf does not show an entry for atk0110-* and I can't create one myself that is successfully parsed by sensors -s -c <configfile> ~$ sensors --version sensors version 3.1.2 with libsensors version 3.1.2 ~$ uname -r 2.6.32-5-686 ~$ sensors k10temp-pci-00c3 Adapter: PCI adapter temp1: +15.0°C (high = +70.0°C, crit = +90.0°C) atk0110-acpi-0 Adapter: ACPI interface Vcore Voltage: +1.07 V (min = +0.80 V, max = +1.60 V) +3.3V Voltage: +3.29 V (min = +2.97 V, max = +3.63 V) +5V Voltage: +4.97 V (min = +4.50 V, max = +5.50 V) +12V Voltage: +12.07 V (min = +10.20 V, max = +13.80 V) CPU Fan Speed: 1537 RPM (min = 600 RPM) Chassis Fan Speed: 1467 RPM (min = 600 RPM) Chassis2 Fan Speed: 0 RPM (min = 600 RPM) Power Fan Speed: 0 RPM (min = 600 RPM) CPU Temperature: +24.0°C (high = +60.0°C, crit = +95.0°C) MB Temperature: +23.0°C (high = +45.0°C, crit = +75.0°C) Should I rebuild libsensors / try a newer kernel / create the config file in a different way? What's the right thing to do here? [-- Attachment #1.2: Type: text/html, Size: 2230 bytes --] [-- Attachment #2: Type: text/plain, Size: 153 bytes --] _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (5 preceding siblings ...) 2012-04-25 7:18 ` Mr. Tux @ 2012-07-11 14:16 ` Stevie Trujillo 2012-07-11 14:45 ` Guenter Roeck 2012-07-11 15:26 ` richardvoigt 8 siblings, 0 replies; 30+ messages in thread From: Stevie Trujillo @ 2012-07-11 14:16 UTC (permalink / raw) To: lm-sensors Hello, thank you for helping me! I'm sorry that I was so slow. My loglevel was wrong so I started messing with netconsole. I tested this with 3.4.4 kernel. I realized that your module seems to be from git version of kernel, it compiled without errors tho. I can try compile git kernel if that's better! On 2012-07-11 15:26, Jean Delvare wrote: > On Tue, 10 Jul 2012 16:24:55 +0200, Stevie Trujillo wrote: >> I have a Gigabyte GA-Z77X-UD3H motherboard with a 3570k CPU and 32GiB ram. >> * ISA bus, address 0xa30 >> Chip `ITE IT8728F Super IO Sensors' (confidence: 9) >> >> I run Gentoo with linux-3.4.4, if I do "modprobe it87" the system freezes. >> I was told GA-Z77X-D3H (not UD3H) works in Debian Squeeze with 3.2 >> kernel from Debian backports. >> I installed Squeeze, for me it freezes there too: >> >> # modprobe it87 >> it87: Found IT8728F chip at 0xa30, revision 1 >> it87: Beeping is supported >> * here it froze* > > Very odd. I think this is the first report of that kind. You are not > booting with acpi_enforce_resources=lax or =no, are you? I only have root= and ro [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.4.4 root=/dev/... ro But I forgot to mention these lines [ 6.634492] ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120320/utaddress-251) [ 6.634496] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver and that i tried booting with something like "noacpi acpi=off", but it still froze. >> How can I fix/debug this? > > I have no immediate idea. Please check in /proc/ioports if you see > anything suspicious at address 0xa30. $ cat /proc/ioports 0000-0cf7 : PCI Bus 0000:00 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-0060 : keyboard 0064-0064 : keyboard 0070-0077 : rtc0 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0200-020f : pnp 00:05 03c0-03df : vga+ 0400-0453 : pnp 00:05 0400-0403 : ACPI PM1a_EVT_BLK 0404-0405 : ACPI PM1a_CNT_BLK 0408-040b : ACPI PM_TMR 0410-0415 : ACPI CPU throttle 0420-042f : ACPI GPE0_BLK 0450-0450 : ACPI PM2_CNT_BLK 0454-0457 : pnp 00:07 0458-047f : pnp 00:05 04d0-04d1 : pnp 00:09 0500-057f : pnp 00:05 0680-069f : pnp 00:05 0a00-0a0f : pnp 00:08 0a20-0a2f : pnp 00:08 0a30-0a3f : pnp 00:08 0a35-0a36 : it87 0a35-0a36 : it87 0cf8-0cff : PCI conf1 0d00-ffff : PCI Bus 0000:00 164e-164f : pnp 00:05 c000-cfff : PCI Bus 0000:07 c000-c00f : 0000:07:00.0 c000-c00f : ahci c010-c013 : 0000:07:00.0 c010-c013 : ahci c020-c027 : 0000:07:00.0 c020-c027 : ahci c030-c033 : 0000:07:00.0 c030-c033 : ahci c040-c047 : 0000:07:00.0 c040-c047 : ahci d000-dfff : PCI Bus 0000:06 d000-d07f : 0000:06:00.0 d000-d07f : atl1c e000-efff : PCI Bus 0000:02 e000-e01f : 0000:02:00.0 f000-f03f : 0000:00:02.0 f040-f05f : 0000:00:1f.3 f060-f07f : 0000:00:1f.2 f060-f07f : ahci f080-f083 : 0000:00:1f.2 f080-f083 : ahci f090-f097 : 0000:00:1f.2 f090-f097 : ahci f0a0-f0a3 : 0000:00:1f.2 f0a0-f0a3 : ahci f0b0-f0b7 : 0000:00:1f.2 f0b0-f0b7 : ahci ffff-ffff : pnp 00:05 ffff-ffff : pnp 00:05 > > I have added a module parameter to the it87 driver. The updated driver > is here: > http://khali.linux-fr.org/devel/misc/it87/ > Build instructions are at: > http://khali.linux-fr.org/devel/misc/INSTALL > > You can load this it87 driver with write=0 to disable all register > writes. This will tell us if at least the driver works when not writing > to registers (I expect so.) You are correct! No freeze and the values looks kinda sane. # sensors coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +37.0°C (high = +85.0°C, crit = +105.0°C) Core 0: +36.0°C (high = +85.0°C, crit = +105.0°C) Core 1: +37.0°C (high = +85.0°C, crit = +105.0°C) Core 2: +34.0°C (high = +85.0°C, crit = +105.0°C) Core 3: +36.0°C (high = +85.0°C, crit = +105.0°C) acpitz-virtual-0 Adapter: Virtual device temp1: +27.8°C (crit = +106.0°C) temp2: +29.8°C (crit = +106.0°C) it8728-isa-0a30 Adapter: ISA adapter in0: +1.06 V (min = +0.00 V, max = +3.06 V) in1: +2.05 V (min = +0.00 V, max = +3.06 V) in2: +2.03 V (min = +0.00 V, max = +3.06 V) in3: +1.99 V (min = +0.00 V, max = +3.06 V) in4: +0.00 V (min = +0.00 V, max = +3.06 V) in5: +0.84 V (min = +0.00 V, max = +3.06 V) in6: +1.51 V (min = +0.00 V, max = +3.06 V) 3VSB: +3.38 V (min = +0.00 V, max = +6.12 V) Vbat: +3.26 V fan1: 982 RPM (min = 0 RPM) fan2: 0 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) fan4: 0 RPM (min = 0 RPM) fan5: 0 RPM (min = 0 RPM) temp1: +35.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor temp2: +44.0°C (low = +127.0°C, high = +127.0°C) sensor = thermistor temp3: +30.0°C (low = +127.0°C, high = +127.0°C) sensor = disabled intrusion0: ALARM > If that works, then please unload the driver and reload with write=2. > This will log every register write right before it happens. So the last > message logged is likely to point to a register write which is > inappropriate for your device/board. I only see these lines: [ 265.408976] it87: Found IT8728F chip at 0xa30, revision 1 [ 265.410655] it87: Beeping is supported [ 265.411583] it87: Writing value 0x37 to register 0x0c [ 265.423124] it87: Writing value 0x13 to register 0x00 -- Stevie Trujillo _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (6 preceding siblings ...) 2012-07-11 14:16 ` Stevie Trujillo @ 2012-07-11 14:45 ` Guenter Roeck 2012-07-11 15:26 ` richardvoigt 8 siblings, 0 replies; 30+ messages in thread From: Guenter Roeck @ 2012-07-11 14:45 UTC (permalink / raw) To: lm-sensors On Wed, Jul 11, 2012 at 04:16:21PM +0200, Stevie Trujillo wrote: [ ... ] > > > If that works, then please unload the driver and reload with write=2. > > This will log every register write right before it happens. So the last > > message logged is likely to point to a register write which is > > inappropriate for your device/board. > > I only see these lines: > [ 265.408976] it87: Found IT8728F chip at 0xa30, revision 1 > [ 265.410655] it87: Beeping is supported > [ 265.411583] it87: Writing value 0x37 to register 0x0c > [ 265.423124] it87: Writing value 0x13 to register 0x00 > Jean, it87_write_value(data, IT87_REG_CONFIG, (it87_read_value(data, IT87_REG_CONFIG) & 0x36) | (update_vbat ? 0x41 : 0x01)); Unless I am missing something, the above code enables interrupts by clearing bit 3. In combination with having bit 1 set, this means that SMI# interrupts will be enabled. Default value for the register, at least for IT8721F and IT8718F, is 0x18. Replacing the 0x36 mask above with 0x3e might possibly solve the problem. Guenter _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [lm-sensors] (no subject) [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> ` (7 preceding siblings ...) 2012-07-11 14:45 ` Guenter Roeck @ 2012-07-11 15:26 ` richardvoigt 8 siblings, 0 replies; 30+ messages in thread From: richardvoigt @ 2012-07-11 15:26 UTC (permalink / raw) To: lm-sensors If the purpose is to clear a single bit, wouldn't code of the form old & ~bit be better? On Wed, Jul 11, 2012 at 9:45 AM, Guenter Roeck <linux@roeck-us.net> wrote: > On Wed, Jul 11, 2012 at 04:16:21PM +0200, Stevie Trujillo wrote: > [ ... ] >> >> > If that works, then please unload the driver and reload with write=2. >> > This will log every register write right before it happens. So the last >> > message logged is likely to point to a register write which is >> > inappropriate for your device/board. >> >> I only see these lines: >> [ 265.408976] it87: Found IT8728F chip at 0xa30, revision 1 >> [ 265.410655] it87: Beeping is supported >> [ 265.411583] it87: Writing value 0x37 to register 0x0c >> [ 265.423124] it87: Writing value 0x13 to register 0x00 >> > Jean, > > it87_write_value(data, IT87_REG_CONFIG, > (it87_read_value(data, IT87_REG_CONFIG) & 0x36) > | (update_vbat ? 0x41 : 0x01)); > > Unless I am missing something, the above code enables interrupts by clearing > bit 3. In combination with having bit 1 set, this means that SMI# interrupts > will be enabled. Default value for the register, at least for IT8721F and > IT8718F, is 0x18. Replacing the 0x36 mask above with 0x3e might possibly solve > the problem. > > Guenter > > _______________________________________________ > lm-sensors mailing list > lm-sensors@lm-sensors.org > http://lists.lm-sensors.org/mailman/listinfo/lm-sensors _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors ^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2013-10-29 17:51 UTC | newest] Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-05-29 14:39 [lm-sensors] (no subject) John WICKS 2008-09-23 13:29 ` gaming 2011-05-04 7:03 ` Jeremy Harmon 2011-05-10 18:53 ` Jeremy Harmon 2011-11-26 18:26 ` su_pyrow 2011-12-08 18:31 ` Guenter Roeck 2011-12-08 18:36 ` Guenter Roeck 2012-11-07 20:09 ` 郭�园 2012-12-04 7:22 ` Dok Sander 2013-08-23 23:53 ` Robert Hinson 2013-10-29 17:51 ` morgan chong 2011-05-06 18:52 Nat Gurumoorthy 2011-05-06 18:52 ` [lm-sensors] (no subject) Nat Gurumoorthy 2011-05-06 18:54 ` [PATCH v8 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy 2011-05-06 18:54 ` [lm-sensors] [PATCH v8 1/2] Use "request_muxed_region" in it87 Nat Gurumoorthy 2011-05-06 18:55 ` [PATCH v8 2/2] Use "request_muxed_region" in it87 hwmon drivers Nat Gurumoorthy 2011-05-06 18:55 ` [lm-sensors] [PATCH v8 2/2] Use "request_muxed_region" in it87 Nat Gurumoorthy 2011-05-06 19:13 ` Guenter Roeck 2011-05-06 19:13 ` [lm-sensors] (no subject) Guenter Roeck 2011-05-06 20:00 ` Natarajan Gurumoorthy 2011-05-06 20:00 ` [lm-sensors] (no subject) Natarajan Gurumoorthy [not found] <200703231349.l2NDnj1q025087@whb1.seed.net.tw> 2007-07-24 14:40 ` cilly 2009-11-09 3:39 ` jack 2012-02-29 9:23 ` sravan vasu 2012-02-29 14:40 ` Guenter Roeck 2012-04-23 20:35 ` Crunchy Toast 2012-04-25 7:18 ` Mr. Tux 2012-07-11 14:16 ` Stevie Trujillo 2012-07-11 14:45 ` Guenter Roeck 2012-07-11 15:26 ` richardvoigt
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.