All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: max6370: use __udelay() to avoid recursion
@ 2022-09-27 10:19 Pali Rohár
  2022-09-27 10:22 ` Stefan Roese
  2022-09-27 12:46 ` Stefan Roese
  0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2022-09-27 10:19 UTC (permalink / raw)
  To: Stefan Roese; +Cc: u-boot, Marek Behún, Josef Schlehofer

The udelay() function in lib/time.c contains a WATCHDOG_RESET()
call. So use __udelay() in max6370_wdt.c to prevent recursion.

Fixes: 0a095fc53b15 ("watchdog: Add MAX6370 watchdog timer driver")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/watchdog/max6370_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/max6370_wdt.c b/drivers/watchdog/max6370_wdt.c
index 556c6a4b6d6b..44872e23c586 100644
--- a/drivers/watchdog/max6370_wdt.c
+++ b/drivers/watchdog/max6370_wdt.c
@@ -73,7 +73,7 @@ static int max6370_wdt_reset(struct udevice *dev)
 
 	if (dm_gpio_is_valid(&wdt->gpio_wdi)) {
 		dm_gpio_set_value(&wdt->gpio_wdi, 1);
-		udelay(1);
+		__udelay(1);
 		dm_gpio_set_value(&wdt->gpio_wdi, 0);
 	} else {
 		val = readb(wdt->reg);
-- 
2.20.1


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

* Re: [PATCH] watchdog: max6370: use __udelay() to avoid recursion
  2022-09-27 10:19 [PATCH] watchdog: max6370: use __udelay() to avoid recursion Pali Rohár
@ 2022-09-27 10:22 ` Stefan Roese
  2022-09-27 12:46 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2022-09-27 10:22 UTC (permalink / raw)
  To: Pali Rohár; +Cc: u-boot, Marek Behún, Josef Schlehofer

On 27.09.22 12:19, Pali Rohár wrote:
> The udelay() function in lib/time.c contains a WATCHDOG_RESET()
> call. So use __udelay() in max6370_wdt.c to prevent recursion.
> 
> Fixes: 0a095fc53b15 ("watchdog: Add MAX6370 watchdog timer driver")
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   drivers/watchdog/max6370_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/max6370_wdt.c b/drivers/watchdog/max6370_wdt.c
> index 556c6a4b6d6b..44872e23c586 100644
> --- a/drivers/watchdog/max6370_wdt.c
> +++ b/drivers/watchdog/max6370_wdt.c
> @@ -73,7 +73,7 @@ static int max6370_wdt_reset(struct udevice *dev)
>   
>   	if (dm_gpio_is_valid(&wdt->gpio_wdi)) {
>   		dm_gpio_set_value(&wdt->gpio_wdi, 1);
> -		udelay(1);
> +		__udelay(1);
>   		dm_gpio_set_value(&wdt->gpio_wdi, 0);
>   	} else {
>   		val = readb(wdt->reg);

Viele Grüße,
Stefan Roese

-- 
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@denx.de

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

* Re: [PATCH] watchdog: max6370: use __udelay() to avoid recursion
  2022-09-27 10:19 [PATCH] watchdog: max6370: use __udelay() to avoid recursion Pali Rohár
  2022-09-27 10:22 ` Stefan Roese
@ 2022-09-27 12:46 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2022-09-27 12:46 UTC (permalink / raw)
  To: Pali Rohár; +Cc: u-boot, Marek Behún, Josef Schlehofer

On 27.09.22 12:19, Pali Rohár wrote:
> The udelay() function in lib/time.c contains a WATCHDOG_RESET()
> call. So use __udelay() in max6370_wdt.c to prevent recursion.
> 
> Fixes: 0a095fc53b15 ("watchdog: Add MAX6370 watchdog timer driver")
> Signed-off-by: Pali Rohár <pali@kernel.org>

Applied to u-boot-watchdog/master

Thanks,
Stefan

> ---
>   drivers/watchdog/max6370_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/max6370_wdt.c b/drivers/watchdog/max6370_wdt.c
> index 556c6a4b6d6b..44872e23c586 100644
> --- a/drivers/watchdog/max6370_wdt.c
> +++ b/drivers/watchdog/max6370_wdt.c
> @@ -73,7 +73,7 @@ static int max6370_wdt_reset(struct udevice *dev)
>   
>   	if (dm_gpio_is_valid(&wdt->gpio_wdi)) {
>   		dm_gpio_set_value(&wdt->gpio_wdi, 1);
> -		udelay(1);
> +		__udelay(1);
>   		dm_gpio_set_value(&wdt->gpio_wdi, 0);
>   	} else {
>   		val = readb(wdt->reg);

Viele Grüße,
Stefan Roese

-- 
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@denx.de

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

end of thread, other threads:[~2022-09-27 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 10:19 [PATCH] watchdog: max6370: use __udelay() to avoid recursion Pali Rohár
2022-09-27 10:22 ` Stefan Roese
2022-09-27 12:46 ` Stefan Roese

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.