linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: use generic function to exit coherency
@ 2019-04-10 23:14 Stefan Agner
  2019-04-16  5:46 ` Shawn Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2019-04-10 23:14 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: linux, kernel, festevam, linux-imx, linux-arm-kernel,
	linux-kernel, Stefan Agner

The common ARM architecture code provides a generic function to exit
coherency called v7_exit_coherency_flush(). Replace the machine
specific implementation using the generic function.

Tested on a i.MX 6Dual by hotplugging the secondary CPU under load
through sysfs several 1000 times.

Tested-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/mach-imx/hotplug.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index b35e99cc5e5b..7a74a9b89a49 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -12,32 +12,12 @@
 
 #include <linux/errno.h>
 #include <linux/jiffies.h>
+#include <asm/cacheflush.h>
 #include <asm/cp15.h>
 #include <asm/proc-fns.h>
 
 #include "common.h"
 
-static inline void cpu_enter_lowpower(void)
-{
-	unsigned int v;
-
-	asm volatile(
-		"mcr	p15, 0, %1, c7, c5, 0\n"
-	"	mcr	p15, 0, %1, c7, c10, 4\n"
-	/*
-	 * Turn off coherency
-	 */
-	"	mrc	p15, 0, %0, c1, c0, 1\n"
-	"	bic	%0, %0, %3\n"
-	"	mcr	p15, 0, %0, c1, c0, 1\n"
-	"	mrc	p15, 0, %0, c1, c0, 0\n"
-	"	bic	%0, %0, %2\n"
-	"	mcr	p15, 0, %0, c1, c0, 0\n"
-	  : "=&r" (v)
-	  : "r" (0), "Ir" (CR_C), "Ir" (0x40)
-	  : "cc");
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
@@ -45,7 +25,7 @@ static inline void cpu_enter_lowpower(void)
  */
 void imx_cpu_die(unsigned int cpu)
 {
-	cpu_enter_lowpower();
+	v7_exit_coherency_flush(louis);
 	/*
 	 * We use the cpu jumping argument register to sync with
 	 * imx_cpu_kill() which is running on cpu0 and waiting for
-- 
2.21.0


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

* Re: [PATCH] ARM: imx: use generic function to exit coherency
  2019-04-10 23:14 [PATCH] ARM: imx: use generic function to exit coherency Stefan Agner
@ 2019-04-16  5:46 ` Shawn Guo
  2019-11-01 21:40   ` Stefan Agner
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn Guo @ 2019-04-16  5:46 UTC (permalink / raw)
  To: Stefan Agner
  Cc: s.hauer, linux, kernel, festevam, linux-imx, linux-arm-kernel,
	linux-kernel

On Thu, Apr 11, 2019 at 01:14:12AM +0200, Stefan Agner wrote:
> The common ARM architecture code provides a generic function to exit
> coherency called v7_exit_coherency_flush(). Replace the machine
> specific implementation using the generic function.
> 
> Tested on a i.MX 6Dual by hotplugging the secondary CPU under load
> through sysfs several 1000 times.
> 
> Tested-by: Stefan Agner <stefan@agner.ch>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Applied, thanks.

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

* Re: [PATCH] ARM: imx: use generic function to exit coherency
  2019-04-16  5:46 ` Shawn Guo
@ 2019-11-01 21:40   ` Stefan Agner
  2019-11-04  0:31     ` Shawn Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2019-11-01 21:40 UTC (permalink / raw)
  To: Shawn Guo
  Cc: s.hauer, linux, kernel, festevam, linux-imx, linux-arm-kernel,
	linux-kernel

Hi Shawn,

On 2019-04-16 07:46, Shawn Guo wrote:
> On Thu, Apr 11, 2019 at 01:14:12AM +0200, Stefan Agner wrote:
>> The common ARM architecture code provides a generic function to exit
>> coherency called v7_exit_coherency_flush(). Replace the machine
>> specific implementation using the generic function.
>>
>> Tested on a i.MX 6Dual by hotplugging the secondary CPU under load
>> through sysfs several 1000 times.
>>
>> Tested-by: Stefan Agner <stefan@agner.ch>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
> 
> Applied, thanks.

It seems like this patch never made it upstream. Any specific reason?

--
Stefan

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

* Re: [PATCH] ARM: imx: use generic function to exit coherency
  2019-11-01 21:40   ` Stefan Agner
@ 2019-11-04  0:31     ` Shawn Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2019-11-04  0:31 UTC (permalink / raw)
  To: Stefan Agner
  Cc: s.hauer, linux, kernel, festevam, linux-imx, linux-arm-kernel,
	linux-kernel

On Fri, Nov 01, 2019 at 10:40:46PM +0100, Stefan Agner wrote:
> Hi Shawn,
> 
> On 2019-04-16 07:46, Shawn Guo wrote:
> > On Thu, Apr 11, 2019 at 01:14:12AM +0200, Stefan Agner wrote:
> >> The common ARM architecture code provides a generic function to exit
> >> coherency called v7_exit_coherency_flush(). Replace the machine
> >> specific implementation using the generic function.
> >>
> >> Tested on a i.MX 6Dual by hotplugging the secondary CPU under load
> >> through sysfs several 1000 times.
> >>
> >> Tested-by: Stefan Agner <stefan@agner.ch>
> >> Signed-off-by: Stefan Agner <stefan@agner.ch>
> > 
> > Applied, thanks.
> 
> It seems like this patch never made it upstream. Any specific reason?

It got lost due to some accident on my side.  I'm sorry for that.  I
will send it for the coming merge window.

Shawn

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

end of thread, other threads:[~2019-11-04  0:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 23:14 [PATCH] ARM: imx: use generic function to exit coherency Stefan Agner
2019-04-16  5:46 ` Shawn Guo
2019-11-01 21:40   ` Stefan Agner
2019-11-04  0:31     ` Shawn Guo

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