2019-06-05 09:14:59

by Lukasz Luba

[permalink] [raw]
Subject: [PATCH v4 0/5] Exynos Performance Monitoring Counters enhancements

Hi all,

This patch set extends PPMU on Samsung Exynos by choosing type of data
which shell be counter in the PPMU registers.
It is possible to count e.g. read or write requests, read or write data
or latency.
A new field has been added in the DT 'event' node called 'event-data-type'.
It is them used during the setup of the counter. In the prevoius
implementation there was always one option used: count read+write data.
Sometimes we need more precised information and this patch set tries to
address it.

Changes:
v4:
- changed the way how 'ops' are matched according to Chanwoo's sugestions
in his example code (added his Signed-off-by to patch 2)
- changed documentation description accoriding to Chanwoo's sugestions
(added his Signed-off-by to patch 4)
- collected ACKs for patch 1 from Rob and from Chanwoo for patch 2 and
'Reviewed-by' for patch 1
- patch set is now based on v5.2-rc3 and tested on Odroid u3
v3 [1]:
- fixed wrong interpretation of ret value during DT parsing, which caused
alwasy taking default value.
v2 [2]:
- removed new entry in MAINTAINERS file as suggested by Bartek Zolnierkiewicz
and added new file to existing list for devfreq events
- added in the dt-bindings/pmu/exynos_ppmu.h 2 new entries for RO and WO for
counters in Exynos5433
- changed initialization with default values when data_type is not provided
in DT (as sugessted by Chanwoo)
- added 4th patch which adds 'event-data-type' to 'event' node for Exynos4412
PPMU events (asked by Chanwoo)

Regards,
Lukasz Luba

[1] https://lkml.org/lkml/2019/4/19/158
[2] https://lkml.org/lkml/2019/4/18/453

Lukasz Luba (5):
include: dt-bindings: add Performance Monitoring Unit for Exynos
drivers: devfreq: events: change matching code during probe
drivers: devfreq: events: extend events by type of counted data
Documentation: devicetree: add PPMU events description
DT: arm: exynos4412: add event data type which is monitored

.../bindings/devfreq/event/exynos-ppmu.txt | 26 ++++-
MAINTAINERS | 1 +
arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 10 ++
drivers/devfreq/event/exynos-ppmu.c | 98 +++++++++++++------
include/dt-bindings/pmu/exynos_ppmu.h | 25 +++++
include/linux/devfreq-event.h | 6 ++
6 files changed, 132 insertions(+), 34 deletions(-)
create mode 100644 include/dt-bindings/pmu/exynos_ppmu.h

--
2.17.1


2019-06-05 09:15:05

by Lukasz Luba

[permalink] [raw]
Subject: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

Extend the documenation by events description with new 'event-data-type'
field. Add example how the event might be defined in DT.

Signed-off-by: Lukasz Luba <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
---
.../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt
index 3e36c1d11386..fb46b491791c 100644
--- a/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt
+++ b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt
@@ -10,14 +10,23 @@ The Exynos PPMU driver uses the devfreq-event class to provide event data
to various devfreq devices. The devfreq devices would use the event data when
derterming the current state of each IP.

-Required properties:
+Required properties for PPMU device:
- compatible: Should be "samsung,exynos-ppmu" or "samsung,exynos-ppmu-v2.
- reg: physical base address of each PPMU and length of memory mapped region.

-Optional properties:
+Optional properties for PPMU device:
- clock-names : the name of clock used by the PPMU, "ppmu"
- clocks : phandles for clock specified in "clock-names" property

+Required properties for 'events' child node of PPMU device:
+- event-name : the unique event name among PPMU device
+Optional properties for 'events' child node of PPMU device:
+- event-data-type : Define the type of data which shell be counted
+by the counter. You can check include/dt-bindings/pmu/exynos_ppmu.h for
+all possible type, i.e. count read requests, count write data in bytes,
+etc. This field is optional and when it is missing, the driver code
+will use default data type.
+
Example1 : PPMUv1 nodes in exynos3250.dtsi are listed below.

ppmu_dmc0: ppmu_dmc0@106a0000 {
@@ -145,3 +154,16 @@ Example3 : PPMUv2 nodes in exynos5433.dtsi are listed below.
reg = <0x104d0000 0x2000>;
status = "disabled";
};
+
+Example4 : 'event-data-type' in exynos4412-ppmu-common.dtsi are listed below.
+
+ &ppmu_dmc0 {
+ status = "okay";
+ events {
+ ppmu_dmc0_3: ppmu-event3-dmc0 {
+ event-name = "ppmu-event3-dmc0";
+ event-data-type = <(PPMU_RO_DATA_CNT |
+ PPMU_WO_DATA_CNT)>;
+ };
+ };
+ };
--
2.17.1

