You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/12/11 06:49:13 UTC

[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

masayuki2009 opened a new pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517


   ## Summary
   
   - This commit introduces SP_WFE() and SP_SEV() to be used for spinlock
   - Also, use wfe/sev instructions for ARMV7-A to reduce power consumption
   
   ## Impact
   
   - ARMV7-a SMP only
   
   ## Testing
   
   - sabre-6quad:smp (QEMU, dev board)
   - maix-bit:smp, esp32-devkitc:smp, spresense:smp sim:smp (compile only)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540774339



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       > > why not always define SP_WFE/SP_SEV instead like SP_DSB/SP_DMB?
   > 
   > Because some processors (e.g. cxd56xx) do not support the instructions.
   
   More specifically, cxd56xx supports the wfe instruction but does not work with the sev instruction.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540805791



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV

Review comment:
       change to ARM_HAVE_WFE_SEV




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540845173



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV
+	bool
+	default y
+	depends on ARCH_ARMV7A && SMP

Review comment:
       OK.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540787596



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       If so, why not move the define to arch/armv7-a/spinlock.h?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540789772



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       > If so, why not move the define to arch/armv7-a/spinlock.h?
   
   Because LC823450 (dual Cortex-M3) supports the instructions. (not tested yet but described in the document)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540821191



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV

Review comment:
       OK
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540840327



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV
+	bool
+	default y
+	depends on ARCH_ARMV7A && SMP

Review comment:
       since WFE/SEV isn't optional feature on ARMV7A, I think it's fine to put 'select ARM_HAVE_WFE_SEV' in ARCH_ARMV7A. For old ARM arch and armv6-m, we may need put the selection to the chip level. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540771664



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       > why not always define SP_WFE/SP_SEV instead like SP_DSB/SP_DMB?
   
   Because some processors (e.g. cxd56xx) do not support the instructions.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540805534



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV
+	bool
+	default y
+	depends on ARCH_ARMV7A && SMP

Review comment:
       it's better to let ARCH_ARMV7A select ARM_WFE_SEV like ARM_HAVE_MPU_UNIFIED




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540806076



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       Ok




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#issuecomment-743113388


   @xiaoxiang781216 
   I've just pushed with -f.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540817299



##########
File path: arch/arm/Kconfig
##########
@@ -789,6 +789,13 @@ config ARM_THUMB
 	default n
 	depends on ARCH_ARMV7A
 
+config ARM_WFE_SEV
+	bool
+	default y
+	depends on ARCH_ARMV7A && SMP

Review comment:
       Should we add 'select ARM_HAVE_WFE_SEV' to ARCH_CHIP_IMX6 instead of ARCH_ARMV7A?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540766144



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       why not always define SP_WFE/SP_SEV instead?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2517: spinlock: Introduce SP_WFE() and SP_SEV()

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2517:
URL: https://github.com/apache/incubator-nuttx/pull/2517#discussion_r540766144



##########
File path: arch/arm/include/spinlock.h
##########
@@ -95,6 +95,11 @@
 #define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory")
 #define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory")
 
+#ifdef CONFIG_ARM_WFE_SEV

Review comment:
       why not always define SP_WFE/SP_SEV instead like SP_DSB/SP_DMB?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org