linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h>
@ 2019-05-21 15:53 Paul Cercueil
  2019-05-21 15:53 ` [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Paul Cercueil @ 2019-05-21 15:53 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil

Use the macros from <linux/mfd/ingenic-tcu.h> instead of declaring our
own.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/watchdog/jz4740_wdt.c | 39 ++++++++++++++---------------------
 1 file changed, 16 insertions(+), 23 deletions(-)

diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index d1bc7cbd4f2b..51be321c775a 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -13,6 +13,7 @@
  *
  */
 
+#include <linux/mfd/ingenic-tcu.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -28,23 +29,16 @@
 
 #include <asm/mach-jz4740/timer.h>
 
-#define JZ_REG_WDT_TIMER_DATA     0x0
-#define JZ_REG_WDT_COUNTER_ENABLE 0x4
-#define JZ_REG_WDT_TIMER_COUNTER  0x8
-#define JZ_REG_WDT_TIMER_CONTROL  0xC
-
 #define JZ_WDT_CLOCK_PCLK 0x1
 #define JZ_WDT_CLOCK_RTC  0x2
 #define JZ_WDT_CLOCK_EXT  0x4
 
-#define JZ_WDT_CLOCK_DIV_SHIFT   3
-
-#define JZ_WDT_CLOCK_DIV_1    (0 << JZ_WDT_CLOCK_DIV_SHIFT)
-#define JZ_WDT_CLOCK_DIV_4    (1 << JZ_WDT_CLOCK_DIV_SHIFT)
-#define JZ_WDT_CLOCK_DIV_16   (2 << JZ_WDT_CLOCK_DIV_SHIFT)
-#define JZ_WDT_CLOCK_DIV_64   (3 << JZ_WDT_CLOCK_DIV_SHIFT)
-#define JZ_WDT_CLOCK_DIV_256  (4 << JZ_WDT_CLOCK_DIV_SHIFT)
-#define JZ_WDT_CLOCK_DIV_1024 (5 << JZ_WDT_CLOCK_DIV_SHIFT)
+#define JZ_WDT_CLOCK_DIV_1    (0 << TCU_TCSR_PRESCALE_LSB)
+#define JZ_WDT_CLOCK_DIV_4    (1 << TCU_TCSR_PRESCALE_LSB)
+#define JZ_WDT_CLOCK_DIV_16   (2 << TCU_TCSR_PRESCALE_LSB)
+#define JZ_WDT_CLOCK_DIV_64   (3 << TCU_TCSR_PRESCALE_LSB)
+#define JZ_WDT_CLOCK_DIV_256  (4 << TCU_TCSR_PRESCALE_LSB)
+#define JZ_WDT_CLOCK_DIV_1024 (5 << TCU_TCSR_PRESCALE_LSB)
 
 #define DEFAULT_HEARTBEAT 5
 #define MAX_HEARTBEAT     2048
@@ -72,7 +66,7 @@ static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 
-	writew(0x0, drvdata->base + JZ_REG_WDT_TIMER_COUNTER);
+	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
 	return 0;
 }
 
@@ -95,18 +89,17 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 			break;
 		}
 		timeout_value >>= 2;
-		clock_div += (1 << JZ_WDT_CLOCK_DIV_SHIFT);
+		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
 	}
 
-	writeb(0x0, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
-	writew(clock_div, drvdata->base + JZ_REG_WDT_TIMER_CONTROL);
+	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
+	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
 
-	writew((u16)timeout_value, drvdata->base + JZ_REG_WDT_TIMER_DATA);
-	writew(0x0, drvdata->base + JZ_REG_WDT_TIMER_COUNTER);
-	writew(clock_div | JZ_WDT_CLOCK_RTC,
-		drvdata->base + JZ_REG_WDT_TIMER_CONTROL);
+	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
+	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
+	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
 
-	writeb(0x1, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
+	writeb(0x1, drvdata->base + TCU_REG_WDT_TCER);
 
 	wdt_dev->timeout = new_timeout;
 	return 0;
@@ -124,7 +117,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 
-	writeb(0x0, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
+	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
 	jz4740_timer_disable_watchdog();
 
 	return 0;
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout
  2019-05-21 15:53 [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Paul Cercueil
@ 2019-05-21 15:53 ` Paul Cercueil
  2019-05-28 19:27   ` Guenter Roeck
  2019-05-21 15:53 ` [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2019-05-21 15:53 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil

Previously the jz4740_wdt_set_timeout() function was starting the timer
unconditionally, even if it was stopped when that function was entered.

Now, the timer will be restarted only if it was already running before
this function is called.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/watchdog/jz4740_wdt.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index 51be321c775a..f970a7a53084 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -77,6 +77,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 	unsigned int rtc_clk_rate;
 	unsigned int timeout_value;
 	unsigned short clock_div = JZ_WDT_CLOCK_DIV_1;
+	u8 tcer;
 
 	rtc_clk_rate = clk_get_rate(drvdata->rtc_clk);
 
@@ -92,6 +93,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
 	}
 
