Skip to content

Commit d0bc387

Browse files
committed
Pull watchdog fixes from Wim Van Sebroeck: - a null pointer dereference fix for omap_wdt - some clock related fixes for pnx4008 - an underflow fix in wdt_set_timeout() for w83977f_wdt - restart fix for tegra wdt - Kconfig change to support Freescale Layerscape platforms - fix for stopping the mtk_wdt watchdog * git://www.linux-watchdog.org/linux-watchdog: watchdog: mtk_wdt: Use MODE_KEY when stopping the watchdog watchdog: Add support for Freescale Layerscape platforms watchdog: tegra: Stop watchdog first if restarting watchdog: w83977f_wdt: underflow in wdt_set_timeout() watchdog: pnx4008: make global wdt_clk static watchdog: pnx4008: fix warnings caused by enabling unprepared clock watchdog: omap_wdt: fix null pointer dereference
2 parents 80e0c50 + 5da2bf1 commit d0bc387

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

drivers/watchdog/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ config MAX63XX_WATCHDOG
446446

447447
config IMX2_WDT
448448
tristate "IMX2+ Watchdog"
449-
depends on ARCH_MXC
449+
depends on ARCH_MXC || ARCH_LAYERSCAPE
450450
select REGMAP_MMIO
451451
select WATCHDOG_CORE
452452
help

drivers/watchdog/mtk_wdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static int mtk_wdt_stop(struct watchdog_device *wdt_dev)
123123

124124
reg = readl(wdt_base + WDT_MODE);
125125
reg &= ~WDT_MODE_EN;
126+
reg |= WDT_MODE_KEY;
126127
iowrite32(reg, wdt_base + WDT_MODE);
127128

128129
return 0;

drivers/watchdog/omap_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int omap_wdt_set_timeout(struct watchdog_device *wdog,
205205

206206
static unsigned int omap_wdt_get_timeleft(struct watchdog_device *wdog)
207207
{
208-
struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog);
208+
struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
209209
void __iomem *base = wdev->base;
210210
u32 value;
211211

drivers/watchdog/pnx4008_wdt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static unsigned int heartbeat = DEFAULT_HEARTBEAT;
8080

8181
static DEFINE_SPINLOCK(io_lock);
8282
static void __iomem *wdt_base;
83-
struct clk *wdt_clk;
83+
static struct clk *wdt_clk;
8484

8585
static int pnx4008_wdt_start(struct watchdog_device *wdd)
8686
{
@@ -161,7 +161,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
161161
if (IS_ERR(wdt_clk))
162162
return PTR_ERR(wdt_clk);
163163

164-
ret = clk_enable(wdt_clk);
164+
ret = clk_prepare_enable(wdt_clk);
165165
if (ret)
166166
return ret;
167167

@@ -184,15 +184,15 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
184184
return 0;
185185

186186
disable_clk:
187-
clk_disable(wdt_clk);
187+
clk_disable_unprepare(wdt_clk);
188188
return ret;
189189
}
190190

191191
static int pnx4008_wdt_remove(struct platform_device *pdev)
192192
{
193193
watchdog_unregister_device(&pnx4008_wdd);
194194

195-
clk_disable(wdt_clk);
195+
clk_disable_unprepare(wdt_clk);
196196

197197
return 0;
198198
}

drivers/watchdog/tegra_wdt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
140140
{
141141
wdd->timeout = timeout;
142142

143-
if (watchdog_active(wdd))
143+
if (watchdog_active(wdd)) {
144+
tegra_wdt_stop(wdd);
144145
return tegra_wdt_start(wdd);
146+
}
145147

146148
return 0;
147149
}

drivers/watchdog/w83977f_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int wdt_keepalive(void)
224224

225225
static int wdt_set_timeout(int t)
226226
{
227-
int tmrval;
227+
unsigned int tmrval;
228228

229229
/*
230230
* Convert seconds to watchdog counter time units, rounding up.

0 commit comments

Comments
 (0)