2019-06-26 14:00:37

by Lukasz Luba

[permalink] [raw]
Subject: Re: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

Hi Chanwoo,

On 6/26/19 10:23 AM, Chanwoo Choi wrote:
> Hi Lukasz,
>
> 2019년 6월 5일 (수) 18:14, Lukasz Luba <[email protected]
> <mailto:[email protected]>>님이 작성:
>
> Extend the documenation by events description with new 'event-data-type'
> field. Add example how the event might be defined in DT.
>
> Signed-off-by: Lukasz Luba <[email protected]
> <mailto:[email protected]>>
> Signed-off-by: Chanwoo Choi <[email protected]
> <mailto:[email protected]>>
> ---
>  .../bindings/devfreq/event/exynos-ppmu.txt    | 26 +++++++++++++++++--
>  1 file changed, 24 insertions(+), 2 deletions(-)
>
>
>
> Acked-by: Chanwoo Choi <[email protected]

Thank you for the ACKs for this a 2/5 patch.
Do you think the v4 could be merged now?

Regards,
Lukasz

2019-06-26 14:04:34

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

On Wed, 26 Jun 2019 at 15:58, Lukasz Luba <[email protected]> wrote:
>
> Hi Chanwoo,
>
> On 6/26/19 10:23 AM, Chanwoo Choi wrote:
> > Hi Lukasz,
> >
> > 2019년 6월 5일 (수) 18:14, Lukasz Luba <[email protected]
> > <mailto:[email protected]>>님이 작성:
> >
> > Extend the documenation by events description with new 'event-data-type'
> > field. Add example how the event might be defined in DT.
> >
> > Signed-off-by: Lukasz Luba <[email protected]
> > <mailto:[email protected]>>
> > Signed-off-by: Chanwoo Choi <[email protected]
> > <mailto:[email protected]>>
> > ---
> > .../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++--
> > 1 file changed, 24 insertions(+), 2 deletions(-)
> >
> >
> >
> > Acked-by: Chanwoo Choi <[email protected]
>
> Thank you for the ACKs for this a 2/5 patch.
> Do you think the v4 could be merged now?

I think you have all necessary acks. I can take the DTS patch (5/5)
although probably for next merge window as I just sent one.

Best regards,
Krzysztof

2019-06-26 14:17:49

by Lukasz Luba

[permalink] [raw]
Subject: Re: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

Hi Krzysztof,

On 6/26/19 4:03 PM, Krzysztof Kozlowski wrote:
> On Wed, 26 Jun 2019 at 15:58, Lukasz Luba <[email protected]> wrote:
>>
>> Hi Chanwoo,
>>
>> On 6/26/19 10:23 AM, Chanwoo Choi wrote:
>>> Hi Lukasz,
>>>
>>> 2019년 6월 5일 (수) 18:14, Lukasz Luba <[email protected]
>>> <mailto:[email protected]>>님이 작성:
>>>
>>> Extend the documenation by events description with new 'event-data-type'
>>> field. Add example how the event might be defined in DT.
>>>
>>> Signed-off-by: Lukasz Luba <[email protected]
>>> <mailto:[email protected]>>
>>> Signed-off-by: Chanwoo Choi <[email protected]
>>> <mailto:[email protected]>>
>>> ---
>>> .../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++--
>>> 1 file changed, 24 insertions(+), 2 deletions(-)
>>>
>>>
>>>
>>> Acked-by: Chanwoo Choi <[email protected]
>>
>> Thank you for the ACKs for this a 2/5 patch.
>> Do you think the v4 could be merged now?
>
> I think you have all necessary acks. I can take the DTS patch (5/5)
> although probably for next merge window as I just sent one.
There was one patch 3/5
https://lkml.org/lkml/2019/6/5/215
which was waiting ACK or I missed the email somehow.

Regards,
Lukasz

>
> Best regards,
> Krzysztof
>
>

2019-06-27 01:10:12

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

Hi Lukasz,

On 19. 6. 26. 오후 11:17, Lukasz Luba wrote:
> Hi Krzysztof,
>
> On 6/26/19 4:03 PM, Krzysztof Kozlowski wrote:
>> On Wed, 26 Jun 2019 at 15:58, Lukasz Luba <[email protected]> wrote:
>>>
>>> Hi Chanwoo,
>>>
>>> On 6/26/19 10:23 AM, Chanwoo Choi wrote:
>>>> Hi Lukasz,
>>>>
>>>> 2019년 6월 5일 (수) 18:14, Lukasz Luba <[email protected]
>>>> <mailto:[email protected]>>님이 작성:
>>>>
>>>> Extend the documenation by events description with new 'event-data-type'
>>>> field. Add example how the event might be defined in DT.
>>>>
>>>> Signed-off-by: Lukasz Luba <[email protected]
>>>> <mailto:[email protected]>>
>>>> Signed-off-by: Chanwoo Choi <[email protected]
>>>> <mailto:[email protected]>>
>>>> ---
>>>> .../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++--
>>>> 1 file changed, 24 insertions(+), 2 deletions(-)
>>>>
>>>>
>>>>
>>>> Acked-by: Chanwoo Choi <[email protected]
>>>
>>> Thank you for the ACKs for this a 2/5 patch.
>>> Do you think the v4 could be merged now?
>>
>> I think you have all necessary acks. I can take the DTS patch (5/5)
>> although probably for next merge window as I just sent one.
> There was one patch 3/5
> https://protect2.fireeye.com/url?k=82dd0d0cbe2abd04.82dc8643-d13ecd7e5f989b8d&u=https://lkml.org/lkml/2019/6/5/215
> which was waiting ACK or I missed the email somehow.

When I was in vacation, your patches are removed on my email account
because of the email expiration. So, I replied with my Ack through
gmail account on mobile phone. But, there are some problem. My reply
didn't arrive the mailing list.

I have no any way to reply about this at company. After leaving one's
office, I'll reply with Ack again at home.

>
> Regards,
> Lukasz
>
>>
>> Best regards,
>> Krzysztof
>>
>>
>
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics

2019-06-27 10:31:34

by Lukasz Luba

[permalink] [raw]
Subject: Re: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description

Hi Chanwoo,

On 6/27/19 3:11 AM, Chanwoo Choi wrote:
> Hi Lukasz,
>
> On 19. 6. 26. 오후 11:17, Lukasz Luba wrote:
>> Hi Krzysztof,
>>
>> On 6/26/19 4:03 PM, Krzysztof Kozlowski wrote:
>>> On Wed, 26 Jun 2019 at 15:58, Lukasz Luba <[email protected]> wrote:
>>>>
>>>> Hi Chanwoo,
>>>>
>>>> On 6/26/19 10:23 AM, Chanwoo Choi wrote:
>>>>> Hi Lukasz,
>>>>>
>>>>> 2019년 6월 5일 (수) 18:14, Lukasz Luba <[email protected]
>>>>> <mailto:[email protected]>>님이 작성:
>>>>>
>>>>> Extend the documenation by events description with new 'event-data-type'
>>>>> field. Add example how the event might be defined in DT.
>>>>>
>>>>> Signed-off-by: Lukasz Luba <[email protected]
>>>>> <mailto:[email protected]>>
>>>>> Signed-off-by: Chanwoo Choi <[email protected]
>>>>> <mailto:[email protected]>>
>>>>> ---
>>>>> .../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++--
>>>>> 1 file changed, 24 insertions(+), 2 deletions(-)
>>>>>
>>>>>
>>>>>
>>>>> Acked-by: Chanwoo Choi <[email protected]
>>>>
>>>> Thank you for the ACKs for this a 2/5 patch.
>>>> Do you think the v4 could be merged now?
>>>
>>> I think you have all necessary acks. I can take the DTS patch (5/5)
>>> although probably for next merge window as I just sent one.
>> There was one patch 3/5
>> https://protect2.fireeye.com/url?k=82dd0d0cbe2abd04.82dc8643-d13ecd7e5f989b8d&u=https://lkml.org/lkml/2019/6/5/215
>> which was waiting ACK or I missed the email somehow.
>
> When I was in vacation, your patches are removed on my email account
> because of the email expiration. So, I replied with my Ack through
> gmail account on mobile phone. But, there are some problem. My reply
> didn't arrive the mailing list.
>
> I have no any way to reply about this at company. After leaving one's
> office, I'll reply with Ack again at home.
>
OK, no worries, it is not an emergency issue.
Regards,
Lukasz