Commit 045798b5 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] pcwd_pci.c - spinlock fixes

the keepalive and get_temperature functions should
use spinlocks also.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 39e3a055
...@@ -298,7 +298,9 @@ static int pcipcwd_stop(void) ...@@ -298,7 +298,9 @@ static int pcipcwd_stop(void)
static int pcipcwd_keepalive(void) static int pcipcwd_keepalive(void)
{ {
/* Re-trigger watchdog by writing to port 0 */ /* Re-trigger watchdog by writing to port 0 */
spin_lock(&pcipcwd_private.io_lock);
outb_p(0x42, pcipcwd_private.io_addr); /* send out any data */ outb_p(0x42, pcipcwd_private.io_addr); /* send out any data */
spin_unlock(&pcipcwd_private.io_lock);
if (debug >= DEBUG) if (debug >= DEBUG)
printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
...@@ -385,7 +387,9 @@ static int pcipcwd_get_temperature(int *temperature) ...@@ -385,7 +387,9 @@ static int pcipcwd_get_temperature(int *temperature)
if (!pcipcwd_private.supports_temp) if (!pcipcwd_private.supports_temp)
return -ENODEV; return -ENODEV;
spin_lock(&pcipcwd_private.io_lock);
*temperature = inb_p(pcipcwd_private.io_addr); *temperature = inb_p(pcipcwd_private.io_addr);
spin_unlock(&pcipcwd_private.io_lock);
/* /*
* Convert celsius to fahrenheit, since this was * Convert celsius to fahrenheit, since this was
...@@ -814,6 +818,8 @@ static int __init pcipcwd_init_module(void) ...@@ -814,6 +818,8 @@ static int __init pcipcwd_init_module(void)
static void __exit pcipcwd_cleanup_module(void) static void __exit pcipcwd_cleanup_module(void)
{ {
pci_unregister_driver(&pcipcwd_driver); pci_unregister_driver(&pcipcwd_driver);
printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
} }
module_init(pcipcwd_init_module); module_init(pcipcwd_init_module);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment