From: Krzysztof Kozlowski <hidden> Date: 2021-09-20 07:15:57
Hi,
My previous patch 3/3 (ARM: dts: exynos: align PPMU event node names
with dtschema) caused issues reported by Marek [1].
Tested on Exynos5422. Testing on Exynso5433 board would be very useful.
Changes since v1:
1. New patches 1/3 and 2/3.
2. Patch 3/3: rename event-name to match node name.
[1] https://lore.kernel.org/linux-samsung-soc/0212a402-1490-0f8f-005e-32bb6f636a13@canonical.com/T/#m570c0257204af553fe11f9122551311beb56c15e
Best regards,
Krzysztof
Krzysztof Kozlowski (3):
devfreq: exynos-ppmu: use node names with hyphens
devfreq: exynos-ppmu: simplify parsing event-type from DT
ARM: dts: exynos: align PPMU event node names with dtschema
arch/arm/boot/dts/exynos5420.dtsi | 16 ++++++++--------
drivers/devfreq/event/exynos-ppmu.c | 12 +++++++-----
2 files changed, 15 insertions(+), 13 deletions(-)
--
2.30.2
From: Krzysztof Kozlowski <hidden> Date: 2021-09-20 07:18:02
Devicetree naming convention requires device node names to use hyphens
instead of underscore, so Exynos5422 devfreq event name
"ppmu-event3-dmc0_0" should be "ppmu-event3-dmc0-0". Newly introduced
dtschema enforces this, however the driver still expects old name with
an underscore.
Add new events for Exynos5422 while still accepting old name for
backwards compatibility.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
drivers/devfreq/event/exynos-ppmu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From: Krzysztof Kozlowski <hidden> Date: 2021-09-20 07:18:11
When parsing devicetree, the function of_get_devfreq_events(), for each
device child node, iterates over array of possible events "ppmu_events"
till it finds one matching by node name. When match is found the
ppmu_events[i] points to element having both the name of the event and
the counters ID.
Each PPMU device child node might have an "event-name" property with the
name of the event, however due to the design of devfreq it must be the
same as the device node name. If it is not the same, the devfreq client
won't be able to use it via devfreq_event_get_edev_by_phandle().
Since PPMU device child node name must be equal to the "event-name"
property (event-name == ppmu_events[i].name), there is no need to find
the counters ID by the "event-name". Instead use ppmu_events[i].id
which must be equal to it.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
drivers/devfreq/event/exynos-ppmu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
@@ -566,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,*usedefaultifnot.*/if(info->ppmu_type==EXYNOS_TYPE_PPMU_V2){-intid;/* Not all registers take the same value for*read+writedatacount.*/-id=__exynos_ppmu_find_ppmu_id(desc[j].name);--switch(id){+switch(ppmu_events[i].id){casePPMU_PMNCNT0:casePPMU_PMNCNT1:casePPMU_PMNCNT2:
From: Krzysztof Kozlowski <hidden> Date: 2021-09-20 07:18:13
Use hyphen instead of underscore and align the PPMU event node name with
dtschema. The event-name property must match the node name, by the
design of devfreq events and PPMU driver.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
arch/arm/boot/dts/exynos5420.dtsi | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
From: Marek Szyprowski <m.szyprowski@samsung.com> Date: 2021-09-20 09:38:51
On 20.09.2021 09:15, Krzysztof Kozlowski wrote:
My previous patch 3/3 (ARM: dts: exynos: align PPMU event node names
with dtschema) caused issues reported by Marek [1].
Tested on Exynos5422. Testing on Exynso5433 board would be very useful.
Works fine on both 5422 and 5433.
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Changes since v1:
1. New patches 1/3 and 2/3.
2. Patch 3/3: rename event-name to match node name.
[1] https://lore.kernel.org/linux-samsung-soc/0212a402-1490-0f8f-005e-32bb6f636a13@canonical.com/T/#m570c0257204af553fe11f9122551311beb56c15e
Best regards,
Krzysztof
Krzysztof Kozlowski (3):
devfreq: exynos-ppmu: use node names with hyphens
devfreq: exynos-ppmu: simplify parsing event-type from DT
ARM: dts: exynos: align PPMU event node names with dtschema
arch/arm/boot/dts/exynos5420.dtsi | 16 ++++++++--------
drivers/devfreq/event/exynos-ppmu.c | 12 +++++++-----
2 files changed, 15 insertions(+), 13 deletions(-)
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Hi Krzysztof,
On 21. 9. 20. 오후 4:17, Krzysztof Kozlowski wrote:
quoted hunk
Devicetree naming convention requires device node names to use hyphens
instead of underscore, so Exynos5422 devfreq event name
"ppmu-event3-dmc0_0" should be "ppmu-event3-dmc0-0". Newly introduced
dtschema enforces this, however the driver still expects old name with
an underscore.
Add new events for Exynos5422 while still accepting old name for
backwards compatibility.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
drivers/devfreq/event/exynos-ppmu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Hi Krzysztof,
On 21. 9. 20. 오후 4:17, Krzysztof Kozlowski wrote:
quoted hunk
When parsing devicetree, the function of_get_devfreq_events(), for each
device child node, iterates over array of possible events "ppmu_events"
till it finds one matching by node name. When match is found the
ppmu_events[i] points to element having both the name of the event and
the counters ID.
Each PPMU device child node might have an "event-name" property with the
name of the event, however due to the design of devfreq it must be the
same as the device node name. If it is not the same, the devfreq client
won't be able to use it via devfreq_event_get_edev_by_phandle().
Since PPMU device child node name must be equal to the "event-name"
property (event-name == ppmu_events[i].name), there is no need to find
the counters ID by the "event-name". Instead use ppmu_events[i].id
which must be equal to it.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
drivers/devfreq/event/exynos-ppmu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
@@ -566,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,*usedefaultifnot.*/if(info->ppmu_type==EXYNOS_TYPE_PPMU_V2){-intid;/* Not all registers take the same value for*read+writedatacount.*/-id=__exynos_ppmu_find_ppmu_id(desc[j].name);--switch(id){+switch(ppmu_events[i].id){casePPMU_PMNCNT0:casePPMU_PMNCNT1:casePPMU_PMNCNT2:
Applied it. Thanks.
--
Best Regards,
Samsung Electronics
Chanwoo Choi
Hi Krzysztof,
On 9/20/21 4:17 PM, Krzysztof Kozlowski wrote:
quoted hunk
Use hyphen instead of underscore and align the PPMU event node name with
dtschema. The event-name property must match the node name, by the
design of devfreq events and PPMU driver.
Signed-off-by: Krzysztof Kozlowski <redacted>
---
arch/arm/boot/dts/exynos5420.dtsi | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
From: Krzysztof Kozlowski <hidden> Date: 2022-02-18 13:18:14
On Mon, 20 Sep 2021 09:17:53 +0200, Krzysztof Kozlowski wrote:
Use hyphen instead of underscore and align the PPMU event node name with
dtschema. The event-name property must match the node name, by the
design of devfreq events and PPMU driver.
Applied, thanks!
[3/3] ARM: dts: exynos: align PPMU event node names with dtschema
commit: 7cdfe3b3b60c89f0e12e8ee194a7cfbfd46515dd
Best regards,
--
Krzysztof Kozlowski [off-list ref]