linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties
@ 2019-07-09  8:00 Anson.Huang
  2019-07-09  8:00 ` [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT Anson.Huang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Anson.Huang @ 2019-07-09  8:00 UTC (permalink / raw)
  To: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: Linux-imx

From: Anson Huang <Anson.Huang@nxp.com>

Update opp-suspend property's description to support multiple
opp-suspend properties defined in DT, the OPP with highest opp-hz
and with opp-suspend property present will be used as suspend opp.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
New patch.
---
 Documentation/devicetree/bindings/opp/opp.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt
index 76b6c79..6859227 100644
--- a/Documentation/devicetree/bindings/opp/opp.txt
+++ b/Documentation/devicetree/bindings/opp/opp.txt
@@ -140,8 +140,8 @@ Optional properties:
   frequency for a short duration of time limited by the device's power, current
   and thermal limits.
 
-- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in
-  the table should have this.
+- opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs
+  in the table have this, the OPP with highest opp-hz will be used.
 
 - opp-supported-hw: This enables us to select only a subset of OPPs from the
   larger OPP table, based on what version of the hardware we are running on. We
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
@ 2019-07-09  8:00 ` Anson.Huang
  2019-07-25  2:26   ` Viresh Kumar
  2019-07-09  8:00 ` [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table Anson.Huang
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Anson.Huang @ 2019-07-09  8:00 UTC (permalink / raw)
  To: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: Linux-imx

From: Anson Huang <Anson.Huang@nxp.com>

With property "opp-supported-hw" introduced, the OPP table
in DT could be a large OPP table and ONLY a subset of OPPs
are available, based on the version of the hardware running
on. That introduces restriction of using "opp-suspend"
property to define the suspend OPP, as we are NOT sure if the
OPP containing "opp-suspend" property is available for the
hardware running on, and the of opp core does NOT allow multiple
suspend OPPs defined in DT OPP table.

To eliminate this restrition, make of opp core allow multiple
suspend OPPs defined in DT, and pick the OPP with highest rate
and with "opp-suspend" property present to be suspend OPP, it
can speed up the suspend/resume process.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No changes.
---
 drivers/opp/of.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index b313aca..7e8ec6c 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -617,9 +617,12 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
 	/* OPP to select on device suspend */
 	if (of_property_read_bool(np, "opp-suspend")) {
 		if (opp_table->suspend_opp) {
-			dev_warn(dev, "%s: Multiple suspend OPPs found (%lu %lu)\n",
-				 __func__, opp_table->suspend_opp->rate,
-				 new_opp->rate);
+			/* Pick the OPP with higher rate as suspend OPP */
+			if (new_opp->rate > opp_table->suspend_opp->rate) {
+				opp_table->suspend_opp->suspend = false;
+				new_opp->suspend = true;
+				opp_table->suspend_opp = new_opp;
+			}
 		} else {
 			new_opp->suspend = true;
 			opp_table->suspend_opp = new_opp;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
  2019-07-09  8:00 ` [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT Anson.Huang
@ 2019-07-09  8:00 ` Anson.Huang
  2019-08-03  8:12   ` Shawn Guo
  2019-07-09  8:00 ` [PATCH V2 4/4] arm64: dts: imx8mm: " Anson.Huang
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Anson.Huang @ 2019-07-09  8:00 UTC (permalink / raw)
  To: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: Linux-imx

From: Anson Huang <Anson.Huang@nxp.com>

Add opp-suspend property to each OPP, the of opp core will
select the OPP HW supported and with highest rate to be
suspend opp, it will speed up the suspend/resume process.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No changes.
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 58f66cb..4ba6a25f 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -156,6 +156,7 @@
 			/* Industrial only */
 			opp-supported-hw = <0xf>, <0x4>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 
 		opp-1000000000 {
@@ -164,6 +165,7 @@
 			/* Consumer only */
 			opp-supported-hw = <0xe>, <0x3>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 
 		opp-1300000000 {
@@ -171,6 +173,7 @@
 			opp-microvolt = <1000000>;
 			opp-supported-hw = <0xc>, <0x4>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 
 		opp-1500000000 {
@@ -178,6 +181,7 @@
 			opp-microvolt = <1000000>;
 			opp-supported-hw = <0x8>, <0x3>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 	};
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V2 4/4] arm64: dts: imx8mm: Add opp-suspend property to OPP table
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
  2019-07-09  8:00 ` [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT Anson.Huang
  2019-07-09  8:00 ` [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table Anson.Huang
@ 2019-07-09  8:00 ` Anson.Huang
  2019-08-03  8:12   ` Shawn Guo
  2019-07-09  8:14 ` [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Viresh Kumar
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Anson.Huang @ 2019-07-09  8:00 UTC (permalink / raw)
  To: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: Linux-imx

From: Anson Huang <Anson.Huang@nxp.com>

Add opp-suspend property to each OPP, the of opp core will
select the OPP HW supported and with highest rate to be
suspend opp, it will speed up the suspend/resume process.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No changes.
---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index 398318b..973f457 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -108,6 +108,7 @@
 			opp-microvolt = <850000>;
 			opp-supported-hw = <0xe>, <0x7>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 
 		opp-1600000000 {
@@ -115,6 +116,7 @@
 			opp-microvolt = <900000>;
 			opp-supported-hw = <0xc>, <0x7>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 
 		opp-1800000000 {
@@ -122,6 +124,7 @@
 			opp-microvolt = <1000000>;
 			opp-supported-hw = <0x8>, <0x3>;
 			clock-latency-ns = <150000>;
+			opp-suspend;
 		};
 	};
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
                   ` (2 preceding siblings ...)
  2019-07-09  8:00 ` [PATCH V2 4/4] arm64: dts: imx8mm: " Anson.Huang
@ 2019-07-09  8:14 ` Viresh Kumar
  2019-07-24 20:18 ` Rob Herring
  2019-07-25  2:26 ` Viresh Kumar
  5 siblings, 0 replies; 11+ messages in thread
From: Viresh Kumar @ 2019-07-09  8:14 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel, Linux-imx

On 09-07-19, 16:00, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Update opp-suspend property's description to support multiple
> opp-suspend properties defined in DT, the OPP with highest opp-hz
> and with opp-suspend property present will be used as suspend opp.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> New patch.
> ---
>  Documentation/devicetree/bindings/opp/opp.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt
> index 76b6c79..6859227 100644
> --- a/Documentation/devicetree/bindings/opp/opp.txt
> +++ b/Documentation/devicetree/bindings/opp/opp.txt
> @@ -140,8 +140,8 @@ Optional properties:
>    frequency for a short duration of time limited by the device's power, current
>    and thermal limits.
>  
> -- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in
> -  the table should have this.
> +- opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs
> +  in the table have this, the OPP with highest opp-hz will be used.
>  
>  - opp-supported-hw: This enables us to select only a subset of OPPs from the
>    larger OPP table, based on what version of the hardware we are running on. We

LGTM. Once Rob Acks it, I will apply the first two patches to the OPP
tree.

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
                   ` (3 preceding siblings ...)
  2019-07-09  8:14 ` [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Viresh Kumar
@ 2019-07-24 20:18 ` Rob Herring
  2019-07-25  2:26 ` Viresh Kumar
  5 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2019-07-24 20:18 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel, Linux-imx

On Tue,  9 Jul 2019 16:00:12 +0800, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Update opp-suspend property's description to support multiple
> opp-suspend properties defined in DT, the OPP with highest opp-hz
> and with opp-suspend property present will be used as suspend opp.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> New patch.
> ---
>  Documentation/devicetree/bindings/opp/opp.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties
  2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
                   ` (4 preceding siblings ...)
  2019-07-24 20:18 ` Rob Herring
@ 2019-07-25  2:26 ` Viresh Kumar
  2019-07-25  5:01   ` Anson Huang
  5 siblings, 1 reply; 11+ messages in thread
From: Viresh Kumar @ 2019-07-25  2:26 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel, Linux-imx

On 09-07-19, 16:00, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Update opp-suspend property's description to support multiple
> opp-suspend properties defined in DT, the OPP with highest opp-hz
> and with opp-suspend property present will be used as suspend opp.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> New patch.
> ---
>  Documentation/devicetree/bindings/opp/opp.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT
  2019-07-09  8:00 ` [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT Anson.Huang
@ 2019-07-25  2:26   ` Viresh Kumar
  0 siblings, 0 replies; 11+ messages in thread
From: Viresh Kumar @ 2019-07-25  2:26 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, leonard.crestez, p.zabel, ping.bai,
	daniel.baluta, l.stach, abel.vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel, Linux-imx

On 09-07-19, 16:00, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> With property "opp-supported-hw" introduced, the OPP table
> in DT could be a large OPP table and ONLY a subset of OPPs
> are available, based on the version of the hardware running
> on. That introduces restriction of using "opp-suspend"
> property to define the suspend OPP, as we are NOT sure if the
> OPP containing "opp-suspend" property is available for the
> hardware running on, and the of opp core does NOT allow multiple
> suspend OPPs defined in DT OPP table.
> 
> To eliminate this restrition, make of opp core allow multiple
> suspend OPPs defined in DT, and pick the OPP with highest rate
> and with "opp-suspend" property present to be suspend OPP, it
> can speed up the suspend/resume process.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> No changes.
> ---
>  drivers/opp/of.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Applied. Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties
  2019-07-25  2:26 ` Viresh Kumar
@ 2019-07-25  5:01   ` Anson Huang
  0 siblings, 0 replies; 11+ messages in thread
From: Anson Huang @ 2019-07-25  5:01 UTC (permalink / raw)
  To: Viresh Kumar, Shawn Guo
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, shawnguo, s.hauer,
	kernel, festevam, Leonard Crestez, p.zabel, Jacky Bai,
	Daniel Baluta, l.stach, Abel Vesa, angus, andrew.smirnov,
	ccaione, agx, linux-pm, devicetree, linux-kernel,
	linux-arm-kernel, dl-linux-imx

Hi, Shawn

> On 09-07-19, 16:00, Anson.Huang@nxp.com wrote:
> > From: Anson Huang <Anson.Huang@nxp.com>
> >
> > Update opp-suspend property's description to support multiple
> > opp-suspend properties defined in DT, the OPP with highest opp-hz and
> > with opp-suspend property present will be used as suspend opp.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > New patch.
> > ---
> >  Documentation/devicetree/bindings/opp/opp.txt | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Applied. Thanks.

Would you pick up the DT patches in this series? Thanks.

Anson

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table
  2019-07-09  8:00 ` [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table Anson.Huang
@ 2019-08-03  8:12   ` Shawn Guo
  0 siblings, 0 replies; 11+ messages in thread
From: Shawn Guo @ 2019-08-03  8:12 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, s.hauer, kernel,
	festevam, leonard.crestez, p.zabel, ping.bai, daniel.baluta,
	l.stach, abel.vesa, angus, andrew.smirnov, ccaione, agx,
	linux-pm, devicetree, linux-kernel, linux-arm-kernel, Linux-imx

On Tue, Jul 09, 2019 at 04:00:14PM +0800, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Add opp-suspend property to each OPP, the of opp core will
> select the OPP HW supported and with highest rate to be
> suspend opp, it will speed up the suspend/resume process.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V2 4/4] arm64: dts: imx8mm: Add opp-suspend property to OPP table
  2019-07-09  8:00 ` [PATCH V2 4/4] arm64: dts: imx8mm: " Anson.Huang
@ 2019-08-03  8:12   ` Shawn Guo
  0 siblings, 0 replies; 11+ messages in thread
From: Shawn Guo @ 2019-08-03  8:12 UTC (permalink / raw)
  To: Anson.Huang
  Cc: vireshk, nm, sboyd, robh+dt, mark.rutland, s.hauer, kernel,
	festevam, leonard.crestez, p.zabel, ping.bai, daniel.baluta,
	l.stach, abel.vesa, angus, andrew.smirnov, ccaione, agx,
	linux-pm, devicetree, linux-kernel, linux-arm-kernel, Linux-imx

On Tue, Jul 09, 2019 at 04:00:15PM +0800, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Add opp-suspend property to each OPP, the of opp core will
> select the OPP HW supported and with highest rate to be
> suspend opp, it will speed up the suspend/resume process.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-03  8:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09  8:00 [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Anson.Huang
2019-07-09  8:00 ` [PATCH V2 2/4] opp: of: Support multiple suspend OPPs defined in DT Anson.Huang
2019-07-25  2:26   ` Viresh Kumar
2019-07-09  8:00 ` [PATCH V2 3/4] arm64: dts: imx8mq: Add opp-suspend property to OPP table Anson.Huang
2019-08-03  8:12   ` Shawn Guo
2019-07-09  8:00 ` [PATCH V2 4/4] arm64: dts: imx8mm: " Anson.Huang
2019-08-03  8:12   ` Shawn Guo
2019-07-09  8:14 ` [PATCH V2 1/4] dt-bindings: opp: Support multiple opp-suspend properties Viresh Kumar
2019-07-24 20:18 ` Rob Herring
2019-07-25  2:26 ` Viresh Kumar
2019-07-25  5:01   ` Anson Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).