driver: watchdog: reset watchdog in designware_wdt_stop() function
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
From: MengLi <[email protected]>
In uboot command line environment, watchdog is not able to be stopped with below commands:SOCFPGA_STRATIX10 # wdt dev watchdog at ffd00200 SOCFPGA_STRATIX10 # wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset watchdog after disable it so that the disable action takes effect.
v2:
Change "#if CONFIG_IS_ENABLED(DM_RESET)" into
"if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable into if condition sentence.
--- drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/watchdog/designware_wdt.c +17 -0
@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets); +if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret) +return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 2/2 driver: watchdog: enable wdt command by default
From: MengLi <[email protected]>
In latest u-boot code, watchdog feature is implemented, so enable wdt command by default.
--- configs/socfpga_stratix10_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/socfpga_stratix10_defconfig +1 -0
@@ -40,6 +40,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_WDT=y CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
Signature · 1 line
2.17.1
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
In reply to Meng.Li at windriver.comQuoted 9 lines · Meng.Li at windriver.com
From: MengLi <[email protected]>
In uboot command line environment, watchdog is not able to be stopped with below commands:
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200SOCFPGA_STRATIX10# wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset watchdog after disable it so that the disable action takes effect.
Quoted 4 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into
"if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable into if condition sentence.
A few comments:
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed this patch.
Other that this:
Thanks,
Stefan
Quoted 24 lines
Signed-off-by Meng Li <[email protected]>--- drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/watchdog/designware_wdt.c +10
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets); +if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)
drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
Quoted 34 lines · Stefan Roese
Quoted 9 lines · Meng.Li at windriver.com
From: MengLi <[email protected]>
In uboot command line environment, watchdog is not able to be stopped with below commands:
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200SOCFPGA_STRATIX10# wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset watchdog after disable it so that the disable action takes effect.Quoted 4 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into
"if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable into if condition sentence.A few comments:
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed this patch.
Other that this:
Reviewed-by Stefan Roese <[email protected]>Thanks,
StefanQuoted 5 lines
Signed-off-by Meng Li <[email protected]>--- drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
Quoted 12 lines
drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 102
Quoted 12 lines
drivers/watchdog/designware_wdt.c +5
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets);
Have you considered adding the resets to designware_wdt_priv and saving them when we request them in probe()?
--Sean
Quoted 20 lines
Quoted 5 lines
drivers/watchdog/designware_wdt.c +5
-0+if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }Viele Gr??e,
Stefan
Li
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
Quoted 56 lines
-----Original Message-----
From: Sean Anderson <[email protected]>
Sent: Tuesday, April 27, 2021 10:50 PM
To: Stefan Roese <[email protected]>; Li, Meng <[email protected]>; u- boot at lists.denx.de; chin.liang.see at intel.com; dinh.nguyen at intel.com; sjg at chromium.org
Subject: Re: [PATCH v2, 1/2] driver: watchdog: reset watchdog indesignware_wdt_stop()function[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 2 lines · Stefan Roese
Quoted 1 line · Meng.Li at windriver.com
From: MengLi <[email protected]> >> >> In uboot command line
environment, watchdog is not able to be >> stopped with below commands:
Quoted 1 line
Quoted 1 line
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200>>
SOCFPGA_STRATIX10# wdt stop >> Refer to watchdog driver in linux kernel, it is also need to reset >> watchdog after disable it so that the disable action takes effect.Quoted 3 lines
Quoted 3 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into >> "if(
CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable >> into if condition sentence.Quoted 6 lines
A few comments:
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed >
this patch.
Quoted 4 lines
Other that this:
Signed-off-by Meng Li <[email protected]> >> ---Quoted 4 lines
Review
Quoted 4 lines
drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)(quoted diff) +0
-0
b/drivers/watchdog/designware_wdt.cQuoted 4 lines
drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice
Quoted 4 lines
index
12f09a7a39..57cad1effc100644drivers/watchdog/designware_wdt.c +0
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice*dev)
Quoted 7 lines
drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 103
Quoted 7 lines
drivers/watchdog/designware_wdt.c +5
-0designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets);
Quoted 3 lines
Have you considered adding the resets to
designware_wdt_privand saving them when we request them inprobe()?
Yes! thanks for reminding me.
But I want to fix this issue by modifying the minimum range code. Because I and not the original person of creating this driver. I don't want to other part of code if it is not essential.
Thanks,
Limeng
Quoted 22 lines
--Sean
Quoted 20 lines
Quoted 5 lines
drivers/watchdog/designware_wdt.c +5
-0+if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }Viele Gr??e,
Stefan
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
Quoted 56 lines · Meng
Quoted 56 lines
-----Original Message-----
From: Sean Anderson <[email protected]>
Sent: Tuesday, April 27, 2021 10:50 PM
To: Stefan Roese <[email protected]>; Li, Meng <[email protected]>; u- boot at lists.denx.de; chin.liang.see at intel.com; dinh.nguyen at intel.com; sjg at chromium.org
Subject: Re: [PATCH v2, 1/2] driver: watchdog: reset watchdog indesignware_wdt_stop()function[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 2 lines · Stefan Roese
Quoted 1 line · Meng.Li at windriver.com
From: MengLi <[email protected]> >> >> In uboot command line
environment, watchdog is not able to be >> stopped with below commands:
Quoted 1 line
Quoted 1 line
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200>>
SOCFPGA_STRATIX10# wdt stop >> Refer to watchdog driver in linux kernel, it is also need to reset >> watchdog after disable it so that the disable action takes effect.Quoted 3 lines
Quoted 3 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into >> "if(
CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable >> into if condition sentence.Quoted 6 lines
A few comments:
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed >
this patch.
Quoted 4 lines
Other that this:
Signed-off-by Meng Li <[email protected]> >> ---Quoted 4 lines
Review
Quoted 4 lines
drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)(quoted diff) +0
-0
b/drivers/watchdog/designware_wdt.cQuoted 4 lines
drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice
Quoted 4 lines
index
12f09a7a39..57cad1effc100644drivers/watchdog/designware_wdt.c +0
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice*dev)
Quoted 7 lines
Quoted 7 lines
drivers/watchdog/designware_wdt.c +5
-0designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets);
Quoted 5 lines
Quoted 3 lines
Have you considered adding the resets to
designware_wdt_privand saving them when we request them inprobe()?Yes! thanks for reminding me.
Yes. Since the reset gets referenced multiple times (with your addition now), this absolutely makes sense.
Quoted 3 lines
But I want to fix this issue by modifying the minimum range code. Because I and not the original person of creating this driver. I don't want to other part of code if it is not essential.
That's not the way this open source development works. Please make the suggested changes and submit the patch for review. The review process with potential tests should catch potential issues.
Thanks,
Stefan
Quoted 25 lines
Thanks,
LimengQuoted 22 lines
--Sean
Quoted 20 lines
Quoted 5 lines
drivers/watchdog/designware_wdt.c +5
-0+if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }Viele Gr??e,
Stefan
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
Li
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
In reply to Stefan RoeseQuoted 29 lines
-----Original Message-----
From: Stefan Roese <[email protected]>
Sent: Tuesday, April 27, 2021 10:23 PM
To: Li, Meng <[email protected]>; u-boot at lists.denx.de; chin.liang.see at intel.com; dinh.nguyen at intel.com; sjg at chromium.org
Subject: Re: [PATCH v2, 1/2] driver: watchdog: reset watchdog indesignware_wdt_stop()function[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 9 lines · Meng.Li at windriver.com
From: MengLi <[email protected]>
In uboot command line environment, watchdog is not able to be stopped with below commands:
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200SOCFPGA_STRATIX10# wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset watchdog after disable it so that the disable action takes effect.Quoted 4 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into "if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable into if condition sentence.A few comments:
Quoted 9 lines
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed this patch.
Other that this:
Reviewed-by Stefan Roese <[email protected]>
Would you like me to add "Cc:" into comment log, too? Or only CC to you in mail list?
Thanks,
Limeng
Quoted 47 lines
Thanks,
StefanQuoted 25 lines
Signed-off-by Meng Li <[email protected]>--- drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/watchdog/designware_wdt.c +10
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets); +if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }Viele Gr??e,
Stefan--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH v2 1/2 driver: watchdog: reset watchdog in designware_wdt_stop() function
Quoted 34 lines · Meng
Quoted 34 lines
-----Original Message-----
From: Stefan Roese <[email protected]>
Sent: Tuesday, April 27, 2021 10:23 PM
To: Li, Meng <[email protected]>; u-boot at lists.denx.de; chin.liang.see at intel.com; dinh.nguyen at intel.com; sjg at chromium.org
Subject: Re: [PATCH v2, 1/2] driver: watchdog: reset watchdog indesignware_wdt_stop()function[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 9 lines · Meng.Li at windriver.com
From: MengLi <[email protected]>
In uboot command line environment, watchdog is not able to be stopped with below commands:
SOCFPGA_STRATIX10# wdt dev watchdog atffd00200SOCFPGA_STRATIX10# wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset watchdog after disable it so that the disable action takes effect.Quoted 4 lines
v2:
Change "#ifCONFIG_IS_ENABLED(DM_RESET)" into "if (CONFIG_IS_ENABLED(DM_RESET)) {", and define the variable into if condition sentence.A few comments:
This version changelog belongs below the "---" line.
Please Cc interested people upon new versions, e.g. myself as I reviewed this patch.
Quoted 7 lines
Quoted 4 lines
Other that this:
Reviewed-by Stefan Roese <[email protected]>Would you like me to add "Cc:" into comment log, too? Or only CC to you in mail list?
That's up to you. But when you put the Cc: in the commit text (below the Reviewed-by tag), then "git send-email" will automatically Cc all listed addresses.
Thanks,
Stefan
Quoted 50 lines
Thanks,
LimengQuoted 47 lines
Thanks,
StefanQuoted 25 lines
Signed-off-by Meng Li <[email protected]>--- drivers/watchdog/designware_wdt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/watchdog/designware_wdt.c +10
-0@@ -96,6 +96,23 @@ static int designware_wdt_stop(struct udevice *dev)designware_wdt_reset (dev);writel (0 , priv->base +DW_WDT_CR ); +if (CONFIG_IS_ENABLED (DM_RESET )) { +struct reset_ctl_bulk resets; +int ret; + + ret =reset_get_bulk (dev, &resets); +if (ret) +return ret; + + ret =reset_assert_bulk (&resets); +if (ret)drivers/watchdog/designware_wdt.c static int designware_wdt_stop(struct udevice *dev) · line 118
Quoted 10 lines
drivers/watchdog/designware_wdt.c +7
-0+return ret; + + ret =reset_deassert_bulk (&resets); +if (ret) +return ret; + } +return 0 ; }Viele Gr??e,
Stefan--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de