All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] watchdog: pnx4008: readout watchdog state
@ 2019-04-11 19:14 ` Alexandre Belloni
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2019-04-11 19:14 UTC (permalink / raw)
  To: Guenter Roeck, Vladimir Zapolskiy
  Cc: Wim Van Sebroeck, Sylvain Lemieux, Gregory Clement,
	linux-arm-kernel, linux-watchdog, linux-kernel,
	Alexandre Belloni

Readout the enabled state so it is possible to get the pre-userspace
handler working. Also, avoid disabling the watchdog to ensure it continues
working and triggers if there is an issue later in the boot or if userspace
fails to start.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/watchdog/pnx4008_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index 8e261799c84e..4ce0389d1442 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
 	watchdog_set_restart_priority(&pnx4008_wdd, 128);
 
-	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
+	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
+		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
 
 	ret = watchdog_register_device(&pnx4008_wdd);
 	if (ret < 0) {
-- 
2.20.1


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

* [PATCH v2] watchdog: pnx4008: readout watchdog state
@ 2019-04-11 19:14 ` Alexandre Belloni
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2019-04-11 19:14 UTC (permalink / raw)
  To: Guenter Roeck, Vladimir Zapolskiy
  Cc: Alexandre Belloni, linux-watchdog, Gregory Clement, linux-kernel,
	Sylvain Lemieux, Wim Van Sebroeck, linux-arm-kernel

Readout the enabled state so it is possible to get the pre-userspace
handler working. Also, avoid disabling the watchdog to ensure it continues
working and triggers if there is an issue later in the boot or if userspace
fails to start.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/watchdog/pnx4008_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index 8e261799c84e..4ce0389d1442 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
 	watchdog_set_restart_priority(&pnx4008_wdd, 128);
 
-	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
+	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
+		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
 
 	ret = watchdog_register_device(&pnx4008_wdd);
 	if (ret < 0) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] watchdog: pnx4008: readout watchdog state
  2019-04-11 19:14 ` Alexandre Belloni
@ 2019-04-11 19:32   ` Guenter Roeck
  -1 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2019-04-11 19:32 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Vladimir Zapolskiy, Wim Van Sebroeck, Sylvain Lemieux,
	Gregory Clement, linux-arm-kernel, linux-watchdog, linux-kernel

On Thu, Apr 11, 2019 at 09:14:37PM +0200, Alexandre Belloni wrote:
> Readout the enabled state so it is possible to get the pre-userspace
> handler working. Also, avoid disabling the watchdog to ensure it continues
> working and triggers if there is an issue later in the boot or if userspace
> fails to start.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

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

> ---
>  drivers/watchdog/pnx4008_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
> index 8e261799c84e..4ce0389d1442 100644
> --- a/drivers/watchdog/pnx4008_wdt.c
> +++ b/drivers/watchdog/pnx4008_wdt.c
> @@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
>  	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
>  	watchdog_set_restart_priority(&pnx4008_wdd, 128);
>  
> -	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
> +	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
> +		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
>  
>  	ret = watchdog_register_device(&pnx4008_wdd);
>  	if (ret < 0) {
> -- 
> 2.20.1
> 

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

* Re: [PATCH v2] watchdog: pnx4008: readout watchdog state
@ 2019-04-11 19:32   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2019-04-11 19:32 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-watchdog, Gregory Clement, linux-kernel,
	Vladimir Zapolskiy, Sylvain Lemieux, Wim Van Sebroeck,
	linux-arm-kernel

On Thu, Apr 11, 2019 at 09:14:37PM +0200, Alexandre Belloni wrote:
> Readout the enabled state so it is possible to get the pre-userspace
> handler working. Also, avoid disabling the watchdog to ensure it continues
> working and triggers if there is an issue later in the boot or if userspace
> fails to start.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

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

> ---
>  drivers/watchdog/pnx4008_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
> index 8e261799c84e..4ce0389d1442 100644
> --- a/drivers/watchdog/pnx4008_wdt.c
> +++ b/drivers/watchdog/pnx4008_wdt.c
> @@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
>  	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
>  	watchdog_set_restart_priority(&pnx4008_wdd, 128);
>  
> -	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
> +	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
> +		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
>  
>  	ret = watchdog_register_device(&pnx4008_wdd);
>  	if (ret < 0) {
> -- 
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] watchdog: pnx4008: readout watchdog state
  2019-04-11 19:14 ` Alexandre Belloni
@ 2019-04-15  7:58   ` gregory.clement
  -1 siblings, 0 replies; 6+ messages in thread
From: gregory.clement @ 2019-04-15  7:58 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Guenter Roeck, Vladimir Zapolskiy, Wim Van Sebroeck,
	Sylvain Lemieux, linux-arm-kernel, linux-watchdog, linux-kernel

On 2019-04-11 21:14, Alexandre Belloni wrote:
> Readout the enabled state so it is possible to get the pre-userspace
> handler working. Also, avoid disabling the watchdog to ensure it 
> continues
> working and triggers if there is an issue later in the boot or if 
> userspace
> fails to start.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>


> ---
>  drivers/watchdog/pnx4008_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/pnx4008_wdt.c 
> b/drivers/watchdog/pnx4008_wdt.c
> index 8e261799c84e..4ce0389d1442 100644
> --- a/drivers/watchdog/pnx4008_wdt.c
> +++ b/drivers/watchdog/pnx4008_wdt.c
> @@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device 
> *pdev)
>  	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
>  	watchdog_set_restart_priority(&pnx4008_wdd, 128);
> 
> -	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
> +	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
> +		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
> 
>  	ret = watchdog_register_device(&pnx4008_wdd);
>  	if (ret < 0) {

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

* Re: [PATCH v2] watchdog: pnx4008: readout watchdog state
@ 2019-04-15  7:58   ` gregory.clement
  0 siblings, 0 replies; 6+ messages in thread
From: gregory.clement @ 2019-04-15  7:58 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-watchdog, linux-kernel, Vladimir Zapolskiy, Guenter Roeck,
	Sylvain Lemieux, Wim Van Sebroeck, linux-arm-kernel

On 2019-04-11 21:14, Alexandre Belloni wrote:
> Readout the enabled state so it is possible to get the pre-userspace
> handler working. Also, avoid disabling the watchdog to ensure it 
> continues
> working and triggers if there is an issue later in the boot or if 
> userspace
> fails to start.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>


> ---
>  drivers/watchdog/pnx4008_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/pnx4008_wdt.c 
> b/drivers/watchdog/pnx4008_wdt.c
> index 8e261799c84e..4ce0389d1442 100644
> --- a/drivers/watchdog/pnx4008_wdt.c
> +++ b/drivers/watchdog/pnx4008_wdt.c
> @@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device 
> *pdev)
>  	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
>  	watchdog_set_restart_priority(&pnx4008_wdd, 128);
> 
> -	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
> +	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
> +		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
> 
>  	ret = watchdog_register_device(&pnx4008_wdd);
>  	if (ret < 0) {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-15  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11 19:14 [PATCH v2] watchdog: pnx4008: readout watchdog state Alexandre Belloni
2019-04-11 19:14 ` Alexandre Belloni
2019-04-11 19:32 ` Guenter Roeck
2019-04-11 19:32   ` Guenter Roeck
2019-04-15  7:58 ` gregory.clement
2019-04-15  7:58   ` gregory.clement

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.