diff mbox series

[V3,1/2] bindings: media: gpio-ir-receiver: add linux,autosuspend-period property

Message ID 20200922190807.6830-2-qiangqing.zhang@nxp.com
State Changes Requested, archived
Headers show
Series Add QoS support for cpuidle system. | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Joakim Zhang Sept. 22, 2020, 7:08 p.m. UTC
Add linux,autosuspend-period property for gpio ir receiver. Some cpuidle
systems wake from idle may take a bit long time, for such case, need
disable cpuidle temporarily.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
ChangeLogs:
V1->V2:
	* New add.
V2->V3:
	* linux,autosuspend-period = 125; -> linux,autosuspend-period = <125>;
---
 Documentation/devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++
 1 file changed, 3 insertions(+)

Comments

Rob Herring Sept. 29, 2020, 3:52 p.m. UTC | #1
On Wed, Sep 23, 2020 at 03:08:06AM +0800, Joakim Zhang wrote:
> Add linux,autosuspend-period property for gpio ir receiver. Some cpuidle
> systems wake from idle may take a bit long time, for such case, need
> disable cpuidle temporarily.
> 
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
> ChangeLogs:
> V1->V2:
> 	* New add.
> V2->V3:
> 	* linux,autosuspend-period = 125; -> linux,autosuspend-period = <125>;
> ---
>  Documentation/devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> index 58261fb7b408..e1447c9b0e26 100644
> --- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> +++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> @@ -7,6 +7,8 @@ Required properties:
>  Optional properties:
>  	- linux,rc-map-name: see rc.txt file in the same
>  	  directory.
> +        - linux,autosuspend-period: autosuspend delay time,
> +          the unit is milisecond.

What makes this linux specific?
Sean Young Oct. 3, 2020, 8:46 a.m. UTC | #2
On Tue, Sep 29, 2020 at 10:52:01AM -0500, Rob Herring wrote:
> On Wed, Sep 23, 2020 at 03:08:06AM +0800, Joakim Zhang wrote:
> > Add linux,autosuspend-period property for gpio ir receiver. Some cpuidle
> > systems wake from idle may take a bit long time, for such case, need
> > disable cpuidle temporarily.
> > 
> > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > ---
> > ChangeLogs:
> > V1->V2:
> > 	* New add.
> > V2->V3:
> > 	* linux,autosuspend-period = 125; -> linux,autosuspend-period = <125>;
> > ---
> >  Documentation/devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > index 58261fb7b408..e1447c9b0e26 100644
> > --- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > +++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > @@ -7,6 +7,8 @@ Required properties:
> >  Optional properties:
> >  	- linux,rc-map-name: see rc.txt file in the same
> >  	  directory.
> > +        - linux,autosuspend-period: autosuspend delay time,
> > +          the unit is milisecond.
> 
> What makes this linux specific?

Good point. "linux,autosuspend-period" does not say what is being
suspended either. How about "cpuidle-suspend-period" instead?


Sean
Rob Herring Oct. 5, 2020, 1:36 p.m. UTC | #3
On Sat, Oct 3, 2020 at 3:46 AM Sean Young <sean@mess.org> wrote:
>
> On Tue, Sep 29, 2020 at 10:52:01AM -0500, Rob Herring wrote:
> > On Wed, Sep 23, 2020 at 03:08:06AM +0800, Joakim Zhang wrote:
> > > Add linux,autosuspend-period property for gpio ir receiver. Some cpuidle
> > > systems wake from idle may take a bit long time, for such case, need
> > > disable cpuidle temporarily.
> > >
> > > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > > ---
> > > ChangeLogs:
> > > V1->V2:
> > >     * New add.
> > > V2->V3:
> > >     * linux,autosuspend-period = 125; -> linux,autosuspend-period = <125>;
> > > ---
> > >  Documentation/devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > index 58261fb7b408..e1447c9b0e26 100644
> > > --- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > +++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > @@ -7,6 +7,8 @@ Required properties:
> > >  Optional properties:
> > >     - linux,rc-map-name: see rc.txt file in the same
> > >       directory.
> > > +        - linux,autosuspend-period: autosuspend delay time,
> > > +          the unit is milisecond.
> >
> > What makes this linux specific?
>
> Good point. "linux,autosuspend-period" does not say what is being
> suspended either. How about "cpuidle-suspend-period" instead?

