You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/02/06 06:50:14 UTC
[incubator-nuttx] branch master updated: boards, include,
sched: Remove CONFIG_SPINLOCK_IRQ
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new ad2e854 boards, include, sched: Remove CONFIG_SPINLOCK_IRQ
ad2e854 is described below
commit ad2e85433ad1237b1900c0554ab291e15d13e25b
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Sat Feb 6 09:31:18 2021 +0900
boards, include, sched: Remove CONFIG_SPINLOCK_IRQ
Summary:
- This commit removes CONFIG_SPINLOCK_IRQ to avoid complexity
Impact:
- None
Testing:
- Tested with the following configs
- spresense:wifi, spresense:smp
- esp32-devkitc:smp (QEMU), sabre-6quad:smp (QEMU)
- maix-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi
---
boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig | 1 -
boards/arm/cxd56xx/spresense/configs/smp/defconfig | 1 -
boards/arm/cxd56xx/spresense/configs/wifi_smp/defconfig | 1 -
boards/arm/imx6/sabre-6quad/configs/smp/defconfig | 1 -
boards/arm/lc823450/lc823450-xgevk/configs/audio/defconfig | 1 -
boards/arm/lc823450/lc823450-xgevk/configs/nsh/defconfig | 1 -
boards/arm/lc823450/lc823450-xgevk/configs/rndis/defconfig | 1 -
boards/arm/lc823450/lc823450-xgevk/configs/usb/defconfig | 1 -
boards/risc-v/k210/maix-bit/configs/smp/defconfig | 1 -
boards/xtensa/esp32/esp32-devkitc/configs/smp/defconfig | 1 -
include/nuttx/irq.h | 12 ++++++------
sched/Kconfig | 7 -------
sched/irq/Make.defs | 2 --
sched/irq/irq_spinlock.c | 12 ++++++------
14 files changed, 12 insertions(+), 31 deletions(-)
diff --git a/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig b/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig
index ca48c5b..81e2986 100644
--- a/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig
+++ b/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig
@@ -132,7 +132,6 @@ CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_SPRESENSE_EXTENSION=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=16
diff --git a/boards/arm/cxd56xx/spresense/configs/smp/defconfig b/boards/arm/cxd56xx/spresense/configs/smp/defconfig
index a80d370..0b037ef 100644
--- a/boards/arm/cxd56xx/spresense/configs/smp/defconfig
+++ b/boards/arm/cxd56xx/spresense/configs/smp/defconfig
@@ -49,7 +49,6 @@ CONFIG_SDCLONE_DISABLE=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10
CONFIG_START_YEAR=2019
diff --git a/boards/arm/cxd56xx/spresense/configs/wifi_smp/defconfig b/boards/arm/cxd56xx/spresense/configs/wifi_smp/defconfig
index 3f133b6..d7337ba 100644
--- a/boards/arm/cxd56xx/spresense/configs/wifi_smp/defconfig
+++ b/boards/arm/cxd56xx/spresense/configs/wifi_smp/defconfig
@@ -148,7 +148,6 @@ CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
-CONFIG_SPINLOCK_IRQ=y
CONFIG_SPRESENSE_EXTENSION=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=16
diff --git a/boards/arm/imx6/sabre-6quad/configs/smp/defconfig b/boards/arm/imx6/sabre-6quad/configs/smp/defconfig
index 5f2ee1a..0b0f4b6 100644
--- a/boards/arm/imx6/sabre-6quad/configs/smp/defconfig
+++ b/boards/arm/imx6/sabre-6quad/configs/smp/defconfig
@@ -57,7 +57,6 @@ CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SMP=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_STACK_COLORATION=y
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2016
diff --git a/boards/arm/lc823450/lc823450-xgevk/configs/audio/defconfig b/boards/arm/lc823450/lc823450-xgevk/configs/audio/defconfig
index b799be0..3a6d942 100644
--- a/boards/arm/lc823450/lc823450-xgevk/configs/audio/defconfig
+++ b/boards/arm/lc823450/lc823450-xgevk/configs/audio/defconfig
@@ -117,7 +117,6 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10
CONFIG_START_YEAR=2013
diff --git a/boards/arm/lc823450/lc823450-xgevk/configs/nsh/defconfig b/boards/arm/lc823450/lc823450-xgevk/configs/nsh/defconfig
index 7ccbeaf..191269d 100644
--- a/boards/arm/lc823450/lc823450-xgevk/configs/nsh/defconfig
+++ b/boards/arm/lc823450/lc823450-xgevk/configs/nsh/defconfig
@@ -113,7 +113,6 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10
CONFIG_START_YEAR=2013
diff --git a/boards/arm/lc823450/lc823450-xgevk/configs/rndis/defconfig b/boards/arm/lc823450/lc823450-xgevk/configs/rndis/defconfig
index 22992a1..8733604 100644
--- a/boards/arm/lc823450/lc823450-xgevk/configs/rndis/defconfig
+++ b/boards/arm/lc823450/lc823450-xgevk/configs/rndis/defconfig
@@ -165,7 +165,6 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10
diff --git a/boards/arm/lc823450/lc823450-xgevk/configs/usb/defconfig b/boards/arm/lc823450/lc823450-xgevk/configs/usb/defconfig
index 15007f2..ddc88c8 100644
--- a/boards/arm/lc823450/lc823450-xgevk/configs/usb/defconfig
+++ b/boards/arm/lc823450/lc823450-xgevk/configs/usb/defconfig
@@ -116,7 +116,6 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10
CONFIG_START_YEAR=2013
diff --git a/boards/risc-v/k210/maix-bit/configs/smp/defconfig b/boards/risc-v/k210/maix-bit/configs/smp/defconfig
index 002b757..d48d7fa 100644
--- a/boards/risc-v/k210/maix-bit/configs/smp/defconfig
+++ b/boards/risc-v/k210/maix-bit/configs/smp/defconfig
@@ -50,7 +50,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
-CONFIG_SPINLOCK_IRQ=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=8
CONFIG_START_YEAR=2020
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/smp/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/smp/defconfig
index fa28eb7..0359527 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/smp/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/smp/defconfig
@@ -46,7 +46,6 @@ CONFIG_SMP=y
CONFIG_SMP_IDLETHREAD_STACKSIZE=3072
CONFIG_SMP_NCPUS=2
CONFIG_SPI=y
-CONFIG_SPINLOCK_IRQ=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
diff --git a/include/nuttx/irq.h b/include/nuttx/irq.h
index 70787b7..22ff1af 100644
--- a/include/nuttx/irq.h
+++ b/include/nuttx/irq.h
@@ -273,7 +273,7 @@ void leave_critical_section(irqstate_t flags);
* Name: spin_lock_irqsave
*
* Description:
- * If SMP and SPINLOCK_IRQ are enabled:
+ * If SMP is are enabled:
* Disable local interrupts and take the global spinlock (g_irq_spin)
* if the call counter (g_irq_spin_count[cpu]) equals to 0. Then the
* counter on the CPU is increment to allow nested call.
@@ -282,7 +282,7 @@ void leave_critical_section(irqstate_t flags);
* or internal data structure) in SMP mode. But do not use this API
* with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
*
- * If SMP and SPINLOCK_IRQ are not enabled:
+ * If SMP is not enabled:
* This function is equivalent to enter_critical_section().
*
* Input Parameters:
@@ -294,7 +294,7 @@ void leave_critical_section(irqstate_t flags);
*
****************************************************************************/
-#if defined(CONFIG_SMP) && defined(CONFIG_SPINLOCK_IRQ)
+#if defined(CONFIG_SMP)
irqstate_t spin_lock_irqsave(void);
#else
# define spin_lock_irqsave() enter_critical_section()
@@ -304,13 +304,13 @@ irqstate_t spin_lock_irqsave(void);
* Name: spin_unlock_irqrestore
*
* Description:
- * If SMP and SPINLOCK_IRQ are enabled:
+ * If SMP is enabled:
* Decrement the call counter (g_irq_spin_count[cpu]) and if it
* decrements to zero then release the spinlock (g_irq_spin) and
* restore the interrupt state as it was prior to the previous call to
* spin_lock_irqsave().
*
- * If SMP and SPINLOCK_IRQ are not enabled:
+ * If SMP is not enabled:
* This function is equivalent to leave_critical_section().
*
* Input Parameters:
@@ -322,7 +322,7 @@ irqstate_t spin_lock_irqsave(void);
*
****************************************************************************/
-#if defined(CONFIG_SMP) && defined(CONFIG_SPINLOCK_IRQ)
+#if defined(CONFIG_SMP)
void spin_unlock_irqrestore(irqstate_t flags);
#else
# define spin_unlock_irqrestore(f) leave_critical_section(f)
diff --git a/sched/Kconfig b/sched/Kconfig
index 777d1e1..f80897e 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -240,13 +240,6 @@ config SPINLOCK
CONFIG_ARCH_HAVE_MULTICPU. This permits the use of spinlocks in
other novel architectures.
-config SPINLOCK_IRQ
- bool "Support Spinlocks with IRQ control"
- default n
- ---help---
- Enables support for spinlocks with IRQ control. This feature can be
- used to protect data in SMP mode.
-
config IRQCHAIN
bool "Enable multi handler sharing a IRQ"
default n
diff --git a/sched/irq/Make.defs b/sched/irq/Make.defs
index f83e88c..c0a2249 100644
--- a/sched/irq/Make.defs
+++ b/sched/irq/Make.defs
@@ -36,10 +36,8 @@
CSRCS += irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c
ifeq ($(CONFIG_SMP),y)
-ifeq ($(CONFIG_SPINLOCK_IRQ),y)
CSRCS += irq_spinlock.c
endif
-endif
ifeq ($(CONFIG_IRQCOUNT),y)
CSRCS += irq_csection.c
diff --git a/sched/irq/irq_spinlock.c b/sched/irq/irq_spinlock.c
index 0a9ade5..10b0560 100644
--- a/sched/irq/irq_spinlock.c
+++ b/sched/irq/irq_spinlock.c
@@ -30,7 +30,7 @@
#include "sched/sched.h"
-#if defined(CONFIG_SMP) && defined (CONFIG_SPINLOCK_IRQ)
+#if defined(CONFIG_SMP)
/****************************************************************************
* Public Data
@@ -52,7 +52,7 @@ static volatile uint8_t g_irq_spin_count[CONFIG_SMP_NCPUS];
* Name: spin_lock_irqsave
*
* Description:
- * If SMP and SPINLOCK_IRQ are enabled:
+ * If SMP is enabled:
* Disable local interrupts and take the global spinlock (g_irq_spin)
* if the call counter (g_irq_spin_count[cpu]) equals to 0. Then the
* counter on the CPU is increment to allow nested call.
@@ -61,7 +61,7 @@ static volatile uint8_t g_irq_spin_count[CONFIG_SMP_NCPUS];
* or internal data structure) in SMP mode. But do not use this API
* with kernel APIs which suspend a caller thread. (e.g. nxsem_wait)
*
- * If SMP and SPINLOCK_IRQ are not enabled:
+ * If SMP is not enabled:
* This function is equivalent to enter_critical_section().
*
* Input Parameters:
@@ -93,13 +93,13 @@ irqstate_t spin_lock_irqsave(void)
* Name: spin_unlock_irqrestore
*
* Description:
- * If SMP and SPINLOCK_IRQ are enabled:
+ * If SMP is enabled:
* Decrement the call counter (g_irq_spin_count[cpu]) and if it
* decrements to zero then release the spinlock (g_irq_spin) and
* restore the interrupt state as it was prior to the previous call to
* spin_lock_irqsave().
*
- * If SMP and SPINLOCK_IRQ are not enabled:
+ * If SMP is not enabled:
* This function is equivalent to leave_critical_section().
*
* Input Parameters:
@@ -126,4 +126,4 @@ void spin_unlock_irqrestore(irqstate_t flags)
up_irq_restore(flags);
}
-#endif /* CONFIG_SMP && CONFIG_SPINLOCK_IRQ */
+#endif /* CONFIG_SMP */