* [PATCH 0/2] Make Tegra cpuidle driver PSCI compatible @ 2015-05-08 5:55 Jan Kiszka 2015-05-08 5:55 ` [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP Jan Kiszka 2015-05-08 5:55 ` [PATCH 2/2] ARM: tegra: Disable cpuidle driver if PSCI is present Jan Kiszka 0 siblings, 2 replies; 8+ messages in thread From: Jan Kiszka @ 2015-05-08 5:55 UTC (permalink / raw) To: linux-arm-kernel Two small patches so that we can keep the Tegra cpuidle driver enabled even in the presence of PSCI which takes over some duties (U-Boot is about to gain such support for Tegra124). Jan Jan Kiszka (2): ARM: Availability of psci_smp_available depends on CONFIG_SMP ARM: tegra: Disable cpuidle driver if PSCI is present arch/arm/include/asm/psci.h | 6 +++++- arch/arm/mach-tegra/Kconfig | 1 + arch/arm/mach-tegra/tegra.c | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) -- 2.1.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-08 5:55 [PATCH 0/2] Make Tegra cpuidle driver PSCI compatible Jan Kiszka @ 2015-05-08 5:55 ` Jan Kiszka 2015-05-08 11:26 ` Thierry Reding 2015-05-08 5:55 ` [PATCH 2/2] ARM: tegra: Disable cpuidle driver if PSCI is present Jan Kiszka 1 sibling, 1 reply; 8+ messages in thread From: Jan Kiszka @ 2015-05-08 5:55 UTC (permalink / raw) To: linux-arm-kernel Ensure that we can use psci_smp_available without checking for CONFIG_SMP first. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- arch/arm/include/asm/psci.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h index c25ef3e..eef6a0a 100644 --- a/arch/arm/include/asm/psci.h +++ b/arch/arm/include/asm/psci.h @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; #ifdef CONFIG_ARM_PSCI int psci_init(void); -bool psci_smp_available(void); #else static inline int psci_init(void) { return 0; } +#endif + +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) +bool psci_smp_available(void); +#else static inline bool psci_smp_available(void) { return false; } #endif -- 2.1.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-08 5:55 ` [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP Jan Kiszka @ 2015-05-08 11:26 ` Thierry Reding 2015-05-08 14:56 ` Russell King - ARM Linux 0 siblings, 1 reply; 8+ messages in thread From: Thierry Reding @ 2015-05-08 11:26 UTC (permalink / raw) To: linux-arm-kernel On Fri, May 08, 2015 at 07:55:26AM +0200, Jan Kiszka wrote: > Ensure that we can use psci_smp_available without checking for > CONFIG_SMP first. > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > --- > arch/arm/include/asm/psci.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h > index c25ef3e..eef6a0a 100644 > --- a/arch/arm/include/asm/psci.h > +++ b/arch/arm/include/asm/psci.h > @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; > > #ifdef CONFIG_ARM_PSCI > int psci_init(void); > -bool psci_smp_available(void); > #else > static inline int psci_init(void) { return 0; } > +#endif > + > +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) > +bool psci_smp_available(void); > +#else > static inline bool psci_smp_available(void) { return false; } > #endif > Looks good to me. Russell, would you be willing to ack this patch so that I can take it through the Tegra tree along with patch 2/2 that depends on this? Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150508/3f33b4f0/attachment.sig> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-08 11:26 ` Thierry Reding @ 2015-05-08 14:56 ` Russell King - ARM Linux 2015-05-08 16:14 ` Will Deacon 0 siblings, 1 reply; 8+ messages in thread From: Russell King - ARM Linux @ 2015-05-08 14:56 UTC (permalink / raw) To: linux-arm-kernel On Fri, May 08, 2015 at 01:26:17PM +0200, Thierry Reding wrote: > On Fri, May 08, 2015 at 07:55:26AM +0200, Jan Kiszka wrote: > > Ensure that we can use psci_smp_available without checking for > > CONFIG_SMP first. > > > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > > --- > > arch/arm/include/asm/psci.h | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h > > index c25ef3e..eef6a0a 100644 > > --- a/arch/arm/include/asm/psci.h > > +++ b/arch/arm/include/asm/psci.h > > @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; > > > > #ifdef CONFIG_ARM_PSCI > > int psci_init(void); > > -bool psci_smp_available(void); > > #else > > static inline int psci_init(void) { return 0; } > > +#endif > > + > > +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) > > +bool psci_smp_available(void); > > +#else > > static inline bool psci_smp_available(void) { return false; } > > #endif > > > > Looks good to me. > > Russell, would you be willing to ack this patch so that I can take it > through the Tegra tree along with patch 2/2 that depends on this? I'd prefer to see an ack from Will on this, as it's code which Will contributed and presumably understands better than me. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-08 14:56 ` Russell King - ARM Linux @ 2015-05-08 16:14 ` Will Deacon 2015-05-10 9:48 ` Jan Kiszka 0 siblings, 1 reply; 8+ messages in thread From: Will Deacon @ 2015-05-08 16:14 UTC (permalink / raw) To: linux-arm-kernel On Fri, May 08, 2015 at 03:56:20PM +0100, Russell King - ARM Linux wrote: > On Fri, May 08, 2015 at 01:26:17PM +0200, Thierry Reding wrote: > > On Fri, May 08, 2015 at 07:55:26AM +0200, Jan Kiszka wrote: > > > Ensure that we can use psci_smp_available without checking for > > > CONFIG_SMP first. > > > > > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > > > --- > > > arch/arm/include/asm/psci.h | 6 +++++- > > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > > > diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h > > > index c25ef3e..eef6a0a 100644 > > > --- a/arch/arm/include/asm/psci.h > > > +++ b/arch/arm/include/asm/psci.h > > > @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; > > > > > > #ifdef CONFIG_ARM_PSCI > > > int psci_init(void); > > > -bool psci_smp_available(void); > > > #else > > > static inline int psci_init(void) { return 0; } > > > +#endif > > > + > > > +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) > > > +bool psci_smp_available(void); > > > +#else > > > static inline bool psci_smp_available(void) { return false; } > > > #endif > > > > > > > Looks good to me. > > > > Russell, would you be willing to ack this patch so that I can take it > > through the Tegra tree along with patch 2/2 that depends on this? > > I'd prefer to see an ack from Will on this, as it's code which Will > contributed and presumably understands better than me. Sorry, I'm late to the thread so I'm a tad confused. If I understand correctly, these two patches are trying to avoid using the tegra cpuidle driver if PSCI is available instead? That raises the question as to whether or not you're actually trying to discover whether you're in the secure or non-secure world. I assume PSCI only works if the kernel is running in non-secure mode, but does the Tegra cpuidle driver only work in secure mode? Will ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-08 16:14 ` Will Deacon @ 2015-05-10 9:48 ` Jan Kiszka 2015-05-11 12:13 ` Peter De Schrijver 0 siblings, 1 reply; 8+ messages in thread From: Jan Kiszka @ 2015-05-10 9:48 UTC (permalink / raw) To: linux-arm-kernel On 2015-05-08 18:14, Will Deacon wrote: > On Fri, May 08, 2015 at 03:56:20PM +0100, Russell King - ARM Linux wrote: >> On Fri, May 08, 2015 at 01:26:17PM +0200, Thierry Reding wrote: >>> On Fri, May 08, 2015 at 07:55:26AM +0200, Jan Kiszka wrote: >>>> Ensure that we can use psci_smp_available without checking for >>>> CONFIG_SMP first. >>>> >>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> >>>> --- >>>> arch/arm/include/asm/psci.h | 6 +++++- >>>> 1 file changed, 5 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h >>>> index c25ef3e..eef6a0a 100644 >>>> --- a/arch/arm/include/asm/psci.h >>>> +++ b/arch/arm/include/asm/psci.h >>>> @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; >>>> >>>> #ifdef CONFIG_ARM_PSCI >>>> int psci_init(void); >>>> -bool psci_smp_available(void); >>>> #else >>>> static inline int psci_init(void) { return 0; } >>>> +#endif >>>> + >>>> +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) >>>> +bool psci_smp_available(void); >>>> +#else >>>> static inline bool psci_smp_available(void) { return false; } >>>> #endif >>>> >>> >>> Looks good to me. >>> >>> Russell, would you be willing to ack this patch so that I can take it >>> through the Tegra tree along with patch 2/2 that depends on this? >> >> I'd prefer to see an ack from Will on this, as it's code which Will >> contributed and presumably understands better than me. > > Sorry, I'm late to the thread so I'm a tad confused. > > If I understand correctly, these two patches are trying to avoid using > the tegra cpuidle driver if PSCI is available instead? That raises the > question as to whether or not you're actually trying to discover whether > you're in the secure or non-secure world. > > I assume PSCI only works if the kernel is running in non-secure mode, > but does the Tegra cpuidle driver only work in secure mode? To my understanding of the hardware, the flow controller can be accessed from both worlds. So, testing the mode would neither be sufficient nor more logical - it's PSCI which occupies this resource, not automatically all secure monitors. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP 2015-05-10 9:48 ` Jan Kiszka @ 2015-05-11 12:13 ` Peter De Schrijver 0 siblings, 0 replies; 8+ messages in thread From: Peter De Schrijver @ 2015-05-11 12:13 UTC (permalink / raw) To: linux-arm-kernel On Sun, May 10, 2015 at 11:48:20AM +0200, Jan Kiszka wrote: > On 2015-05-08 18:14, Will Deacon wrote: > > On Fri, May 08, 2015 at 03:56:20PM +0100, Russell King - ARM Linux wrote: > >> On Fri, May 08, 2015 at 01:26:17PM +0200, Thierry Reding wrote: > >>> On Fri, May 08, 2015 at 07:55:26AM +0200, Jan Kiszka wrote: > >>>> Ensure that we can use psci_smp_available without checking for > >>>> CONFIG_SMP first. > >>>> > >>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> > >>>> --- > >>>> arch/arm/include/asm/psci.h | 6 +++++- > >>>> 1 file changed, 5 insertions(+), 1 deletion(-) > >>>> > >>>> diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h > >>>> index c25ef3e..eef6a0a 100644 > >>>> --- a/arch/arm/include/asm/psci.h > >>>> +++ b/arch/arm/include/asm/psci.h > >>>> @@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; > >>>> > >>>> #ifdef CONFIG_ARM_PSCI > >>>> int psci_init(void); > >>>> -bool psci_smp_available(void); > >>>> #else > >>>> static inline int psci_init(void) { return 0; } > >>>> +#endif > >>>> + > >>>> +#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) > >>>> +bool psci_smp_available(void); > >>>> +#else > >>>> static inline bool psci_smp_available(void) { return false; } > >>>> #endif > >>>> > >>> > >>> Looks good to me. > >>> > >>> Russell, would you be willing to ack this patch so that I can take it > >>> through the Tegra tree along with patch 2/2 that depends on this? > >> > >> I'd prefer to see an ack from Will on this, as it's code which Will > >> contributed and presumably understands better than me. > > > > Sorry, I'm late to the thread so I'm a tad confused. > > > > If I understand correctly, these two patches are trying to avoid using > > the tegra cpuidle driver if PSCI is available instead? That raises the > > question as to whether or not you're actually trying to discover whether > > you're in the secure or non-secure world. > > > > I assume PSCI only works if the kernel is running in non-secure mode, > > but does the Tegra cpuidle driver only work in secure mode? > > To my understanding of the hardware, the flow controller can be accessed > from both worlds. So, testing the mode would neither be sufficient nor > more logical - it's PSCI which occupies this resource, not automatically > all secure monitors. This is correct. The flow controller doesn't check the NS bit. Cheers, Peter. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] ARM: tegra: Disable cpuidle driver if PSCI is present 2015-05-08 5:55 [PATCH 0/2] Make Tegra cpuidle driver PSCI compatible Jan Kiszka 2015-05-08 5:55 ` [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP Jan Kiszka @ 2015-05-08 5:55 ` Jan Kiszka 1 sibling, 0 replies; 8+ messages in thread From: Jan Kiszka @ 2015-05-08 5:55 UTC (permalink / raw) To: linux-arm-kernel The firmware takes over the ownership of the flow controller when it provides PSCI support. To avoid clashes, disable the Tegra cpuidle driver if PSCI was detected. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- arch/arm/mach-tegra/Kconfig | 1 + arch/arm/mach-tegra/tegra.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 5d1a318..f93e4dc 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -4,6 +4,7 @@ menuconfig ARCH_TEGRA select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS select ARM_AMBA select ARM_GIC + select ARM_PSCI select CLKSRC_MMIO select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 861d884..17e1adc 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -44,6 +44,7 @@ #include <asm/mach-types.h> #include <asm/setup.h> #include <asm/trusted_foundations.h> +#include <asm/psci.h> #include "board.h" #include "common.h" @@ -136,7 +137,8 @@ static void __init tegra_dt_init_late(void) int i; tegra_init_suspend(); - tegra_cpuidle_init(); + if (!psci_smp_available()) + tegra_cpuidle_init(); for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) { if (of_machine_is_compatible(board_init_funcs[i].machine)) { -- 2.1.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-11 12:13 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-05-08 5:55 [PATCH 0/2] Make Tegra cpuidle driver PSCI compatible Jan Kiszka 2015-05-08 5:55 ` [PATCH 1/2] ARM: Availability of psci_smp_available depends on CONFIG_SMP Jan Kiszka 2015-05-08 11:26 ` Thierry Reding 2015-05-08 14:56 ` Russell King - ARM Linux 2015-05-08 16:14 ` Will Deacon 2015-05-10 9:48 ` Jan Kiszka 2015-05-11 12:13 ` Peter De Schrijver 2015-05-08 5:55 ` [PATCH 2/2] ARM: tegra: Disable cpuidle driver if PSCI is present Jan Kiszka
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).