Skip to contentSkip to conversation

watchdog: imx2_wdt: use new_timeout value to override the old

PATCH In review [email protected] 2 participants 3 messages Jul 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: imx2_wdt: use new_timeout value to override the old

From: Yanjiang Jin <[email protected]>

Without this patch we couldn't change the timeout value of imx2_wdt.

---
 drivers/watchdog/imx2_wdt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/watchdog/imx2_wdt.c +3 -0
index 4874b0f..6cfeee6 100644
@@ -178,6 +178,9 @@ static int imx2_wdt_set_timeout(struct watchdog_device *wdog,
 
 	regmap_update_bits(wdev->regmap, IMX2_WDT_WCR, IMX2_WDT_WCR_WT,
 			   WDOG_SEC_TO_COUNT(new_timeout));
+
+	wdog->timeout = new_timeout;
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · On 07/19/2017 07:45 PM, [email protected] wrote:

From: Yanjiang Jin <[email protected]>

Without this patch we couldn't change the timeout value of imx2_wdt.

---
  drivers/watchdog/imx2_wdt.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/watchdog/imx2_wdt.c +0 -0
index 4874b0f..6cfeee6 100644

drivers/watchdog/imx2_wdt.c static int imx2_wdt_set_timeout(struct watchdog_device *wdog, · line 183

Quoted 6 lines
drivers/watchdog/imx2_wdt.c +3 -0
@@ -178,6 +178,9 @@ static int imx2_wdt_set_timeout(struct watchdog_device *wdog,
 
  	regmap_update_bits(wdev->regmap, IMX2_WDT_WCR, IMX2_WDT_WCR_WT,
  			   WDOG_SEC_TO_COUNT(new_timeout));
+
+	wdog->timeout = new_timeout;
+

I must be missing something. That very same code is already in line 177, added with commit 30dd4a8f08b57 ("watchdog: imx2_wdt: also set wdog->timeout to new_timeout") back in 2015.

Did you see this in an older kernel, maybe ?

Guenter

author
#2 lore raw
Quoted 26 lines · Guenter Roeck
Quoted 14 lines · On 07/19/2017 07:45 PM, [email protected] wrote:

From: Yanjiang Jin <[email protected]>

Without this patch we couldn't change the timeout value of imx2_wdt.

---
  drivers/watchdog/imx2_wdt.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/watchdog/imx2_wdt.c +0 -0
index 4874b0f..6cfeee6 100644

drivers/watchdog/imx2_wdt.c static int imx2_wdt_set_timeout(struct · line 183

Quoted 6 lines
drivers/watchdog/imx2_wdt.c +3 -0
@@ -178,6 +178,9 @@ static int imx2_wdt_set_timeout(struct 
 watchdog_device *wdog,
        regmap_update_bits(wdev->regmap, IMX2_WDT_WCR, IMX2_WDT_WCR_WT,
                 WDOG_SEC_TO_COUNT(new_timeout));
+
+    wdog->timeout = new_timeout;
+

I must be missing something. That very same code is already in line 177, added with commit 30dd4a8f08b57 ("watchdog: imx2_wdt: also set wdog->timeout to new_timeout") back in 2015.

Quoted 1 line

Did you see this in an older kernel, maybe ?

Oh, I missed this. I did use the older kernel to validate it. Thanks for your reminder, please ignore my patch. Thanks again!

Regards!
Yanjiang

Quoted 2 lines

Guenter