Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1465006 > unrolled thread

[PATCH v2 0/4] PM / AVS: add Rockchip cpu avs

Started byFinlye Xiao <finley.xiao@rock-chips.com>
First post2016-08-18 11:00 +0200
Last post2016-08-19 05:20 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/4] PM / AVS: add Rockchip cpu avs Finlye Xiao <finley.xiao@rock-chips.com> - 2016-08-18 11:00 +0200
    [PATCH v2 2/4] of: introduce of_property_read_s32_index Finlye Xiao <finley.xiao@rock-chips.com> - 2016-08-18 11:10 +0200
    [PATCH v2 3/4] dt-bindings: add binding document for Rockchip cpu avs Finlye Xiao <finley.xiao@rock-chips.com> - 2016-08-18 11:10 +0200
    [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys Finlye Xiao <finley.xiao@rock-chips.com> - 2016-08-18 11:10 +0200
      Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys Heiko Stuebner <heiko@sntech.de> - 2016-08-19 03:00 +0200
        Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys Kevin Hilman <khilman@baylibre.com> - 2016-08-19 18:20 +0200
      Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys Kevin Hilman <khilman@baylibre.com> - 2016-08-19 05:20 +0200

#1465006 — [PATCH v2 0/4] PM / AVS: add Rockchip cpu avs

FromFinlye Xiao <finley.xiao@rock-chips.com>
Date2016-08-18 11:00 +0200
Subject[PATCH v2 0/4] PM / AVS: add Rockchip cpu avs
Message-ID<s7rl7-5No-5@gated-at.bofh.it>
From: Finley Xiao <finley.xiao@rock-chips.com>

Under the same frequency, the operating voltage tends to decrease with
increasing leakage. so it is necessary to adjust opp's voltage according
to leakage for power.

V1->V2:
- 2/3 just add a static inline functiong in the of.h.
- 3/3 is separated into two patches.

Finley Xiao (4):
  nvmem: rockchip-efuse: Change initcall to subsys
  of: introduce of_property_read_s32_index
  dt-bindings: add binding document for Rockchip cpu avs
  PM / AVS: rockchip-cpu-avs: add driver handling Rockchip cpu avs

 .../devicetree/bindings/power/rockchip-cpu-avs.txt |  37 +++
 drivers/nvmem/rockchip-efuse.c                     |   9 +-
 drivers/power/avs/Kconfig                          |   9 +
 drivers/power/avs/Makefile                         |   1 +
 drivers/power/avs/rockchip-cpu-avs.c               | 331 +++++++++++++++++++++
 include/linux/of.h                                 |   8 +
 6 files changed, 394 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt
 create mode 100644 drivers/power/avs/rockchip-cpu-avs.c

-- 
1.9.1

[toc] | [next] | [standalone]


#1465012 — [PATCH v2 2/4] of: introduce of_property_read_s32_index

FromFinlye Xiao <finley.xiao@rock-chips.com>
Date2016-08-18 11:10 +0200
Subject[PATCH v2 2/4] of: introduce of_property_read_s32_index
Message-ID<s7ruN-66w-1@gated-at.bofh.it>
In reply to#1465006
From: Finley Xiao <finley.xiao@rock-chips.com>

Introduce single indexed signed 32bit integer of_property_read method.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
---
 include/linux/of.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/of.h b/include/linux/of.h
index 3d9ff8e..8ef775e 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -929,6 +929,14 @@ static inline int of_property_read_s32(const struct device_node *np,
 	return of_property_read_u32(np, propname, (u32*) out_value);
 }
 
+static inline int of_property_read_s32_index(const struct device_node *np,
+					     const char *propname, u32 index,
+					     s32 *out_value)
+{
+	return of_property_read_u32_index(np, propname, index,
+		(u32 *)out_value);
+}
+
 #define of_for_each_phandle(it, err, np, ln, cn, cc)			\
 	for (of_phandle_iterator_init((it), (np), (ln), (cn), (cc)),	\
 	     err = of_phandle_iterator_next(it);			\
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1465013 — [PATCH v2 3/4] dt-bindings: add binding document for Rockchip cpu avs

FromFinlye Xiao <finley.xiao@rock-chips.com>
Date2016-08-18 11:10 +0200
Subject[PATCH v2 3/4] dt-bindings: add binding document for Rockchip cpu avs
Message-ID<s7ruN-66w-5@gated-at.bofh.it>
In reply to#1465006
From: Finley Xiao <finley.xiao@rock-chips.com>

This patch documents the Rockchip cpu avs device tree binding.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
---
 .../devicetree/bindings/power/rockchip-cpu-avs.txt | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt

diff --git a/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt b/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt
new file mode 100644
index 0000000..705f516
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/rockchip-cpu-avs.txt
@@ -0,0 +1,37 @@
+Rockchip cpu avs device tree bindings
+-------------------------------------
+
+Under the same frequency, the operating voltage tends to decrease with
+increasing leakage. so it is necessary to adjust opp's voltage according
+to leakage for power.
+
+
+Required properties:
+- compatible: Should be one of the following.
+  - "rockchip,rk3399-cpu-avs" - for RK3399 SoCs.
+- leakage-volt-<name>: Named leakage-volt property. At runtime, the
+  platform can find a cpu's cluster_id according to it's cpu_id and match
+  leakage-volt-<name> property. The property is an array of 3-tuples
+  items, and each item consists of leakage and voltage like
+  <min-leakage-mA max-leakage-mA volt-uV>.
+	min-leakage: minimum leakage in mA, ranges from 0 to 254.
+	max-leakage: maximum leakage in mA, ranges from 0 to 254.
+	volt: voltage offset in mV to apply to the opp table entries.
+
+Example:
+
+	cpu_avs: cpu-avs {
+		compatible = "rockchip,rk3399-cpu-avs";
+		leakage-volt-cluster0 = <
+		/*  mA        mA         uV*/
+		    0         100        0
+		    101       200        (-25000)
+		    201       254        (-50000)
+		>;
+		leakage-volt-cluster1 = <
+		/*  mA        mA         uV*/
+		    0         100        0
+		    101       200        (-25000)
+		    201       254        (-50000)
+		>;
+	};
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1465014 — [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys

FromFinlye Xiao <finley.xiao@rock-chips.com>
Date2016-08-18 11:10 +0200
Subject[PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys
Message-ID<s7ruN-66w-7@gated-at.bofh.it>
In reply to#1465006
From: Finley Xiao <finley.xiao@rock-chips.com>

We will register a cpufreq notifier for adjusting opp's voltage, and it
need to fetch cpu's leakage from efuse in the notifier_call. so the efuse
driver should probe before cpufreq driver.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
---
 drivers/nvmem/rockchip-efuse.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c
index 4d3f391..378993d 100644
--- a/drivers/nvmem/rockchip-efuse.c
+++ b/drivers/nvmem/rockchip-efuse.c
@@ -144,6 +144,13 @@ static struct platform_driver rockchip_efuse_driver = {
 	},
 };
 
-module_platform_driver(rockchip_efuse_driver);
+static int __init rockchip_efuse_module_init(void)
+{
+	return platform_driver_probe(&rockchip_efuse_driver,
+				     rockchip_efuse_probe);
+}
+
+subsys_initcall(rockchip_efuse_module_init);
+
 MODULE_DESCRIPTION("rockchip_efuse driver");
 MODULE_LICENSE("GPL v2");
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1465677 — Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys

FromHeiko Stuebner <heiko@sntech.de>
Date2016-08-19 03:00 +0200
SubjectRe: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys
Message-ID<s7Gka-6XF-17@gated-at.bofh.it>
In reply to#1465014
Am Donnerstag, 18. August 2016, 13:28:58 CEST schrieb Kevin Hilman:
> Finlye Xiao <finley.xiao@rock-chips.com> writes:
> > From: Finley Xiao <finley.xiao@rock-chips.com>
> > 
> > We will register a cpufreq notifier for adjusting opp's voltage, and it
> > need to fetch cpu's leakage from efuse in the notifier_call. so the efuse
> > driver should probe before cpufreq driver.
> > 
> > Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
> 
> Why can't this be handled with deferred probling?  initcall ordering is
> a can of worms.

I think the issue is less between efuse and avs driver, but more between avs 
driver and cpufreq. The avs driver aims to modify the opp table and thus wants 
to do that / register the notifier before cpufreq starts.

And as there is no direct connection between cpufreq and the avs driver, 
making cpufreq defer probing is probably not really easy.

[toc] | [prev] | [next] | [standalone]


#1466542 — Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys

FromKevin Hilman <khilman@baylibre.com>
Date2016-08-19 18:20 +0200
SubjectRe: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys
Message-ID<s7UGt-7QJ-21@gated-at.bofh.it>
In reply to#1465677
Heiko Stuebner <heiko@sntech.de> writes:

> Am Donnerstag, 18. August 2016, 13:28:58 CEST schrieb Kevin Hilman:
>> Finlye Xiao <finley.xiao@rock-chips.com> writes:
>> > From: Finley Xiao <finley.xiao@rock-chips.com>
>> > 
>> > We will register a cpufreq notifier for adjusting opp's voltage, and it
>> > need to fetch cpu's leakage from efuse in the notifier_call. so the efuse
>> > driver should probe before cpufreq driver.
>> > 
>> > Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
>> 
>> Why can't this be handled with deferred probling?  initcall ordering is
>> a can of worms.
>
> I think the issue is less between efuse and avs driver, but more between avs 
> driver and cpufreq. The avs driver aims to modify the opp table and thus wants 
> to do that / register the notifier before cpufreq starts.
>
> And as there is no direct connection between cpufreq and the avs driver, 
> making cpufreq defer probing is probably not really easy.

Thanks for the explanation.

Sounds like something that belongs in the changelog.

Kevin

[toc] | [prev] | [next] | [standalone]


#1465952 — Re: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys

FromKevin Hilman <khilman@baylibre.com>
Date2016-08-19 05:20 +0200
SubjectRe: [PATCH v2 1/4] nvmem: rockchip-efuse: Change initcall to subsys
Message-ID<s7Gka-6XF-19@gated-at.bofh.it>
In reply to#1465014
Finlye Xiao <finley.xiao@rock-chips.com> writes:

> From: Finley Xiao <finley.xiao@rock-chips.com>
>
> We will register a cpufreq notifier for adjusting opp's voltage, and it
> need to fetch cpu's leakage from efuse in the notifier_call. so the efuse
> driver should probe before cpufreq driver.
>
> Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>

Why can't this be handled with deferred probling?  initcall ordering is
a can of worms.

Kevin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web