Skip to contentSkip to conversation

watchdog: max6370: use __udelay() to avoid recursion

PATCH In review Pali Rohár 2 participants 3 messages Sep 27, 2022 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: max6370: use __udelay() to avoid recursion

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")
---
 drivers/watchdog/max6370_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/max6370_wdt.c +1 -1
index 556c6a4b6d6b..44872e23c586 100644
@@ -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);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Pali Rohár

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")

Thanks,
Stefan

Quoted 9 lines
---
  drivers/watchdog/max6370_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/max6370_wdt.c +0 -0
index 556c6a4b6d6b..44872e23c586 100644

drivers/watchdog/max6370_wdt.c static int max6370_wdt_reset(struct udevice *dev) · line 79

Quoted 8 lines
drivers/watchdog/max6370_wdt.c +1 -1
@@ -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

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: [email protected]
#2 lore raw
In reply to Pali Rohár
Quoted 5 lines · Pali Rohár

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")

Applied to u-boot-watchdog/master

Thanks,
Stefan

Quoted 9 lines
---
  drivers/watchdog/max6370_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/max6370_wdt.c +0 -0
index 556c6a4b6d6b..44872e23c586 100644

drivers/watchdog/max6370_wdt.c static int max6370_wdt_reset(struct udevice *dev) · line 79

Quoted 8 lines
drivers/watchdog/max6370_wdt.c +1 -1
@@ -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

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: [email protected]