Re: [PATCH 3/4] watchdog: s3c2410_wdt: parse watchdog dt node to read PMU registers adresses

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

 




Tomasz,

On Sat, Sep 28, 2013 at 6:49 PM, Tomasz Figa <tomasz.figa@xxxxxxxxx> wrote:
>> On Fri, Sep 27, 2013 at 11:14 AM, Tomasz Figa <tomasz.figa@xxxxxxxxx>
> wrote:
>> >> So isn't the register in the PMU there to save power in the case that
>> >> the watchdog timer isn't being used?  How is the PMU "driver" to know
>> >> whether the watchdog is being used?  Better IMHO that the watchdog
>> >> driver knows to enable and disable itself as needed, right?
>> >
>> > How much power can you save on one low frequency counter? Anyway,
>> > those
>> > bits look more like reset signal masks to me, unrelated to any power
>> > saving and even if, this driver switches them on at probe regardless
>> > of
>> > whether the watchdog is actually used or not.
>>
>> I don't know for sure how much power it saves if any.  The description
>> I have of those fields is also definitely a little on the confusing
>> side.  The fact that they are in the PMU leads me to believe that they
>> save power, but perhaps that's not the case here.
>>
>> It still does seem nice to keep watchdog related code in the watchdog
>> driver, though...
>
> For me, this thing looks more related to PMU than watchdog, since the code
> writes to PMU registers and does this only on system power state
> transitions, i.e. once per boot, suspend, resume and shutdown.

I wonder if there is any reason that it shouldn't be put in the
s3c2410wdt_start() and s3c2410wdt_stop() functions?


>> I guess I could also imagine ordering problems if
>> we tweaked this bit in the PMU driver, though I don't have actual
>> evidence of this.  Maybe cases where enabling at the wrong time could
>> cause spurious watchdog resets depending on how the BIOS left the
>> state of things.
>
> Even if you put this code in watchdog driver you don't have any warranties
> that the firmware leaves both the watchdog and PMU bits sets correctly.
> I'm not sure what would be the point of firmware existence if you can't
> trust it to set up at least the basic working environment for you and I
> consider watchdog to be part of such.

I trust it to leave the system in some state that is safe.  ...but I
don't trust the firmware of all exynos-based products to have the same
idea of what "safe" is.  I could imagine some of them disabling the
watchdog before booting linux by tweaking the settings in the PMU (and
leaving the reset of the watchdog configured and running) and some of
them disabling the watchdog by leaving the PMU settings alone and
turning off the enable bit.  I could also imagine some of them
actually leaving the watchdog fully configured and running to try to
catch the case where the kernel crashes at bootup.  I don't know of
any official rules here, which means that the kernel needs to be
flexible enough.


>> It would be unfortunate if we found we needed to
>> reach into the watchdog register bank from the PMU driver to "pet" the
>> watchdog before enabling it.
>
> If you find any such need in future, then with the solution I proposed
> there will be no problem in changing things to be done as you and Leela
> propose. The other way around would not be that simple, because the
> introduced binding would still have to be supported and the code touching
> PMU would have to be kept in watchdog code...
>
> However, if you really insist on handling this in watchdog driver,

I certainly don't insist.  I have not contributed nearly enough to the
community to insist on anything.  At this point I'm merely stating my
opinion.  Feel free to take it into consideration or ignore it.  I
will not be offended if you choose to ignore my opinion here.  It is
really up to Leela Krishna and the maintainer of the subsystem if I
understand correctly.


> please
> consider using something smarter to access the PMU. I believe that device
> node of watchdog should not represent parts of PMU, which should be
> represented as a separate node instead.

We've already had this discussion before.  Assuming I'm understanding
him correctly, Olof weighed in and suggested that he preferred to do
the simpler thing in this case (AKA: what Leela Krishna is doing):

http://www.spinics.net/lists/devicetree/msg00812.html

-Doug
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux