On 10/7/20 3:18 AM, Uwe Kleine-König wrote: > Hello, > > [promoted Rob from Cc: to To: and adapted the subject in the hope to get > some feedback] > > On Wed, Oct 07, 2020 at 09:25:30AM +0200, Ahmad Fatoum wrote: >> On 10/7/20 9:12 AM, Uwe Kleine-König wrote: >>> On Tue, Oct 06, 2020 at 02:04:10PM -0700, Guenter Roeck wrote: >>>> With that in mind, your other option kind of makes sense. The only >>>> question would be how to express this in devicetree. I am certainly >>>> open to accepting a patch introducing such a property/functionality >>>> into the watchdog core. >>> >>> OK, will try to come up with a patch. >> >> Instead of having a `provide-system-reset' property, how about providing >> it unconditionally, but with a very low priority? >> Personally I don't think that would be a good idea, first in general but also because the generic restart handling mechanism is still not universally used (the last five or so patches needed to make it complete have been blocked by various people each time they were submitted, so we can be sure that they will never be accepted). Also, you would have to have a means to disable it, which would be equivalent to having a means to enable it, so making it enabled by default seems pointless and would unnecessarily introduce potential problems. >> This can be coupled with Guenther's suggestion of having a dynamic >> way to set the priority, e.g. a `watchdog-priority' property in the device >> tree that's common to all watchdogs? That's the way barebox is handling >> multiple watchdogs (default value in driver overridable in DT and at runtime). > > OK, I'll try to put this in more verbose words: > > Let's introduce a generic watchdog property `watchdog-priority' that > provides a u32 to order the watchdogs for systems having two or more. > The value 0 means the watchdog is unusable/broken/disabled and the > watchdog with the biggest value is the one supposed to be used by > default. > How do you suggest to implement that ? Device naming is determined by registration order. The watchdog subsystem doesn't decide which of the watchdogs is being used; userspace does that by opening the watchdog device. Userspace can already decide which watchdog to use by checking its sysfs attributes. If we were to create a sysfs attribute for userspace to read and compare, userspace could as well use the existing 'identity' attribute to make that decision. > Analogous a property `watchdog-restart-priority` is used to define if a > watchdog is supposed to be used to restart the machine. Again a value of > 0 means "Don't use" and otherwise the highest-value watchdog is used to > reset the machine. > That makes more sense to me. Guenter > Maybe `restart-priority` is a better name that can also be used by > PMICs?! > >> What's the DT folks opinion on that? > > Best regards > Uwe >