[PATCH 0/3 v3] watchdog: meson_gxbb_wdt: improve

STALE1834d

Revision v3 of 3 in this series.

7 messages, 2 authors, 2021-07-30 · open the first message on its own page

[PATCH 0/3 v3] watchdog: meson_gxbb_wdt: improve

From: Artem Lapkin <hidden>
Date: 2021-07-29 07:23:42

Improve meson_gxbb_wdt driver

Source: https://lore.kernel.org/linux-watchdog/5229d62c-b327-254f-800f-1524f27491b3@roeck-us.net/T/
Remade using all suggestions from Guenter

* Added nowayout module parameter
* Added timeout module parameter
* Removed watchdog_stop_on_reboot (I feel that it is important to keep
the watchdog running during the reboot sequence, in the event that an
abnormal driver freezes the reboot process. This is my  personal opinion
and I hope the driver authors will agree with my proposal, if not just
ignore this last commit)

Artem Lapkin (3):
  watchdog: meson_gxbb_wdt: add nowayout parameter
  watchdog: meson_gxbb_wdt: add timeout parameter
  watchdog: meson_gxbb_wdt: remove stop_on_reboot

 drivers/watchdog/meson_gxbb_wdt.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

-- 
2.25.1


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

[PATCH] watchdog: meson_gxbb_wdt: add nowayout parameter

From: Artem Lapkin <hidden>
Date: 2021-07-29 07:24:12

Add nowayout module parameter

Signed-off-by: Artem Lapkin <redacted>
---
 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 5a9ca10fb..5aebc3a09 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 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;
@@ -175,6 +180,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 	data->wdt_dev.max_hw_heartbeat_ms = GXBB_WDT_TCNT_SETUP_MASK;
 	data->wdt_dev.min_timeout = 1;
 	data->wdt_dev.timeout = DEFAULT_TIMEOUT;
+	watchdog_set_nowayout(&data->wdt_dev, nowayout);
 	watchdog_set_drvdata(&data->wdt_dev, data);
 
 	/* Setup with 1ms timebase */
-- 
2.25.1


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

[PATCH] watchdog: meson_gxbb_wdt: add timeout parameter

From: Artem Lapkin <hidden>
Date: 2021-07-29 07:24:21

Add timeout module parameter

Signed-off-by: Artem Lapkin <redacted>
---
 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 5aebc3a09..3f3866878 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -34,6 +34,11 @@ module_param(nowayout, bool, 0);
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started default="
 		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
+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;
@@ -180,6 +185,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 	data->wdt_dev.max_hw_heartbeat_ms = GXBB_WDT_TCNT_SETUP_MASK;
 	data->wdt_dev.min_timeout = 1;
 	data->wdt_dev.timeout = DEFAULT_TIMEOUT;
+	watchdog_init_timeout(&data->wdt_dev, timeout, dev);
 	watchdog_set_nowayout(&data->wdt_dev, nowayout);
 	watchdog_set_drvdata(&data->wdt_dev, data);
 
-- 
2.25.1


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

[PATCH] watchdog: meson_gxbb_wdt: remove stop_on_reboot

From: Artem Lapkin <hidden>
Date: 2021-07-29 07:24:25

Remove watchdog_stop_on_reboot()

Signed-off-by: Artem Lapkin <redacted>
---
 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 3f3866878..cafc6cdc0 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -198,7 +198,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


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

Re: [PATCH] watchdog: meson_gxbb_wdt: add timeout parameter

From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-07-29 14:15:13

On 7/29/21 12:23 AM, Artem Lapkin wrote:
quoted hunk
Add timeout module parameter

Signed-off-by: Artem Lapkin <redacted>
---
  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 5aebc3a09..3f3866878 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -34,6 +34,11 @@ module_param(nowayout, bool, 0);
  MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started default="
  		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
+static unsigned int timeout = DEFAULT_TIMEOUT;
DEFAULT_TIMEOUT is already set below. The default for the module parameter
should be 0. This way the watchdog core takes the value from devicetree
unless a module parameter is provided.

Guenter
quoted hunk
+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;
@@ -180,6 +185,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
  	data->wdt_dev.max_hw_heartbeat_ms = GXBB_WDT_TCNT_SETUP_MASK;
  	data->wdt_dev.min_timeout = 1;
  	data->wdt_dev.timeout = DEFAULT_TIMEOUT;
+	watchdog_init_timeout(&data->wdt_dev, timeout, dev);
  	watchdog_set_nowayout(&data->wdt_dev, nowayout);
  	watchdog_set_drvdata(&data->wdt_dev, data);
  

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

Re: [PATCH] watchdog: meson_gxbb_wdt: remove stop_on_reboot

From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-07-29 14:23:55

On 7/29/21 12:23 AM, Artem Lapkin wrote:
Remove watchdog_stop_on_reboot()
This warrants a much longer explanation to even be considered.
Your explanation/reasoning needs to be here. Others won't have
the benefit of reading the summary e-mail, even more so since
you declined to number and sequence the series.

Personally' I don't find it acceptable, but I'll be happy to
listen to input from others. Such changes should be based on
real problems, not on personal opinions. If we accept this patch,
someone else might come in later reverting it with the personal
opinion that some reboots take longer than the watchdog timeout.

Guenter
quoted hunk
Signed-off-by: Artem Lapkin <redacted>
---
  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 3f3866878..cafc6cdc0 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -198,7 +198,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);
  }
  

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

Re: [PATCH] watchdog: meson_gxbb_wdt: remove stop_on_reboot

From: Art Nikpal <hidden>
Date: 2021-07-30 02:09:32

Yes i totally agree with you , i will rewrite this patches again
properly and explain more detail about why need remove
watchdog_stop_on_reboot

i have check already other watchdog sources / half of them have
watchdog_stop_on_reboot another half dont have it , and i think both
have some reasons
I'll be happy tolisten to input from others.
Same will be happy.

Our situation very simple - meson platform still have some hardware
drivers problems for some configuration which can freeze device on
shutdown/reboot stage and i hope better to have some reboot warranty
some reboots take longer than the watchdog timeout.
I have check this situation to - our drivers shutdown stage its about
1 sec default watchdog timeout 30 sec i think its enough - cant see
any problem
anybody can use watchdog.stop_on_reboot=1 if need freeze identification.

Artem

On Thu, Jul 29, 2021 at 10:23 PM Guenter Roeck [off-list ref] wrote:
On 7/29/21 12:23 AM, Artem Lapkin wrote:
quoted
Remove watchdog_stop_on_reboot()
This warrants a much longer explanation to even be considered.
Your explanation/reasoning needs to be here. Others won't have
the benefit of reading the summary e-mail, even more so since
you declined to number and sequence the series.

Personally' I don't find it acceptable, but I'll be happy to
listen to input from others. Such changes should be based on
real problems, not on personal opinions. If we accept this patch,
someone else might come in later reverting it with the personal
opinion that some reboots take longer than the watchdog timeout.

Guenter
quoted
Signed-off-by: Artem Lapkin <redacted>
---
  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 3f3866878..cafc6cdc0 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -198,7 +198,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);
  }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help