+	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
 	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
 	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
 
@@ -99,7 +101,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
 	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
 
-	writeb(0x1, drvdata->base + TCU_REG_WDT_TCER);
+	writeb(tcer & TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
 
 	wdt_dev->timeout = new_timeout;
 	return 0;
@@ -107,8 +109,11 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 
 static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
 {
+	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
+
 	jz4740_timer_enable_watchdog();
 	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
+	writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
 
 	return 0;
 }
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx
  2019-05-21 15:53 [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Paul Cercueil
  2019-05-21 15:53 ` [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
@ 2019-05-21 15:53 ` Paul Cercueil
  2019-05-28 19:36   ` Guenter Roeck
  2019-05-21 15:53 ` [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier Paul Cercueil
  2019-05-28 18:11 ` [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Guenter Roeck
  3 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2019-05-21 15:53 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil

Depending on MACH_JZ47xx prevent us from creating a generic kernel that
works on more than one MIPS board. Instead, we just depend on MIPS being
set.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 7ea60371bda0..dccf22bb230c 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1633,7 +1633,7 @@ config INDYDOG
 
 config JZ4740_WDT
 	tristate "Ingenic jz4740 SoC hardware watchdog"
-	depends on MACH_JZ4740 || MACH_JZ4780
+	depends on MIPS
 	select WATCHDOG_CORE
 	help
 	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier
  2019-05-21 15:53 [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Paul Cercueil
  2019-05-21 15:53 ` [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
  2019-05-21 15:53 ` [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
@ 2019-05-21 15:53 ` Paul Cercueil
  2019-05-28 19:37   ` Guenter Roeck
  2019-05-28 18:11 ` [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Guenter Roeck
  3 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2019-05-21 15:53 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil

Use a SPDX license identifier instead of a wall of text.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/watchdog/jz4740_wdt.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index f970a7a53084..c5b369152e70 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -1,16 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Copyright (C) 2010, Paul Cercueil <paul@crapouillou.net>
  *  JZ4740 Watchdog driver
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under  the terms of the GNU General  Public License as published by the
- *  Free Software Foundation;  either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #include <linux/mfd/ingenic-tcu.h>
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h>
  2019-05-21 15:53 [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Paul Cercueil
                   ` (2 preceding siblings ...)
  2019-05-21 15:53 ` [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier Paul Cercueil
@ 2019-05-28 18:11 ` Guenter Roeck
  3 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-05-28 18:11 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Tue, May 21, 2019 at 05:53:10PM +0200, Paul Cercueil wrote:
> Use the macros from <linux/mfd/ingenic-tcu.h> instead of declaring our
> own.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

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

> ---
>  drivers/watchdog/jz4740_wdt.c | 39 ++++++++++++++---------------------
>  1 file changed, 16 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
> index d1bc7cbd4f2b..51be321c775a 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -13,6 +13,7 @@
>   *
>   */
>  
> +#include <linux/mfd/ingenic-tcu.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>
>  #include <linux/types.h>
> @@ -28,23 +29,16 @@
>  
>  #include <asm/mach-jz4740/timer.h>
>  
> -#define JZ_REG_WDT_TIMER_DATA     0x0
> -#define JZ_REG_WDT_COUNTER_ENABLE 0x4
> -#define JZ_REG_WDT_TIMER_COUNTER  0x8
> -#define JZ_REG_WDT_TIMER_CONTROL  0xC
> -
>  #define JZ_WDT_CLOCK_PCLK 0x1
>  #define JZ_WDT_CLOCK_RTC  0x2
>  #define JZ_WDT_CLOCK_EXT  0x4
>  
> -#define JZ_WDT_CLOCK_DIV_SHIFT   3
> -
> -#define JZ_WDT_CLOCK_DIV_1    (0 << JZ_WDT_CLOCK_DIV_SHIFT)
> -#define JZ_WDT_CLOCK_DIV_4    (1 << JZ_WDT_CLOCK_DIV_SHIFT)
> -#define JZ_WDT_CLOCK_DIV_16   (2 << JZ_WDT_CLOCK_DIV_SHIFT)
> -#define JZ_WDT_CLOCK_DIV_64   (3 << JZ_WDT_CLOCK_DIV_SHIFT)
> -#define JZ_WDT_CLOCK_DIV_256  (4 << JZ_WDT_CLOCK_DIV_SHIFT)
> -#define JZ_WDT_CLOCK_DIV_1024 (5 << JZ_WDT_CLOCK_DIV_SHIFT)
> +#define JZ_WDT_CLOCK_DIV_1    (0 << TCU_TCSR_PRESCALE_LSB)
> +#define JZ_WDT_CLOCK_DIV_4    (1 << TCU_TCSR_PRESCALE_LSB)
> +#define JZ_WDT_CLOCK_DIV_16   (2 << TCU_TCSR_PRESCALE_LSB)
> +#define JZ_WDT_CLOCK_DIV_64   (3 << TCU_TCSR_PRESCALE_LSB)
> +#define JZ_WDT_CLOCK_DIV_256  (4 << TCU_TCSR_PRESCALE_LSB)
> +#define JZ_WDT_CLOCK_DIV_1024 (5 << TCU_TCSR_PRESCALE_LSB)
>  
>  #define DEFAULT_HEARTBEAT 5
>  #define MAX_HEARTBEAT     2048
> @@ -72,7 +66,7 @@ static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  
> -	writew(0x0, drvdata->base + JZ_REG_WDT_TIMER_COUNTER);
> +	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
>  	return 0;
>  }
>  
> @@ -95,18 +89,17 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  			break;
>  		}
>  		timeout_value >>= 2;
> -		clock_div += (1 << JZ_WDT_CLOCK_DIV_SHIFT);
> +		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
>  	}
>  
> -	writeb(0x0, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
> -	writew(clock_div, drvdata->base + JZ_REG_WDT_TIMER_CONTROL);
> +	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
> +	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
>  
> -	writew((u16)timeout_value, drvdata->base + JZ_REG_WDT_TIMER_DATA);
> -	writew(0x0, drvdata->base + JZ_REG_WDT_TIMER_COUNTER);
> -	writew(clock_div | JZ_WDT_CLOCK_RTC,
> -		drvdata->base + JZ_REG_WDT_TIMER_CONTROL);
> +	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
> +	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
> +	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
>  
> -	writeb(0x1, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
> +	writeb(0x1, drvdata->base + TCU_REG_WDT_TCER);
>  
>  	wdt_dev->timeout = new_timeout;
>  	return 0;
> @@ -124,7 +117,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  
> -	writeb(0x0, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE);
> +	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
>  	jz4740_timer_disable_watchdog();
>  
>  	return 0;
> -- 
> 2.21.0.593.g511ec345e18
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout
  2019-05-21 15:53 ` [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
@ 2019-05-28 19:27   ` Guenter Roeck
  0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-05-28 19:27 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Tue, May 21, 2019 at 05:53:11PM +0200, Paul Cercueil wrote:
> Previously the jz4740_wdt_set_timeout() function was starting the timer
> unconditionally, even if it was stopped when that function was entered.
> 
> Now, the timer will be restarted only if it was already running before
> this function is called.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Comment inline, but not worth a respin (and I don't have a good idea how to
improve it).

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

> ---
>  drivers/watchdog/jz4740_wdt.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
> index 51be321c775a..f970a7a53084 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -77,6 +77,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  	unsigned int rtc_clk_rate;
>  	unsigned int timeout_value;
>  	unsigned short clock_div = JZ_WDT_CLOCK_DIV_1;
> +	u8 tcer;
>  
>  	rtc_clk_rate = clk_get_rate(drvdata->rtc_clk);
>  
> @@ -92,6 +93,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
>  	}
>  
> +	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
>  	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
>  	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
>  
> @@ -99,7 +101,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
>  	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
>  
> -	writeb(0x1, drvdata->base + TCU_REG_WDT_TCER);
> +	writeb(tcer & TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);

This unnecessarily writes 0 if the timer is not running.

>  
>  	wdt_dev->timeout = new_timeout;
>  	return 0;
> @@ -107,8 +109,11 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  
>  static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
>  {
> +	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
> +
>  	jz4740_timer_enable_watchdog();
>  	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
> +	writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);

This unnecessarily enables the timer even if it is already enabled (that should not
happen, but does if the watchdog is already running at boot).

>  
>  	return 0;
>  }
> -- 
> 2.21.0.593.g511ec345e18
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx
  2019-05-21 15:53 ` [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
@ 2019-05-28 19:36   ` Guenter Roeck
  0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-05-28 19:36 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Tue, May 21, 2019 at 05:53:12PM +0200, Paul Cercueil wrote:
> Depending on MACH_JZ47xx prevent us from creating a generic kernel that
> works on more than one MIPS board. Instead, we just depend on MIPS being
> set.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

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

> ---
>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7ea60371bda0..dccf22bb230c 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1633,7 +1633,7 @@ config INDYDOG
>  
>  config JZ4740_WDT
>  	tristate "Ingenic jz4740 SoC hardware watchdog"
> -	depends on MACH_JZ4740 || MACH_JZ4780
> +	depends on MIPS
>  	select WATCHDOG_CORE
>  	help
>  	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
> -- 
> 2.21.0.593.g511ec345e18
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier
  2019-05-21 15:53 ` [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier Paul Cercueil
@ 2019-05-28 19:37   ` Guenter Roeck
  0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-05-28 19:37 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Tue, May 21, 2019 at 05:53:13PM +0200, Paul Cercueil wrote:
> Use a SPDX license identifier instead of a wall of text.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

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

> ---
>  drivers/watchdog/jz4740_wdt.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
> index f970a7a53084..c5b369152e70 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -1,16 +1,7 @@
> +// SPDX-License-Identifier: GPL-2.0+
>  /*
>   *  Copyright (C) 2010, Paul Cercueil <paul@crapouillou.net>
>   *  JZ4740 Watchdog driver
> - *
> - *  This program is free software; you can redistribute it and/or modify it
> - *  under  the terms of the GNU General  Public License as published by the
> - *  Free Software Foundation;  either version 2 of the License, or (at your
> - *  option) any later version.
> - *
> - *  You should have received a copy of the GNU General Public License along
> - *  with this program; if not, write to the Free Software Foundation, Inc.,
> - *  675 Mass Ave, Cambridge, MA 02139, USA.
> - *
>   */
>  
>  #include <linux/mfd/ingenic-tcu.h>
> -- 
> 2.21.0.593.g511ec345e18
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-05-28 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 15:53 [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Paul Cercueil
2019-05-21 15:53 ` [PATCH 2/4] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
2019-05-28 19:27   ` Guenter Roeck
2019-05-21 15:53 ` [PATCH 3/4] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
2019-05-28 19:36   ` Guenter Roeck
2019-05-21 15:53 ` [PATCH 4/4] watchdog: jz4740: Switch to SPDX license identifier Paul Cercueil
2019-05-28 19:37   ` Guenter Roeck
2019-05-28 18:11 ` [PATCH 1/4] watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h> Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).