linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative
@ 2019-02-10 23:12 Stuart Menefy
  2019-02-11 13:53 ` Stuart Menefy
  0 siblings, 1 reply; 4+ messages in thread
From: Stuart Menefy @ 2019-02-10 23:12 UTC (permalink / raw)
  To: Russell King, Arnd Bergmann, Will Deacon, Nicolas Pitre,
	linux-arm-kernel, linux-samsung-soc

On some platforms (in particular the Exynos5260) the wfi is not
executed directly by the operating system but by trapping into the
secure monitor. This allows us to replicate the behaviour of the
vendor supplied kernel using the MCPM framework.

Signed-off-by: Stuart Menefy <stuart.menefy@mathembedded.com>
---
 arch/arm/common/mcpm_entry.c | 8 ++++++--
 arch/arm/include/asm/mcpm.h  | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c
index ad574d20415c..524be627c87e 100644
--- a/arch/arm/common/mcpm_entry.c
+++ b/arch/arm/common/mcpm_entry.c
@@ -289,8 +289,12 @@ void mcpm_cpu_power_down(void)
 	__mcpm_cpu_down(cpu, cluster);
 
 	/* Now we are prepared for power-down, do it: */
-	if (cpu_going_down)
-		wfi();
+	if (cpu_going_down) {
+		if (platform_ops->wfi_alternative)
+			platform_ops->wfi_alternative(last_man);
+		else
+			wfi();
+	}
 
 	/*
 	 * It is possible for a power_up request to happen concurrently
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
index acd4983d9b1f..96fdb41ac626 100644
--- a/arch/arm/include/asm/mcpm.h
+++ b/arch/arm/include/asm/mcpm.h
@@ -223,6 +223,7 @@ struct mcpm_platform_ops {
 	int (*cluster_powerup)(unsigned int cluster);
 	void (*cpu_suspend_prepare)(unsigned int cpu, unsigned int cluster);
 	void (*cpu_powerdown_prepare)(unsigned int cpu, unsigned int cluster);
+	void (*wfi_alternative)(bool last_man);
 	void (*cluster_powerdown_prepare)(unsigned int cluster);
 	void (*cpu_cache_disable)(void);
 	void (*cluster_cache_disable)(void);
-- 
2.13.6


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative
  2019-02-10 23:12 [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative Stuart Menefy
@ 2019-02-11 13:53 ` Stuart Menefy
  2019-02-11 14:12   ` Russell King - ARM Linux admin
  2019-02-11 15:57   ` Nicolas Pitre
  0 siblings, 2 replies; 4+ messages in thread
From: Stuart Menefy @ 2019-02-11 13:53 UTC (permalink / raw)
  To: Russell King, Arnd Bergmann, Will Deacon, Nicolas Pitre,
	linux-arm-kernel, linux-samsung-soc

Folks

On Sun, 10 Feb 2019 at 23:12, Stuart Menefy
<stuart.menefy@mathembedded.com> wrote:
>
> On some platforms (in particular the Exynos5260) the wfi is not
> executed directly by the operating system but by trapping into the
> secure monitor. This allows us to replicate the behaviour of the
> vendor supplied kernel using the MCPM framework.
>
> Signed-off-by: Stuart Menefy <stuart.menefy@mathembedded.com>

I forgot to add, this is a part of a series of patches which updates
the Exynos 5260
support, allowing use of the kernel on secure parts and adding suspend
functionality,
Version 1 of the patches has been posted to the samsung-soc mailing list:
https://www.spinics.net/lists/linux-samsung-soc/#65035
and I'm just about to post version 2. However as this is the only patch which
touches generic ARM files I though I'd better check the approach is acceptable
to a wider audience.

Stuart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative
  2019-02-11 13:53 ` Stuart Menefy
@ 2019-02-11 14:12   ` Russell King - ARM Linux admin
  2019-02-11 15:57   ` Nicolas Pitre
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux admin @ 2019-02-11 14:12 UTC (permalink / raw)
  To: Stuart Menefy
  Cc: linux-samsung-soc, Will Deacon, linux-arm-kernel, Arnd Bergmann,
	Nicolas Pitre

On Mon, Feb 11, 2019 at 01:53:14PM +0000, Stuart Menefy wrote:
> Folks
> 
> On Sun, 10 Feb 2019 at 23:12, Stuart Menefy
> <stuart.menefy@mathembedded.com> wrote:
> >
> > On some platforms (in particular the Exynos5260) the wfi is not
> > executed directly by the operating system but by trapping into the
> > secure monitor. This allows us to replicate the behaviour of the
> > vendor supplied kernel using the MCPM framework.
> >
> > Signed-off-by: Stuart Menefy <stuart.menefy@mathembedded.com>
> 
> I forgot to add, this is a part of a series of patches which updates
> the Exynos 5260
> support, allowing use of the kernel on secure parts and adding suspend
> functionality,
> Version 1 of the patches has been posted to the samsung-soc mailing list:
> https://www.spinics.net/lists/linux-samsung-soc/#65035
> and I'm just about to post version 2. However as this is the only patch which
> touches generic ARM files I though I'd better check the approach is acceptable
> to a wider audience.

Please don't limit patches to just the SoC specific mailing list - copy
linux-arm-kernel and linux-kernel as well.  Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative
  2019-02-11 13:53 ` Stuart Menefy
  2019-02-11 14:12   ` Russell King - ARM Linux admin
@ 2019-02-11 15:57   ` Nicolas Pitre
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2019-02-11 15:57 UTC (permalink / raw)
  To: Stuart Menefy
  Cc: linux-arm-kernel, linux-samsung-soc, Will Deacon, Russell King,
	Arnd Bergmann

On Mon, 11 Feb 2019, Stuart Menefy wrote:

> Folks
> 
> On Sun, 10 Feb 2019 at 23:12, Stuart Menefy
> <stuart.menefy@mathembedded.com> wrote:
> >
> > On some platforms (in particular the Exynos5260) the wfi is not
> > executed directly by the operating system but by trapping into the
> > secure monitor. This allows us to replicate the behaviour of the
> > vendor supplied kernel using the MCPM framework.
> >
> > Signed-off-by: Stuart Menefy <stuart.menefy@mathembedded.com>
> 
> I forgot to add, this is a part of a series of patches which updates
> the Exynos 5260
> support, allowing use of the kernel on secure parts and adding suspend
> functionality,
> Version 1 of the patches has been posted to the samsung-soc mailing list:
> https://www.spinics.net/lists/linux-samsung-soc/#65035
> and I'm just about to post version 2. However as this is the only patch which
> touches generic ARM files I though I'd better check the approach is acceptable
> to a wider audience.

I was about to ask that you also post those patches making use of this 
change.  It is not possible to evaluate if the approach makes sense 
without seeing how it is used.


Nicolas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-11 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-10 23:12 [PATCH] ARM: MCPM: Add provision for platform specific wfi alternative Stuart Menefy
2019-02-11 13:53 ` Stuart Menefy
2019-02-11 14:12   ` Russell King - ARM Linux admin
2019-02-11 15:57   ` Nicolas Pitre

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).