From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>, Lukasz Luba <lukasz.luba@arm.com>
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware
Date: Mon, 29 Jun 2020 10:54:27 +0200 [thread overview]
Message-ID: <96d7f0f2-63c0-8c8d-5a79-ba27295b389a@samsung.com> (raw)
In-Reply-To: <20200622171904.GA4174@kozik-lap>
Hi Krzysztof,
On 22.06.2020 19:19, Krzysztof Kozlowski wrote:
> On Wed, Jun 17, 2020 at 05:26:58PM +0100, Lukasz Luba wrote:
>> I've give it a try with hotplug torture tests and has only one a minor
>> comment.
>>
>> On 6/16/20 9:12 AM, Marek Szyprowski wrote:
>>> The additional soft-reset call during little core power up was needed
>>> to properly boot all cores on the Exynos5422-based boards with secure
>>> firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE
>>> CPUidle driver, which worked only on boards without secure firmware
>>> (like Peach-Pit/Pi Chromebooks).
>>>
>>> Apply the workaround only when board is running under secure firmware.
>>>
>>> Fixes: 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")
> Fix the Fixes tag (in case of resend, otherwise I'll do it).
>
>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> ---
>>> arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
>>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
>>> index 9a681b421ae1..cd861c57d5ad 100644
>>> --- a/arch/arm/mach-exynos/mcpm-exynos.c
>>> +++ b/arch/arm/mach-exynos/mcpm-exynos.c
>>> @@ -26,6 +26,7 @@
>>> #define EXYNOS5420_USE_L2_COMMON_UP_STATE BIT(30)
>>> static void __iomem *ns_sram_base_addr __ro_after_init;
>>> +static bool secure_firmware __ro_after_init;
>>> /*
>>> * The common v7_exit_coherency_flush API could not be used because of the
>>> @@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
>>> static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
>>> {
>>> unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);
>>> + bool state;
>>> pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
>>> if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
>>> cluster >= EXYNOS5420_NR_CLUSTERS)
>>> return -EINVAL;
>>> - if (!exynos_cpu_power_state(cpunr)) {
>>> - exynos_cpu_power_up(cpunr);
>>> -
>>> + state = exynos_cpu_power_state(cpunr);
>>> + exynos_cpu_power_up(cpunr);
>> I can see that you have moved this call up, probably to avoid more
>> 'if-else' stuff. I just wanted to notify you that this function
>> 'exynos_cpu_powerup' is called twice when cpu is going up:
>> 1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e.
>> CPU2
>> 2. by the newly starting cpu i.e. CPU2 by running
>> 'secondary_start_kernel' and the state is 3.
>>
>> In this scenario the 'exynos_cpu_power_up' will be called twice.
>> I have checked in hotplug that this is not causing any issues, but
>> thought maybe it's worth share it with you. Maybe you can double check
>> in TRM that this is not causing anything.
> This brings the old code, before 833b5794e33. I wonder why? I understood
> that only soft-reset should be skipped.
Because otherwise the Peach boards hangs during the cpuidle. I didn't
analyze the code that much to judge if it is really necessary in all
cases, I only restored what worked initially. I can add a comment about
that to the commit log if needed.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2020-06-29 20:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200616081248eucas1p168faa343ce333a28c8fd3cf9a6a58b3c@eucas1p1.samsung.com>
2020-06-16 8:12 ` [PATCH 0/4] Restore big.LITTLE cpuidle driver for Exynos Marek Szyprowski
[not found] ` <CGME20200616081249eucas1p151a8892ca0abfa3108955e1fc5054fc3@eucas1p1.samsung.com>
2020-06-16 8:12 ` [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware Marek Szyprowski
2020-06-17 16:26 ` Lukasz Luba
2020-06-22 17:19 ` Krzysztof Kozlowski
2020-06-29 8:54 ` Marek Szyprowski [this message]
2020-06-29 9:13 ` Krzysztof Kozlowski
[not found] ` <CGME20200629100230eucas1p1bf07ca4c84ba6be1fbdd80c45d077518@eucas1p1.samsung.com>
2020-06-29 10:02 ` [PATCH v2 1/4] ARM: exynos: MCPM: Restore big.LITTLE cpuidle support Marek Szyprowski
2020-06-29 11:05 ` Lukasz Luba
2020-06-29 18:28 ` Krzysztof Kozlowski
[not found] ` <CGME20200616081249eucas1p2ad165b545f265bec88a06270d55fce76@eucas1p2.samsung.com>
2020-06-16 8:12 ` [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks Marek Szyprowski
2020-06-22 17:19 ` Krzysztof Kozlowski
2020-06-24 10:05 ` Bartlomiej Zolnierkiewicz
2020-08-17 15:39 ` Krzysztof Kozlowski
2020-08-24 8:15 ` Daniel Lezcano
2020-08-24 8:26 ` Krzysztof Kozlowski
2020-08-24 9:14 ` Daniel Lezcano
[not found] ` <CGME20200616081250eucas1p2de7110898dad050866d78cb5d5120422@eucas1p2.samsung.com>
2020-06-16 8:12 ` [PATCH 3/4] ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver Marek Szyprowski
2020-06-22 17:20 ` Krzysztof Kozlowski
2020-06-29 11:35 ` Marek Szyprowski
2020-06-24 10:06 ` Bartlomiej Zolnierkiewicz
[not found] ` <CGME20200616081250eucas1p2a98f8810962ddc692fa5588a74f911b3@eucas1p2.samsung.com>
2020-06-16 8:12 ` [PATCH 4/4] ARM: multi_v7_defconfig: " Marek Szyprowski
2020-06-24 10:06 ` Bartlomiej Zolnierkiewicz
2020-06-16 20:58 ` [PATCH 0/4] Restore big.LITTLE cpuidle driver for Exynos Anand Moon
2020-06-17 9:48 ` Marek Szyprowski
2020-06-17 10:40 ` Lukasz Luba
2020-06-17 10:57 ` Anand Moon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96d7f0f2-63c0-8c8d-5a79-ba27295b389a@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=daniel.lezcano@linaro.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=lukasz.luba@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).