sched/: Remove the option CONFIG_BOARD_INITTHREAD. Now, if CONFIG_BOARD_INITIALIZE is selected, then the board_initialize() logic will ALWAYS run on an internal kernel thread. This will prevent the problems people have had doing inappropriate board_initialization on the IDLE thread.

This commit is contained in:
Gregory Nutt 2019-02-12 19:13:22 -06:00
parent a2406c1ac8
commit 967dc523bb
9 changed files with 6 additions and 80 deletions

View File

@ -155,20 +155,6 @@
# define SDIO_MINOR 0
# endif
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
# if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \
!defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
# undef HAVE_SDIO
# endif
#endif
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED)

View File

@ -155,20 +155,6 @@
# define SDIO_MINOR 0
# endif
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
# if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \
!defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
# undef HAVE_SDIO
# endif
#endif
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED)

View File

@ -115,20 +115,6 @@
# define SDIO_MINOR 0
# endif
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
# if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \
!defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
# undef HAVE_SDIO
# endif
#endif
/* Check if we can support the RTC driver */
#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)

View File

@ -9,7 +9,6 @@ CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU=y
CONFIG_BINFMT_CONSTRUCTORS=y
CONFIG_BOARD_INITIALIZE=y
CONFIG_BOARD_INITTHREAD=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILD_PROTECTED=y
CONFIG_DEV_LOWCONSOLE=y

View File

@ -10,7 +10,6 @@ CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU=y
CONFIG_BOARD_INITIALIZE=y
CONFIG_BOARD_INITTHREAD=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILD_PROTECTED=y
CONFIG_EXAMPLES_MODULE=y

View File

@ -26,7 +26,6 @@ CONFIG_ARCH_TEXT_NPAGES=256
CONFIG_ARCH_TEXT_VBASE=0x80000000
CONFIG_ARMV7A_TOOLCHAIN_CODESOURCERYW=y
CONFIG_BOARD_INITIALIZE=y
CONFIG_BOARD_INITTHREAD=y
CONFIG_BOARD_LOOPSPERMSEC=65775
CONFIG_BOOT_RUNFROMSDRAM=y
CONFIG_BUILD_KERNEL=y

View File

@ -138,19 +138,6 @@
# define SDIO_MINOR 0
# endif
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
# if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARD_INITTHREAD)
# warning "SDIO initialization cannot be perfomed on the IDLE thread"
# undef HAVE_SDIO
# endif
#endif
/* The CS43L22 depends on the CS43L22 driver, I2C1, and I2S3 support */
#if !defined(CONFIG_AUDIO_CS43L22) || !defined(CONFIG_STM32_I2C1) || \

View File

@ -1175,20 +1175,14 @@ config BOARD_INITIALIZE
phase may be used, for example, to initialize board-specific
device drivers.
if BOARD_INITIALIZE
config BOARD_INITTHREAD
bool "Board initialization thread"
default n
---help---
Some initialization operations cannot be performed on the start-up,
initialization thread. That is because the initialization thread
cannot wait for event. If waiting is required as part of the board
initialization then this option must be selected. Waiting may be
required, for example, to mount a file system or or initialize a
device such as an SD card.
cannot wait for event. Waiting may be required, for example, to
mount a file system or or initialize a device such as an SD card.
For this reason, board initialize will run on a temporary, internal
kernel thread.
if BOARD_INITTHREAD
if BOARD_INITIALIZE
config BOARD_INITTHREAD_STACKSIZE
int "Board initialization thread stack size"
@ -1206,7 +1200,6 @@ config BOARD_INITTHREAD_PRIORITY
started until the board initialization is completed. Hence, there
is very little competition for the CPU.
endif # BOARD_INITTHREAD
endif # BOARD_INITIALIZE
config SCHED_STARTHOOK

View File

@ -336,15 +336,13 @@ static inline void nx_start_application(void)
*
****************************************************************************/
#ifdef CONFIG_BOARD_INITTHREAD
static int nx_start_task(int argc, FAR char **argv)
static inline int nx_start_task(int argc, FAR char **argv)
{
/* Do the board/application initialization and exit */
nx_start_application();
return OK;
}
#endif
/****************************************************************************
* Name: nx_create_initthread
@ -365,7 +363,6 @@ static int nx_start_task(int argc, FAR char **argv)
static inline void nx_create_initthread(void)
{
#ifdef CONFIG_BOARD_INITTHREAD
int pid;
/* Do the board/application initialization on a separate thread of
@ -377,12 +374,6 @@ static inline void nx_create_initthread(void)
(main_t)nx_start_task, (FAR char * const *)NULL);
DEBUGASSERT(pid > 0);
UNUSED(pid);
#else
/* Do the board/application initialization on this thread of execution. */
nx_start_application();
#endif
}
/****************************************************************************