Hi Guenter, all,

> > After discussing this mail thread [1] again, we concluded that giving
> > userspace enough time to prepare is our favourite option. So, do not
> > keep the time value when suspended but reset it when resuming.
> > 
> > [1] https://patchwork.kernel.org/patch/10252209/
> > 
> > Signed-off-by: Wolfram Sang <[email protected]>
> 
> Above exchange says it all, no need to repeat.
> 
> Reviewed-by: Guenter Roeck <[email protected]>

Thanks.

I can relate to the policy argument, though. Regardless of this patch, I
wonder if we can make it configurable from userspace. A draft:

#define WDIOF_RESUME_OPTS       0x0800

#define WDIOS_RESUME_KEEP       0x0008
#define WDIOS_RESUME_RESET      0x0010

and then in watchdog_ioctl() under WDIOC_SETOPTIONS:

        if (!(wdd->info->options & WDIOF_RESUME_OPTS))
                err = -EOPNOTSUPP;
                goto break;

        if (val & WDIOS_RESUME_KEEP)
                wdd->status |= WDOG_KEEP_TIMER_WHEN_RESUME;

        if (val & WDIOS_RESUME_RESET)
                wdd->status ~= ~WDOG_KEEP_TIMER_WHEN_RESUME;

So, drivers with WDIOF_RESUME_OPTS could act on the
WDOG_KEEP_TIMER_WHEN_RESUME flag.

Opinions?

Thanks,

   Wolfram

Reply via email to