diff --git a/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig b/boards/arm/cxd56xx/spresense/configs/rndis_smp/defconfig index ca48c5bb8f4..81e29865fbd 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 a80d370a047..0b037ef5c0f 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 3f133b6f6e5..d7337ba5d08 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 5f2ee1a10de..0b0f4b65e7d 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 b799be07618..3a6d9422a88 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 7ccbeaf3b9d..191269d60dc 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 22992a1ff96..87336043344 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 15007f26749..ddc88c8a7a5 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 002b7578a9f..d48d7fa0eea 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 fa28eb78030..0359527522b 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 70787b75517..22ff1aff18e 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 777d1e1d2b2..f80897e6bda 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 f83e88cef25..c0a22491391 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 0a9ade54daa..10b0560cdc4 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 */