'cpuidle' is a Linuxism. And you also need a unit suffix.

I'm not clear on how autosuspend which is generally how long a
peripheral is idle before runtime suspending it relates to this which
seems to be concerned with cpu wakeup latency. I'm assuming you need
to wake up within a certain time period to capture GPIO edges. Don't
you know what this time would be based on IR data rates and can
provide that constraint to cpuidle?

Also, we can set autosuspend times from sysfs. Why do you need to do
this from DT?

Rob
Sean Young Oct. 5, 2020, 2:09 p.m. UTC | #4
On Mon, Oct 05, 2020 at 08:36:39AM -0500, Rob Herring wrote:
> On Sat, Oct 3, 2020 at 3:46 AM Sean Young <sean@mess.org> wrote:
> >
> > On Tue, Sep 29, 2020 at 10:52:01AM -0500, Rob Herring wrote:
> > > On Wed, Sep 23, 2020 at 03:08:06AM +0800, Joakim Zhang wrote:
> > > > Add linux,autosuspend-period property for gpio ir receiver. Some cpuidle
> > > > systems wake from idle may take a bit long time, for such case, need
> > > > disable cpuidle temporarily.
> > > >
> > > > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > > > ---
> > > > ChangeLogs:
> > > > V1->V2:
> > > >     * New add.
> > > > V2->V3:
> > > >     * linux,autosuspend-period = 125; -> linux,autosuspend-period = <125>;
> > > > ---
> > > >  Documentation/devicetree/bindings/media/gpio-ir-receiver.txt | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > > index 58261fb7b408..e1447c9b0e26 100644
> > > > --- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > > +++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
> > > > @@ -7,6 +7,8 @@ Required properties:
> > > >  Optional properties:
> > > >     - linux,rc-map-name: see rc.txt file in the same
> > > >       directory.
> > > > +        - linux,autosuspend-period: autosuspend delay time,
> > > > +          the unit is milisecond.
> > >
> > > What makes this linux specific?
> >
> > Good point. "linux,autosuspend-period" does not say what is being
> > suspended either. How about "cpuidle-suspend-period" instead?
> 
> 'cpuidle' is a Linuxism. And you also need a unit suffix.
> 
> I'm not clear on how autosuspend which is generally how long a
> peripheral is idle before runtime suspending it relates to this which
> seems to be concerned with cpu wakeup latency. I'm assuming you need
> to wake up within a certain time period to capture GPIO edges. Don't
> you know what this time would be based on IR data rates and can
> provide that constraint to cpuidle?
> 
> Also, we can set autosuspend times from sysfs. Why do you need to do
> this from DT?

This driver collects the timings of the edges on the gpio line, and sends
them to the IR decoders. Waking up the cpu out of cpuidle causes random
delays and therefore timing are off, on some hardware. This setting turns
off cpuidle for a period to prevent these problems.

Note that on this soc cpuidle is causing huge delays, 500 microseconds or so.


Sean
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
index 58261fb7b408..e1447c9b0e26 100644
--- a/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
+++ b/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
@@ -7,6 +7,8 @@  Required properties:
 Optional properties:
 	- linux,rc-map-name: see rc.txt file in the same
 	  directory.
+        - linux,autosuspend-period: autosuspend delay time,
+          the unit is milisecond.
 
 Example node:
 
@@ -14,4 +16,5 @@  Example node:
 		compatible = "gpio-ir-receiver";
 		gpios = <&gpio0 19 1>;
 		linux,rc-map-name = "rc-rc6-mce";
+		linux,autosuspend-period = <125>;
 	};