watchdog: sbc_fitpc2_wdt: fixed "scheduling while atomic" bug.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, April 28, 2010 - 1:59 pm

Gitweb:     http://git.kernel.org/linus/322af98c56c70b3ec6f637fb07d41a9591a6ff9a
Commit:     322af98c56c70b3ec6f637fb07d41a9591a6ff9a
Parent:     fcf1dd7e68ceb6420478c8d89d35b4745d0b2f42
Author:     Denis Turischev <denis@compulab.co.il>
AuthorDate: Thu Apr 22 19:54:20 2010 +0300
Committer:  Wim Van Sebroeck <wim@iguana.be>
CommitDate: Mon Apr 26 18:22:30 2010 +0000

    watchdog: sbc_fitpc2_wdt: fixed "scheduling while atomic" bug.
    
    spinlock need to be replaced by mutex because of sleep functions
    inside wdt_send_data.
    
    Signed-off-by: Denis Turischev <denis@compulab.co.il>
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
---
 drivers/watchdog/sbc_fitpc2_wdt.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index 2e44dd4..c7d67e9 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -30,7 +30,7 @@
 static int nowayout = WATCHDOG_NOWAYOUT;
 static unsigned int margin = 60;	/* (secs) Default is 1 minute */
 static unsigned long wdt_status;
-static DEFINE_SPINLOCK(wdt_lock);
+static DEFINE_MUTEX(wdt_lock);
 
 #define WDT_IN_USE		0
 #define WDT_OK_TO_CLOSE		1
@@ -53,18 +53,18 @@ static void wdt_send_data(unsigned char command, unsigned char data)
 
 static void wdt_enable(void)
 {
-	spin_lock(&wdt_lock);
+	mutex_lock(&wdt_lock);
 	wdt_send_data(IFACE_ON_COMMAND, 1);
 	wdt_send_data(REBOOT_COMMAND, margin);
-	spin_unlock(&wdt_lock);
+	mutex_unlock(&wdt_lock);
 }
 
 static void wdt_disable(void)
 {
-	spin_lock(&wdt_lock);
+	mutex_lock(&wdt_lock);
 	wdt_send_data(IFACE_ON_COMMAND, 0);
 	wdt_send_data(REBOOT_COMMAND, 0);
-	spin_unlock(&wdt_lock);
+	mutex_unlock(&wdt_lock);
 }
 
 static int fitpc2_wdt_open(struct inode *inode, struct file *file)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
watchdog: sbc_fitpc2_wdt: fixed "scheduling while atomic" bug., Linux Kernel Mailing ..., (Wed Apr 28, 1:59 pm)