linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve
@ 2021-06-23  2:44 Artem Lapkin
  2021-06-23  2:44 ` [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot Artem Lapkin
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Try to improve meson_gxbb_wdt driver to common view:

* Remove watchdog_stop_on_reboot (still can be activated by
watchdog.stop_on_reboot=1) i think this driver configuration more useful
becouse we can get reboot waranty for abnormal situations on shutdown stage

* Added timeout module param same as in other modules
* Added nowayout module param same as in other moduels
* Added missed watchdog_stop_on_unregister call
* Print watchdog success driver start status notification

Artem Lapkin (5):
  watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot
  watchdog: meson_gxbb_wdt: add timeout module param
  watchdog: meson_gxbb_wdt: add nowayout module param
  watchdog: meson_gxbb_wdt: add stop_on_unregister
  watchdog: meson_gxbb_wdt: add register device status notification

 drivers/watchdog/meson_gxbb_wdt.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

-- 
2.25.1


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

* [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot
  2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
@ 2021-06-23  2:44 ` Artem Lapkin
  2021-06-27 15:29   ` Guenter Roeck
  2021-06-23  2:44 ` [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param Artem Lapkin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Remove watchdog_stop_on_reboot (still can be activated by
watchdog.stop_on_reboot=1) i think this driver configuration more useful
becouse we can get reboot waranty for abnormal situations on shutdown stage

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index 5a9ca10fbcfa..3f86530c33b0 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -186,7 +186,6 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 
 	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
 
-	watchdog_stop_on_reboot(&data->wdt_dev);
 	return devm_watchdog_register_device(dev, &data->wdt_dev);
 }
 
-- 
2.25.1


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

