Re: [PATCH v2 1/3] dt-bindings: rtc: add reset-source property

From: Rob Herring
Date: Thu Dec 17 2020 - 14:03:31 EST


On Thu, Dec 17, 2020 at 12:12 PM Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
> On Thu, Dec 17, 2020 at 10:51:08AM -0600, Rob Herring wrote:
> > On Fri, Dec 11, 2020 at 5:10 PM Rasmus Villemoes
> > <rasmus.villemoes@xxxxxxxxx> wrote:
> > >
> > > On 11/12/2020 23.30, Rob Herring wrote:
> > > > On Fri, Dec 11, 2020 at 3:56 PM Rasmus Villemoes
> > > > <rasmus.villemoes@xxxxxxxxx> wrote:
> > > >>
> > > >> Some RTCs, e.g. the pcf2127, can be used as a hardware watchdog. But
> > > >> if the reset pin is not actually wired up, the driver exposes a
> > > >> watchdog device that doesn't actually work.
> > > >>
> > > >> Provide a standard binding that can be used to indicate that a given
> > > >> RTC can perform a reset of the machine, similar to wakeup-source.
> > > >
> > > > Why not use the watchdog 'timeout-sec' property?
> > >
> > > Wouldn't that be overloading that property? AFAIU, that is used to ask
> > > the kernel to program an initial timeout value into the watchdog device.
> > > But what if one doesn't want to start the watchdog device at kernel
> > > boot, but just indicate that the RTC has that capability?
> >
> > Yeah, I guess you're right.
>
> I agree, too. The initial suggestion looks fine.
>
> > > It's quite possible that if it can act as a watchdog device (and
> > > has-watchdog was also suggested), one would also want timeout-sec and
> > > other watchdog bindings to apply. But that can be added later, by those
> > > who actually want that.
> > >
> > > For now, I'd really like to get my board booting again (or rather, not
> > > get reset by the real watchdog just because the pcf2127 driver now
> > > exposes something as /dev/wathdog0, pushing the real one to
> > > /dev/wathcdog1 which doesn't get pinged from userspace).
> >
> > I'm wondering how you solve which wdog to ping when there are multiple
> > without relying on numbering. I guess 'reset-source' will solve that
> > even if that's not your current fix. So I guess I'm fine with this.
>
> I guess you'd need some udev magic that ensures that the right watchdog
> always gets the same number.

Why involve udev and keep the magic numbering important? Provide
enough details on watchdogs' features so an intelligent decision can
be made. It's the same thing every time folks try to number things in
DT.

Rob