-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Description
Describe the bug
After setting CONFIG_SHELL_BACKEND_TELNET=y inside prj.conf, the previous working network related procedure will be stuck at waiting for the interface to come up. The related logs are shown below:
When CONFIG_SHELL_BACKEND_TELNET=y is setting, net_config_init_by_iface will be blocked at init.c line 434 because no NET_EVENT_IF_UP is caught and therefore waiter is never released(init.c L358). This really blocked my project because we want to have the telnet feature.
My prj.conf is here:
# Disable multithreading
CONFIG_MULTITHREADING=y
# No timer support in the kernel
CONFIG_SYS_CLOCK_EXISTS=y
# Optimize drivers and peripherals
CONFIG_PINCTRL=y
CONFIG_GPIO=y
# Optimize boot
CONFIG_BOOT_BANNER=y
CONFIG_BOOT_DELAY=0
# Optimize console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_THREAD_MONITOR=y
CONFIG_INIT_STACKS=y
CONFIG_THREAD_NAME=y
# Configure logging
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=4096
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_BACKEND_SHOW_COLOR=n # not all terminals support colors
# SPI support
CONFIG_SPI=y
CONFIG_SPI_NXP_LPSPI_DMA=n
# Serial connection
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_POSIX_API=y
# # Networking config
CONFIG_NETWORKING=y
CONFIG_NET_ARP=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_L2_ETHERNET_MGMT=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=n
CONFIG_NET_CONFIG_AUTO_INIT=n
CONFIG_NET_TCP=y
CONFIG_NET_UDP=y
# Network driver config
CONFIG_TEST_RANDOM_GENERATOR=y
# Network address config
CONFIG_NET_CONFIG_SETTINGS=y
# Network socket support
CONFIG_NET_SOCKETS_PACKET=y
# Activate shell module that provides network commands like ping to the console.
# Note: This is must, otherwise you can't ping and TCP connects to the device
CONFIG_NET_SHELL=y
# Other configs needed
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=4
CONFIG_NET_LOG=y
CONFIG_SHELL_BACKEND_TELNET=y
BTW, I pass 30 seconds to the parameter timeout of net_config_init_by_iface but the process have been blocked for more than one hour(maybe just block forever). It's this also a bug?
Regression
- This is a regression.
Steps to reproduce
- Setting
CONFIG_SHELL_BACKEND_TELNET=yin prj.conf - west build -p -b mimxrt1180_evk/mimxrt1189/cm33 {your_app} && west flash -r jlink
- hardcode to find a ethernet device(e.g. switch_port0) and its corresponding struct net_if *iface
- call net_config_init_by_iface
Relevant log output
# no CONFIG_SHELL_BACKEND_TELNET
*** Booting Zephyr OS build v4.2.0 ***
[00:00:00.084,000] <inf> main: Initalizing modules
[00:00:00.084,000] <inf> led: Initializing LED module
[00:00:00.084,000] <inf> led: LED2 not available
[00:00:00.084,000] <inf> led: LED module initialization complete
[00:00:00.084,000] <inf> ethernet: NET_IF_LOWER_UP: 0
[00:00:00.084,000] <inf> ethernet: net if oper state: 2
[00:00:00.084,000] <inf> ethernet: net if up: 1, net if running: 0
[00:00:00.084,000] <inf> net_config: Waiting interface 1 (0x1400112c) to be up...
[00:00:00.304,000] <inf> net_config: Interface 1 (0x1400112c) coming up
[00:00:00.304,000] <inf> ethernet: Ethernet interface with device name port_0 is up with IP: 192.168.1.100
[00:00:00.305,000] <inf> main: Starting application
[00:00:00.306,000] <inf> network: Starting to send raw Ethernet frames...
[00:00:00.307,000] <inf> ethernet: Started packet RX thread
[00:00:00.309,000] <inf> network: Starting to send IPV4 UDP packet through socket...
[00:00:00.310,000] <inf> udp: Starting to receive IPV4 UDP packet through socket...
[00:00:00.310,000] <inf> main: Start-up complete
# setting CONFIG_SHELL_BACKEND_TELNET=y
*** Booting Zephyr OS build v4.2.0 ***
[00:00:00.086,000] <inf> shell_telnet: Telnet shell backend initialized
[00:00:00.086,000] <inf> main: Initalizing modules
[00:00:00.086,000] <inf> led: Initializing LED module
[00:00:00.086,000] <inf> led: LED2 not available
[00:00:00.086,000] <inf> led: LED module initialization complete
[00:00:00.087,000] <inf> ethernet: NET_IF_LOWER_UP: 0
[00:00:00.087,000] <inf> ethernet: net if oper state: 2
[00:00:00.087,000] <inf> ethernet: net if up: 1, net if running: 0
[00:00:00.087,000] <inf> net_config: Waiting interface 1 (0x140011d0) to be up...Impact
Showstopper – Prevents release or major functionality; system unusable.
Environment
- OS: Ubuntu 24.04
- Toolchain: west
- Commit: 413b789
Additional Context
No response