linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr <olekstysh@gmail.com>
To: Julien Grall <julien.grall@arm.com>,
	linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: horms@verge.net.au, magnus.damm@gmail.com, linux@armlinux.org.uk,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH] ARM: mach-shmobile: Don't configure ARCH timer if PSCI is enabled
Date: Thu, 18 Apr 2019 14:15:51 +0300	[thread overview]
Message-ID: <8c9a1480-7956-9265-14c8-3fbb472e097d@gmail.com> (raw)
In-Reply-To: <1b33dca4-e3ae-4588-05f2-37b23ac8df78@arm.com>


On 18.04.19 12:32, Julien Grall wrote:
> Hi,

Hi Julien


<snip>

>>
>> diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c 
>> b/arch/arm/mach-shmobile/setup-rcar-gen2.c
>> index eea60b2..bac4490 100644
>> --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
>> +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
>> @@ -32,7 +32,7 @@ static const struct of_device_id cpg_matches[] 
>> __initconst = {
>>       { /* sentinel */ }
>>   };
>>   -static unsigned int __init get_extal_freq(void)
>> +static unsigned int __init __maybe_unused get_extal_freq(void)
>>   {
>>       const struct of_device_id *match;
>>       struct device_node *cpg, *extal;
>> @@ -60,6 +60,12 @@ static unsigned int __init get_extal_freq(void)
>>     void __init rcar_gen2_timer_init(void)
>>   {
>> +/*
>> + * If CONFIG_PSCI is enabled then most likely we are running on 
>> PSCI-enabled
>> + * U-Boot which, we assume, has already taken care of configuring 
>> ARCH timer
>> + * stuff before switching to non-secure mode.
>> + */
>
> I disagree with that statement. CONFIG_ARM_PSCI may be selected in 
> your .config for multiple reasons:
>      - CONFIG_XEN will selected it
>      - you build a .config targeting multiple platforms
>
> Yet you may still want to boot the kernel on older U-boot. Such change 
> would make it impossible.
>
> If there are code that should not be called when PSCI is used, then 
> you need to make sure the function is not called at runtime.

I got your point.


As I answered in a previous email:

 > But "#if !defined(CONFIG_ARM_PSCI)" wraps secure_cntvoff_init() call as
 > well, which resets CNTVOFF,

 > and this is something I tried to avoid the first from being executed on
 > a CPU, which is in SVC mode (when running on top of Xen).

What would be a proper way to avoid calling secure_cntvoff_init() at 
runtime?

Check that we are already in non-secure mode and/or cntvoff is already 0?


>
> Cheers,
>
-- 
Regards,

Oleksandr Tyshchenko


  reply	other threads:[~2019-04-18 11:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 17:10 [PATCH] ARM: mach-shmobile: Don't configure ARCH timer if PSCI is enabled Oleksandr Tyshchenko
2019-04-18  7:14 ` Biju Das
2019-04-18 10:35   ` Oleksandr
2019-04-18  9:32 ` Julien Grall
2019-04-18 11:15   ` Oleksandr [this message]
2019-04-24 12:31     ` Julien Grall
2019-04-26 19:51       ` Oleksandr

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=8c9a1480-7956-9265-14c8-3fbb472e097d@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=horms@verge.net.au \
    --cc=julien.grall@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=oleksandr_tyshchenko@epam.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).