Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 322af98c authored by Denis Turischev's avatar Denis Turischev Committed by Wim Van Sebroeck
Browse files

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: default avatarDenis Turischev <denis@compulab.co.il>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent fcf1dd7e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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)