Re: [Linux-stm32] [PATCH v3] watchdog: stm32_iwdg: Add pretimeout support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Marek,

On 3/21/24 02:11, Marek Vasut wrote:
The STM32MP15xx IWDG adds registers which permit this IP to generate
pretimeout interrupt. This interrupt can also be used to wake the CPU
from suspend. Implement support for generating this interrupt and let
userspace configure the pretimeout. In case the pretimeout is not
configured by user, set pretimeout to half of the WDT timeout cycle.

From the code below I see that the pretimeout is set to 75% and not 50% as you said.
For the rest you can put as you want :
Reviewed-by: Clément Le Goffic <clement.legoffic@xxxxxxxxxxx>
or
Tested-by: Clément Le Goffic <clement.legoffic@xxxxxxxxxxx>

...
@@ -88,13 +97,18 @@ static inline void reg_write(void __iomem *base, u32 reg, u32 val)
  static int stm32_iwdg_start(struct watchdog_device *wdd)
  {
  	struct stm32_iwdg *wdt = watchdog_get_drvdata(wdd);
-	u32 tout, presc, iwdg_rlr, iwdg_pr, iwdg_sr;
+	u32 tout, ptot, presc, iwdg_rlr, iwdg_ewcr, iwdg_pr, iwdg_sr;
  	int ret;
dev_dbg(wdd->parent, "%s\n", __func__); + if (!wdd->pretimeout)
+		wdd->pretimeout = 3 * wdd->timeout / 4;
+
...
Here is the 75% pretimeout.

Best regards,

Clément




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux