* [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property @ 2014-01-31 21:46 Andrew Chew 2014-02-03 17:10 ` Mark Rutland 0 siblings, 1 reply; 7+ messages in thread From: Andrew Chew @ 2014-01-31 21:46 UTC (permalink / raw) To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, rob, swarren, thierry.reding, abrestic, dgreid, katierh Cc: devicetree, linux-doc, linux-tegra, linux-kernel, Andrew Chew This optional property can be used to specify which timers are to be used for hardware watchdog timeouts (via a tegra wdt driver). Signed-off-by: Andrew Chew <achew@nvidia.com> --- Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt index b5082a1..e87fa70 100644 --- a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt @@ -13,6 +13,13 @@ Required properties: - clocks : Must contain one entry, for the module clock. See ../clocks/clock-bindings.txt for details. +Optional properties: + +- nvidia,wdt-timer-id: A list of timer IDs to be used for watchdogs. + Watchdog 0 will be assigned to the first timer listed, watchdog 1 will + be assigned to the second timer listed, etc. up to the number of watchdogs + available. + timer { compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer"; reg = <0x60005000 0x400>; @@ -23,4 +30,5 @@ timer { 0 121 0x04 0 122 0x04>; clocks = <&tegra_car 214>; + nvidia,wdt-timer-id = <7 8>; }; -- 1.8.1.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property 2014-01-31 21:46 [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property Andrew Chew @ 2014-02-03 17:10 ` Mark Rutland 2014-02-03 18:59 ` Andrew Chew 0 siblings, 1 reply; 7+ messages in thread From: Mark Rutland @ 2014-02-03 17:10 UTC (permalink / raw) To: Andrew Chew Cc: robh+dt@kernel.org, Pawel Moll, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rob@landley.net, swarren@wwwdotorg.org, thierry.reding@gmail.com, abrestic@chromium.org, dgreid@chromium.org, katierh@chromium.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: > This optional property can be used to specify which timers are to be used > for hardware watchdog timeouts (via a tegra wdt driver). Is there any reason that a particular timer should be used? This shouldn't even mention the driver, as the binding should describe the HW, not how it's used by Linux at the moment. > > Signed-off-by: Andrew Chew <achew@nvidia.com> > --- > Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > index b5082a1..e87fa70 100644 > --- a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > @@ -13,6 +13,13 @@ Required properties: > - clocks : Must contain one entry, for the module clock. > See ../clocks/clock-bindings.txt for details. > > +Optional properties: > + > +- nvidia,wdt-timer-id: A list of timer IDs to be used for watchdogs. > + Watchdog 0 will be assigned to the first timer listed, watchdog 1 will > + be assigned to the second timer listed, etc. up to the number of watchdogs > + available. This sounds like a description of what software should do. Is there any reason this order is important? Also, it feels odd for the proerty name to be singular given it's a list... Thanks, Mark. ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property 2014-02-03 17:10 ` Mark Rutland @ 2014-02-03 18:59 ` Andrew Chew [not found] ` <643E69AA4436674C8F39DCC2C05F763863199852CA-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Andrew Chew @ 2014-02-03 18:59 UTC (permalink / raw) To: Mark Rutland Cc: robh+dt@kernel.org, Pawel Moll, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rob@landley.net, swarren@wwwdotorg.org, thierry.reding@gmail.com, abrestic@chromium.org, dgreid@chromium.org, katierh@chromium.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org > On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: > > This optional property can be used to specify which timers are to be > > used for hardware watchdog timeouts (via a tegra wdt driver). > > Is there any reason that a particular timer should be used? I worry about colliding with other timer allocations, and wanted to be flexible in this regard. > This shouldn't even mention the driver, as the binding should describe the > HW, not how it's used by Linux at the moment. > > > > > Signed-off-by: Andrew Chew <achew@nvidia.com> > > --- > > Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt | 8 > > ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git > > a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > > b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > > index b5082a1..e87fa70 100644 > > --- a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > > +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt > > @@ -13,6 +13,13 @@ Required properties: > > - clocks : Must contain one entry, for the module clock. > > See ../clocks/clock-bindings.txt for details. > > > > +Optional properties: > > + > > +- nvidia,wdt-timer-id: A list of timer IDs to be used for watchdogs. > > + Watchdog 0 will be assigned to the first timer listed, watchdog 1 will > > + be assigned to the second timer listed, etc. up to the number of > watchdogs > > + available. > > This sounds like a description of what software should do. Is there any > reason this order is important? The order in regards to which watchdog (watchdog 0, watchdog 1, etc) is paired with which timer is unimportant for purposes of the watchdog driver that I will follow up with. I can leave those details out of the bindings description if that resolves your concern. > Also, it feels odd for the proerty name to be singular given it's a list... You're right. Given what it is, it really should be nvidia,wdt-timer-ids. ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <643E69AA4436674C8F39DCC2C05F763863199852CA-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>]
* Re: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property [not found] ` <643E69AA4436674C8F39DCC2C05F763863199852CA-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org> @ 2014-02-03 21:09 ` Stephen Warren [not found] ` <52F005A0.4080807-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Stephen Warren @ 2014-02-03 21:09 UTC (permalink / raw) To: Andrew Chew, Mark Rutland Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dgreid-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, katierh-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 02/03/2014 11:59 AM, Andrew Chew wrote: >> On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: >>> This optional property can be used to specify which timers are to be >>> used for hardware watchdog timeouts (via a tegra wdt driver). >> >> Is there any reason that a particular timer should be used? > > I worry about colliding with other timer allocations, and wanted to be > flexible in this regard. Are the other timer allocations represented in DT, or simply made by or hard-coded in the driver? If the former, this property seems like a good equivalent of any existing allocations. If the latter, can't the driver just allocate or hard-code the allocation in the same way as any existing allocations? ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <52F005A0.4080807-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* RE: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property [not found] ` <52F005A0.4080807-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2014-02-03 21:16 ` Andrew Chew [not found] ` <643E69AA4436674C8F39DCC2C05F7638631998538B-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Andrew Chew @ 2014-02-03 21:16 UTC (permalink / raw) To: Stephen Warren, Mark Rutland Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dgreid-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, katierh-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > On 02/03/2014 11:59 AM, Andrew Chew wrote: > >> On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: > >>> This optional property can be used to specify which timers are to be > >>> used for hardware watchdog timeouts (via a tegra wdt driver). > >> > >> Is there any reason that a particular timer should be used? > > > > I worry about colliding with other timer allocations, and wanted to be > > flexible in this regard. > > Are the other timer allocations represented in DT, or simply made by or hard- > coded in the driver? If the former, this property seems like a good equivalent > of any existing allocations. If the latter, can't the driver just allocate or hard- > code the allocation in the same way as any existing allocations? From what I've seen, timer allocations are just hard-coded into whatever driver. I didn't think this was a particularly good idea, since when writing other drivers that for some reason need a timer, the author has to be aware of allocations made in other, barely related drivers. In addition, what seems like an arbitrary allocation in one scenario, I anticipate may not be completely arbitrary in a different scenario, so I thought it would be better to freeze the device driver code, and allow for flexibility at the device tree level. But I'll do whatever others think is right. I can make my watchdog driver just take an arbitrary (to me right now) timer and instantiate one watchdog for it. If I'm to do that, then this device node property isn't necessary, and we can drop this patch. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <643E69AA4436674C8F39DCC2C05F7638631998538B-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>]
* Re: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property [not found] ` <643E69AA4436674C8F39DCC2C05F7638631998538B-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org> @ 2014-02-03 21:26 ` Stephen Warren [not found] ` <52F00994.7080701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Stephen Warren @ 2014-02-03 21:26 UTC (permalink / raw) To: Andrew Chew, Mark Rutland Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dgreid-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, katierh-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 02/03/2014 02:16 PM, Andrew Chew wrote: >> On 02/03/2014 11:59 AM, Andrew Chew wrote: >>>> On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: >>>>> This optional property can be used to specify which timers are to be >>>>> used for hardware watchdog timeouts (via a tegra wdt driver). >>>> >>>> Is there any reason that a particular timer should be used? >>> >>> I worry about colliding with other timer allocations, and wanted to be >>> flexible in this regard. >> >> Are the other timer allocations represented in DT, or simply made by or hard- >> coded in the driver? If the former, this property seems like a good equivalent >> of any existing allocations. If the latter, can't the driver just allocate or hard- >> code the allocation in the same way as any existing allocations? > > From what I've seen, timer allocations are just hard-coded into whatever driver. > I didn't think this was a particularly good idea, since when writing other drivers > that for some reason need a timer, the author has to be aware of allocations > made in other, barely related drivers. I'm not sure that they would; why wouldn't the timer driver register the various timers with standard Linux APIs which the clients talk to, thus avoiding the clients having any knowledge at all of which channels are used for what. If you're talking about the watchdog driver, then can't we just create a shared header file that the clocksource and watchdog drivers both include, which defines the timer ID allocations? ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <52F00994.7080701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* RE: [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property [not found] ` <52F00994.7080701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2014-02-03 21:29 ` Andrew Chew 0 siblings, 0 replies; 7+ messages in thread From: Andrew Chew @ 2014-02-03 21:29 UTC (permalink / raw) To: Stephen Warren, Mark Rutland Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dgreid-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, katierh-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > On 02/03/2014 02:16 PM, Andrew Chew wrote: > >> On 02/03/2014 11:59 AM, Andrew Chew wrote: > >>>> On Fri, Jan 31, 2014 at 09:46:51PM +0000, Andrew Chew wrote: > >>>>> This optional property can be used to specify which timers are to > >>>>> be used for hardware watchdog timeouts (via a tegra wdt driver). > >>>> > >>>> Is there any reason that a particular timer should be used? > >>> > >>> I worry about colliding with other timer allocations, and wanted to > >>> be flexible in this regard. > >> > >> Are the other timer allocations represented in DT, or simply made by > >> or hard- coded in the driver? If the former, this property seems like > >> a good equivalent of any existing allocations. If the latter, can't > >> the driver just allocate or hard- code the allocation in the same way as any > existing allocations? > > > > From what I've seen, timer allocations are just hard-coded into whatever > driver. > > I didn't think this was a particularly good idea, since when writing > > other drivers that for some reason need a timer, the author has to be > > aware of allocations made in other, barely related drivers. > > I'm not sure that they would; why wouldn't the timer driver register the > various timers with standard Linux APIs which the clients talk to, thus > avoiding the clients having any knowledge at all of which channels are used > for what. > > If you're talking about the watchdog driver, then can't we just create a > shared header file that the clocksource and watchdog drivers both include, > which defines the timer ID allocations? Sure, let's go with that. In that case, this patch isn't needed, and should be dropped. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-02-03 21:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31 21:46 [PATCH v1] ARM: tegra: add nvidia,wdt-timer-id optional property Andrew Chew
2014-02-03 17:10 ` Mark Rutland
2014-02-03 18:59 ` Andrew Chew
[not found] ` <643E69AA4436674C8F39DCC2C05F763863199852CA-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2014-02-03 21:09 ` Stephen Warren
[not found] ` <52F005A0.4080807-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-02-03 21:16 ` Andrew Chew
[not found] ` <643E69AA4436674C8F39DCC2C05F7638631998538B-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2014-02-03 21:26 ` Stephen Warren
[not found] ` <52F00994.7080701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-02-03 21:29 ` Andrew Chew
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox