mbox series

[0/4] Restore big.LITTLE cpuidle driver for Exynos

Message ID 20200616081230.31198-1-m.szyprowski@samsung.com (mailing list archive)
Headers show
Series Restore big.LITTLE cpuidle driver for Exynos | expand

Message

Marek Szyprowski June 16, 2020, 8:12 a.m. UTC
The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung
Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked
only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the
exynos_defconfig. This patchset provides the needed fix to the common
code and restores support for it. Thanks to Lukasz Luba who motivated me
to take a look into this issue.

Best regards
Marek Szyprowski
Samsung R&D Institute Poland


Patch summary:

Marek Szyprowski (4):
  ARM: exynos: Apply little core workaround only under secure firmware
  cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks
  ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver
  ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver

 arch/arm/configs/exynos_defconfig    |  1 +
 arch/arm/configs/multi_v7_defconfig  |  1 +
 arch/arm/mach-exynos/mcpm-exynos.c   | 10 +++++++---
 drivers/cpuidle/cpuidle-big_little.c |  3 +--
 4 files changed, 10 insertions(+), 5 deletions(-)

Comments

Anand Moon June 16, 2020, 8:58 p.m. UTC | #1
Hi Marek,

On Tue, 16 Jun 2020 at 13:44, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung
> Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked
> only on those boards.
>
> However, support for it was broken by the commit 833b5794e330 ("ARM:
> EXYNOS: reset Little cores when cpu is up") and then never enabled in the
> exynos_defconfig. This patchset provides the needed fix to the common
> code and restores support for it. Thanks to Lukasz Luba who motivated me
> to take a look into this issue.
>
Thanks for this updates.

But I feel some DTS changes are missing for example
d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

But I feel that this feature is not working as desired since
still some missing code changes for cluster idle states are missing.
like clock  PWR_CTR and PWR_CTRL2.

-Anand

> Best regards
> Marek Szyprowski
> Samsung R&D Institute Poland
>
>
> Patch summary:
>
> Marek Szyprowski (4):
>   ARM: exynos: Apply little core workaround only under secure firmware
>   cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks
>   ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver
>   ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver
>
>  arch/arm/configs/exynos_defconfig    |  1 +
>  arch/arm/configs/multi_v7_defconfig  |  1 +
>  arch/arm/mach-exynos/mcpm-exynos.c   | 10 +++++++---
>  drivers/cpuidle/cpuidle-big_little.c |  3 +--
>  4 files changed, 10 insertions(+), 5 deletions(-)
>
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Marek Szyprowski June 17, 2020, 9:48 a.m. UTC | #2
Hi Anand,

On 16.06.2020 22:58, Anand Moon wrote:
> On Tue, 16 Jun 2020 at 13:44, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>> The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung
>> Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked
>> only on those boards.
>>
>> However, support for it was broken by the commit 833b5794e330 ("ARM:
>> EXYNOS: reset Little cores when cpu is up") and then never enabled in the
>> exynos_defconfig. This patchset provides the needed fix to the common
>> code and restores support for it. Thanks to Lukasz Luba who motivated me
>> to take a look into this issue.
>>
> Thanks for this updates.
>
> But I feel some DTS changes are missing for example
> d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

This is not strictly needed. The bl-cpuidle matches also to the A7/A15 
CPU product ids and it is properly instantiated on the Peach Pit/Pi 
Chromebooks. Those CPU DT properties were added as a future-proof 
generic solution. I won't hurt to add them though.

> But I feel that this feature is not working as desired since
> still some missing code changes for cluster idle states are missing.
> like clock  PWR_CTR and PWR_CTRL2.

I cannot judge now. All I can test now is a that the boards enters those 
idle states and system works stable. I cannot measure power consumption, 
because currently I have only remote access to the boards.

Best regards
Lukasz Luba June 17, 2020, 10:40 a.m. UTC | #3
On 6/17/20 10:48 AM, Marek Szyprowski wrote:
> Hi Anand,
> 
> On 16.06.2020 22:58, Anand Moon wrote:
>> On Tue, 16 Jun 2020 at 13:44, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>>> The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung
>>> Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked
>>> only on those boards.
>>>
>>> However, support for it was broken by the commit 833b5794e330 ("ARM:
>>> EXYNOS: reset Little cores when cpu is up") and then never enabled in the
>>> exynos_defconfig. This patchset provides the needed fix to the common
>>> code and restores support for it. Thanks to Lukasz Luba who motivated me
>>> to take a look into this issue.
>>>
>> Thanks for this updates.
>>
>> But I feel some DTS changes are missing for example
>> d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT
> 
> This is not strictly needed. The bl-cpuidle matches also to the A7/A15
> CPU product ids and it is properly instantiated on the Peach Pit/Pi
> Chromebooks. Those CPU DT properties were added as a future-proof
> generic solution. I won't hurt to add them though.

> 
>> But I feel that this feature is not working as desired since
>> still some missing code changes for cluster idle states are missing.
>> like clock  PWR_CTR and PWR_CTRL2.
> 
> I cannot judge now. All I can test now is a that the boards enters those
> idle states and system works stable. I cannot measure power consumption,
> because currently I have only remote access to the boards.

I agree with Marek. This can be done incrementally. The series fixes the
code path which was working. After the investigation with a power
meter, a proper set of new patches might come if needed.

As a hint to measure this power consumption difference, because it
might be tricky, I would suggest to heat up the SoC. The main
difference between wfi and deeper idle which cut the power
to some components (like caches) should be seen at higher voltage
OPP and higher temperature. It's due to the fact that static power
(leakage) is related to Vdd and temperature -
higher voltage -> higher leakage
higher temp -> higher leakage
This difference (idle state 0 vs 1) should be amplified in the
above scenario and easier to measure.

I am going to review this series after finishing hotplug tests.

Regards,
Lukasz
Anand Moon June 17, 2020, 10:57 a.m. UTC | #4
Hi Marek,

On Wed, 17 Jun 2020 at 15:18, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> Hi Anand,
>
> On 16.06.2020 22:58, Anand Moon wrote:
> > On Tue, 16 Jun 2020 at 13:44, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> >> The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung
> >> Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked
> >> only on those boards.
> >>
> >> However, support for it was broken by the commit 833b5794e330 ("ARM:
> >> EXYNOS: reset Little cores when cpu is up") and then never enabled in the
> >> exynos_defconfig. This patchset provides the needed fix to the common
> >> code and restores support for it. Thanks to Lukasz Luba who motivated me
> >> to take a look into this issue.
> >>
> > Thanks for this updates.
> >
> > But I feel some DTS changes are missing for example
> > d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT
>
> This is not strictly needed. The bl-cpuidle matches also to the A7/A15
> CPU product ids and it is properly instantiated on the Peach Pit/Pi
> Chromebooks. Those CPU DT properties were added as a future-proof
> generic solution. I won't hurt to add them though.
>
Ok Thanks.

> > But I feel that this feature is not working as desired since
> > still some missing code changes for cluster idle states are missing.
> > like clock  PWR_CTR and PWR_CTRL2.
>
> I cannot judge now. All I can test now is a that the boards enters those
> idle states and system works stable. I cannot measure power consumption,
> because currently I have only remote access to the boards.
>
Ok, Thanks.

What I meant was in order to cpu cluster to enter into IDLE states,
it's controlled by the EXYNOS5422_PWR_CTRL and EXYNOS5422_PWR_CTRL2 clk fields
See below example from the Exynos5422 cpu idle driver.

[0] https://github.com/hardkernel/linux/blob/odroidxu3-3.10.y/arch/arm/mach-exynos/cpuidle-exynos5422.c#L319-L379

Just link Exynos5250 clk driver we need to Initialize PWR_CTRL and
PWR_CTRL2 for Exynos542x clocks

[1] https://github.com/torvalds/linux/blob/master/drivers/clk/samsung/clk-exynos5250.c#L828-L846

which will help support cpu idle drivers.

-Anand