* [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param
  2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
  2021-06-23  2:44 ` [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot Artem Lapkin
@ 2021-06-23  2:44 ` Artem Lapkin
  2021-06-27 15:32   ` Guenter Roeck
  2021-06-23  2:44 ` [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout " Artem Lapkin
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Added timeout module param same as in other modules

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index 3f86530c33b0..ecd1fc6f48ba 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -29,6 +29,11 @@
 #define GXBB_WDT_TCNT_SETUP_MASK		(BIT(16) - 1)
 #define GXBB_WDT_TCNT_CNT_SHIFT			16
 
+static unsigned int timeout = DEFAULT_TIMEOUT;
+module_param(timeout, uint, 0);
+MODULE_PARM_DESC(timeout, "Watchdog heartbeat in seconds="
+		 __MODULE_STRING(DEFAULT_TIMEOUT) ")");
+
 struct meson_gxbb_wdt {
 	void __iomem *reg_base;
 	struct watchdog_device wdt_dev;
@@ -174,7 +179,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 	data->wdt_dev.ops = &meson_gxbb_wdt_ops;
 	data->wdt_dev.max_hw_heartbeat_ms = GXBB_WDT_TCNT_SETUP_MASK;
 	data->wdt_dev.min_timeout = 1;
-	data->wdt_dev.timeout = DEFAULT_TIMEOUT;
+	data->wdt_dev.timeout = timeout;
 	watchdog_set_drvdata(&data->wdt_dev, data);
 
 	/* Setup with 1ms timebase */
-- 
2.25.1


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

* [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout module param
  2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
  2021-06-23  2:44 ` [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot Artem Lapkin
  2021-06-23  2:44 ` [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param Artem Lapkin
@ 2021-06-23  2:44 ` Artem Lapkin
  2021-06-27 15:37   ` Guenter Roeck
  2021-06-23  2:44 ` [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister Artem Lapkin
  2021-06-23  2:44 ` [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification Artem Lapkin
  4 siblings, 1 reply; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Added nowayout module param same as in other moduels

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index ecd1fc6f48ba..0bf5dccf70b1 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -34,6 +34,11 @@ module_param(timeout, uint, 0);
 MODULE_PARM_DESC(timeout, "Watchdog heartbeat in seconds="
 		 __MODULE_STRING(DEFAULT_TIMEOUT) ")");
 
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started default="
+		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
 struct meson_gxbb_wdt {
 	void __iomem *reg_base;
 	struct watchdog_device wdt_dev;
@@ -190,6 +195,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 		data->reg_base + GXBB_WDT_CTRL_REG);
 
 	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
+	watchdog_set_nowayout(&data->wdt_dev, nowayout);
 
 	return devm_watchdog_register_device(dev, &data->wdt_dev);
 }
-- 
2.25.1


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

* [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister
  2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
                   ` (2 preceding siblings ...)
  2021-06-23  2:44 ` [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout " Artem Lapkin
@ 2021-06-23  2:44 ` Artem Lapkin
  2021-06-27 15:42   ` Guenter Roeck
  2021-06-23  2:44 ` [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification Artem Lapkin
  4 siblings, 1 reply; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Added missed watchdog_stop_on_unregister call

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index 0bf5dccf70b1..2dbe254e5122 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -196,6 +196,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 
 	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
 	watchdog_set_nowayout(&data->wdt_dev, nowayout);
+	watchdog_stop_on_unregister(&data->wdt_dev);
 
 	return devm_watchdog_register_device(dev, &data->wdt_dev);
 }
-- 
2.25.1


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

* [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification
  2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
                   ` (3 preceding siblings ...)
  2021-06-23  2:44 ` [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister Artem Lapkin
@ 2021-06-23  2:44 ` Artem Lapkin
  2021-06-27 15:45   ` Guenter Roeck
  4 siblings, 1 reply; 11+ messages in thread
From: Artem Lapkin @ 2021-06-23  2:44 UTC (permalink / raw)
  To: narmstrong
  Cc: wim, linux, khilman, jbrunet, christianshewitt,
	martin.blumenstingl, linux-watchdog, linux-arm-kernel,
	linux-amlogic, linux-kernel, art, nick, gouwa

Print watchdog success driver start status notification

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index 2dbe254e5122..750b304b460d 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -198,7 +198,14 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 	watchdog_set_nowayout(&data->wdt_dev, nowayout);
 	watchdog_stop_on_unregister(&data->wdt_dev);
 
-	return devm_watchdog_register_device(dev, &data->wdt_dev);
+	ret = devm_watchdog_register_device(dev, &data->wdt_dev);
+	if (ret)
+		return ret;
+
+	dev_info(dev, "Watchdog enabled (timeout=%d sec, nowayout=%d)",
+		 data->wdt_dev.timeout, nowayout);
+
+	return ret;
 }
 
 static struct platform_driver meson_gxbb_wdt_driver = {
-- 
2.25.1


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

* Re: [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot
  2021-06-23  2:44 ` [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot Artem Lapkin
@ 2021-06-27 15:29   ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-27 15:29 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: wim, khilman, jbrunet, christianshewitt, martin.blumenstingl,
	linux-watchdog, linux-arm-kernel, linux-amlogic, linux-kernel,
	art, nick, gouwa

On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Remove watchdog_stop_on_reboot (still can be activated by
> watchdog.stop_on_reboot=1) i think this driver configuration more useful
> becouse we can get reboot waranty for abnormal situations on shutdown stage
> 

This is personal opinion. Driver authors would have to agree.

Guenter

> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index 5a9ca10fbcfa..3f86530c33b0 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -186,7 +186,6 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   
>   	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
>   
> -	watchdog_stop_on_reboot(&data->wdt_dev);
>   	return devm_watchdog_register_device(dev, &data->wdt_dev);
>   }
>   
> 


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

* Re: [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param
  2021-06-23  2:44 ` [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param Artem Lapkin
@ 2021-06-27 15:32   ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-27 15:32 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: wim, khilman, jbrunet, christianshewitt, martin.blumenstingl,
	linux-watchdog, linux-arm-kernel, linux-amlogic, linux-kernel,
	art, nick, gouwa

On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Added timeout module param same as in other modules
> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index 3f86530c33b0..ecd1fc6f48ba 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -29,6 +29,11 @@
>   #define GXBB_WDT_TCNT_SETUP_MASK		(BIT(16) - 1)
>   #define GXBB_WDT_TCNT_CNT_SHIFT			16
>   
> +static unsigned int timeout = DEFAULT_TIMEOUT;
> +module_param(timeout, uint, 0);
> +MODULE_PARM_DESC(timeout, "Watchdog heartbeat in seconds="
> +		 __MODULE_STRING(DEFAULT_TIMEOUT) ")");
> +
>   struct meson_gxbb_wdt {
>   	void __iomem *reg_base;
>   	struct watchdog_device wdt_dev;
> @@ -174,7 +179,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   	data->wdt_dev.ops = &meson_gxbb_wdt_ops;
>   	data->wdt_dev.max_hw_heartbeat_ms = GXBB_WDT_TCNT_SETUP_MASK;
>   	data->wdt_dev.min_timeout = 1;
> -	data->wdt_dev.timeout = DEFAULT_TIMEOUT;
> +	data->wdt_dev.timeout = timeout;

This is wrong. A timeout module parameter should be set with a call to
watchdog_init_timeout(), the initial value should be 0, and data->wdt_dev.timeout
should be kept as-is. This ensures that the module parameter is validated.

Guenter

>   	watchdog_set_drvdata(&data->wdt_dev, data);
>   
>   	/* Setup with 1ms timebase */
> 


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

* Re: [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout module param
  2021-06-23  2:44 ` [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout " Artem Lapkin
@ 2021-06-27 15:37   ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-27 15:37 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: wim, khilman, jbrunet, christianshewitt, martin.blumenstingl,
	linux-watchdog, linux-arm-kernel, linux-amlogic, linux-kernel,
	art, nick, gouwa

On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Added nowayout module param same as in other moduels

Please use complete sentences and words, check your spelling (modules),
and refrain from irrelevant statements such as "same as in other moduels".

"Add nowayout module parameter" is sufficient here.

> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index ecd1fc6f48ba..0bf5dccf70b1 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -34,6 +34,11 @@ module_param(timeout, uint, 0);
>   MODULE_PARM_DESC(timeout, "Watchdog heartbeat in seconds="
>   		 __MODULE_STRING(DEFAULT_TIMEOUT) ")");
>   
> +static bool nowayout = WATCHDOG_NOWAYOUT;
> +module_param(nowayout, bool, 0);
> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started default="

'(' missing before 'default'

> +		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> +
>   struct meson_gxbb_wdt {
>   	void __iomem *reg_base;
>   	struct watchdog_device wdt_dev;
> @@ -190,6 +195,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   		data->reg_base + GXBB_WDT_CTRL_REG);
>   
>   	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
> +	watchdog_set_nowayout(&data->wdt_dev, nowayout);
>   
>   	return devm_watchdog_register_device(dev, &data->wdt_dev);
>   }
> 


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

* Re: [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister
  2021-06-23  2:44 ` [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister Artem Lapkin
@ 2021-06-27 15:42   ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-27 15:42 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: wim, khilman, jbrunet, christianshewitt, martin.blumenstingl,
	linux-watchdog, linux-arm-kernel, linux-amlogic, linux-kernel,
	art, nick, gouwa

On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Added missed watchdog_stop_on_unregister call
> 

This is again personal opinion and needs an acknowledgement
by driver authors. It is only necessary if one wants to support
that the watchdog is force-stopped by killing the watchdog daemon
(which leaves the watchdog running) and subsequently unloading
the driver. The call is not 'missing'; otherwise the core could
just do it. For that reason it should not be added with the argument
that it would be 'missing'. This will require a better argument.
Why is that call needed ? What is the use case ?

Guenter

> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index 0bf5dccf70b1..2dbe254e5122 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -196,6 +196,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   
>   	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
>   	watchdog_set_nowayout(&data->wdt_dev, nowayout);
> +	watchdog_stop_on_unregister(&data->wdt_dev);
>   
>   	return devm_watchdog_register_device(dev, &data->wdt_dev);
>   }
> 


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

* Re: [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification
  2021-06-23  2:44 ` [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification Artem Lapkin
@ 2021-06-27 15:45   ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-27 15:45 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: wim, khilman, jbrunet, christianshewitt, martin.blumenstingl,
	linux-watchdog, linux-arm-kernel, linux-amlogic, linux-kernel,
	art, nick, gouwa

On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Print watchdog success driver start status notification
> 

Another personal opinion: The driver author decided that the message is
not needed (which matches my personal opinion). I'd rather see all those
messages either go away or moved to the core. Either case, this one is
misleading: The watchdog is _not_ enabled. The watchdog driver is loaded,
which is different.

Guenter

> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index 2dbe254e5122..750b304b460d 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -198,7 +198,14 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   	watchdog_set_nowayout(&data->wdt_dev, nowayout);
>   	watchdog_stop_on_unregister(&data->wdt_dev);
>   
> -	return devm_watchdog_register_device(dev, &data->wdt_dev);
> +	ret = devm_watchdog_register_device(dev, &data->wdt_dev);
> +	if (ret)
> +		return ret;
> +
> +	dev_info(dev, "Watchdog enabled (timeout=%d sec, nowayout=%d)",
> +		 data->wdt_dev.timeout, nowayout);
> +
> +	return ret;
>   }
>   
>   static struct platform_driver meson_gxbb_wdt_driver = {
> 


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

end of thread, other threads:[~2021-06-27 15:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  2:44 [PATCH 0/5 v2] watchdog: meson_gxbb_wdt: improve Artem Lapkin
2021-06-23  2:44 ` [PATCH 1/5] watchdog: meson_gxbb_wdt: remove watchdog_stop_on_reboot Artem Lapkin
2021-06-27 15:29   ` Guenter Roeck
2021-06-23  2:44 ` [PATCH 2/5] watchdog: meson_gxbb_wdt: add timeout module param Artem Lapkin
2021-06-27 15:32   ` Guenter Roeck
2021-06-23  2:44 ` [PATCH 3/5] watchdog: meson_gxbb_wdt: add nowayout " Artem Lapkin
2021-06-27 15:37   ` Guenter Roeck
2021-06-23  2:44 ` [PATCH 4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister Artem Lapkin
2021-06-27 15:42   ` Guenter Roeck
2021-06-23  2:44 ` [PATCH 5/5] watchdog: meson_gxbb_wdt: add register device status notification Artem Lapkin
2021-06-27 15:45   ` 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).