diff mbox

watchdog: sunxi: fix activation of system reset

Message ID 559AC20B.4090601@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Francesco Lavra July 6, 2015, 5:59 p.m. UTC
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.

Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com>
---
 drivers/watchdog/sunxi_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck July 6, 2015, 8:24 p.m. UTC | #1
On 07/06/2015 10:59 AM, Francesco Lavra wrote:
> 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.
>
> Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/sunxi_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
> index a29afb3..47bd8a1 100644
> --- a/drivers/watchdog/sunxi_wdt.c
> +++ b/drivers/watchdog/sunxi_wdt.c
> @@ -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 */
>
Maxime Ripard July 20, 2015, 8:26 a.m. UTC | #2
Hi Francesco,

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

On Mon, Jul 06, 2015 at 07:59:39PM +0200, Francesco Lavra wrote:
> 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)

> 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.

> Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com>

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

Thanks,
Maxime
Francesco Lavra July 25, 2015, 5:59 a.m. UTC | #3
Hi,

On 07/20/2015 10:26 AM, Maxime Ripard wrote:
> Hi Francesco,
>
> Your patch looks mostly good, but there's just a few minor things.
>
> On Mon, Jul 06, 2015 at 07:59:39PM +0200, Francesco Lavra wrote:
>> 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.

>> 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.

>> Signed-off-by: Francesco Lavra <francescolavra.fl@gmail.com>
>
> Could you also CC stable, and add a Fixes: tag please?

Sure, a V2 patch will follow shortly.

> Thanks,
> Maxime
diff mbox

Patch

diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
index a29afb3..47bd8a1 100644
--- a/drivers/watchdog/sunxi_wdt.c
+++ b/drivers/watchdog/sunxi_wdt.c
@@ -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 */