Skip to contentSkip to conversation

watchdog: sunxi: fix activation of system reset

PATCH Superseded Francesco Lavra 3 participants 4 messages Jul 6, 2015 – Jul 25, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: sunxi: fix activation of system reset

Commit f2147de3 ("watchdog: sunxi: support parameterized compatible strings") introduced a regression in sunxi_wdt_start(), by which the system reset function of the watchdog is not enabled upon starting the watchdog. Fix it.

---
 drivers/watchdog/sunxi_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sunxi_wdt.c +1 -1
index a29afb3..47bd8a1 100644
@@ -184,7 +184,7 @@ static int sunxi_wdt_start(struct watchdog_device *wdt_dev)
 	/* Set system reset function */
 	reg = readl(wdt_base + regs->wdt_cfg);
 	reg &= ~(regs->wdt_reset_mask);
-	reg |= ~(regs->wdt_reset_val);
+	reg |= regs->wdt_reset_val;
 	writel(reg, wdt_base + regs->wdt_cfg);
 
 	/* Enable watchdog */
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Francesco Lavra

Commit f2147de3 ("watchdog: sunxi: support parameterized compatible strings") introduced a regression in sunxi_wdt_start(), by which the system reset function of the watchdog is not enabled upon starting the watchdog. Fix it.

Quoted 18 lines
---
  drivers/watchdog/sunxi_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sunxi_wdt.c +1 -1
index a29afb3..47bd8a1 100644
@@ -184,7 +184,7 @@ static int sunxi_wdt_start(struct watchdog_device *wdt_dev)
  	/* Set system reset function */
  	reg = readl(wdt_base + regs->wdt_cfg);
  	reg &= ~(regs->wdt_reset_mask);
-	reg |= ~(regs->wdt_reset_val);
+	reg |= regs->wdt_reset_val;
  	writel(reg, wdt_base + regs->wdt_cfg);
 
  	/* Enable watchdog */
#2 lore raw
In reply to Francesco Lavra

Hi Francesco,

Your patch looks mostly good, but there's just a few minor things.

Quoted 1 line · Francesco Lavra

Commit f2147de3 ("watchdog: sunxi: support parameterized compatible

The commit ID should have at least 12 chars to avoid future ID collisions (which already start to happen)

Quoted 3 lines

strings") introduced a regression in sunxi_wdt_start(), by which the system reset function of the watchdog is not enabled upon starting the watchdog. Fix it.

Having a description of what that actually means for the end-user (I guess that it won't reset the system when the watchdog expires) would be nice.

Quoted 1 line

Could you also CC stable, and add a Fixes: tag please?

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150720/189aa753/attachment.sig>
#3 lore raw

Hi,

Quoted 9 lines · Maxime Ripard

Hi Francesco,

Your patch looks mostly good, but there's just a few minor things.

Quoted 1 line · Francesco Lavra

Commit f2147de3 ("watchdog: sunxi: support parameterized compatible

The commit ID should have at least 12 chars to avoid future ID collisions (which already start to happen)

Will do.

Quoted 7 lines
Quoted 3 lines

strings") introduced a regression in sunxi_wdt_start(), by which the system reset function of the watchdog is not enabled upon starting the watchdog. Fix it.

Having a description of what that actually means for the end-user (I guess that it won't reset the system when the watchdog expires) would be nice.

Fair enough.

Quoted 3 lines
Quoted 1 line

Could you also CC stable, and add a Fixes: tag please?

Sure, a V2 patch will follow shortly.

Quoted 2 lines

Thanks,
Maxime