lkml.org 
[lkml]   [2023]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 2/3] watchdog: stm32_iwdg: Add pretimeout support
From
On 8/6/23 16:19, Guenter Roeck wrote:
> On Wed, May 17, 2023 at 09:43:48PM +0200, 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.

[...]

>> static int stm32_iwdg_probe(struct platform_device *pdev)
>> {
>> struct device *dev = &pdev->dev;
>> @@ -253,6 +340,11 @@ static int stm32_iwdg_probe(struct platform_device *pdev)
>> wdd->max_hw_heartbeat_ms = ((RLR_MAX + 1) * wdt->data->max_prescaler *
>> 1000) / wdt->rate;
>>
>> + /* Initialize IRQ, this might override wdd->info, hence it is here. */
>> + ret = stm32_iwdg_irq_init(pdev, wdt);
>> + if (ret)
>> + return ret;
>> +
>
> What if the interrupt fires for whatever reason and the watchdog
> isn't registered yet and the driver data is not set and the
> watchdog core doesn't know about the watchdog ?

That cannot happen since the pretimeout IRQ was not configured yet.
That can only happen once the core is aware of the WDT and calls
set_pretimeout .

\
 
 \ /
  Last update: 2023-09-01 23:01    [W:0.186 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site