Skip to content

Conversation

@henrikbrixandersen
Copy link
Member

@henrikbrixandersen henrikbrixandersen commented Dec 5, 2025

Currently, quite a few CAN controller drivers define Kconfig symbols with identical names (e.g. CONFIG_CAN_MAX_FILTER) but the ranges and defaults of these symbols differ between drivers, causing clashes and misconfigurations when multiple drivers are enabled concurrently.

Rename these driver-specific Kconfig symbols to use proper namespacing and increase their defaults where needed to support typical software needs and in-tree samples.

This problem became evident with the reshuffling of the Kconfig.* include order in 30950b8.

Copy link
Member

@martinjaeger martinjaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the Kconfig is changed anyway, should it not be plural? _MAX_FILTERS

Use proper namespace for the CAN loopback driver Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_LOOPBACK_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN native_linux driver Kconfig symbols,
renaming CONFIG_CAN_MAX_FILTER to CONFIG_CAN_NATIVE_LINUX_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN sja1000 Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_SJA1000_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN mcp2515 Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_MCP2515_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN max32 Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_MAX32_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN mcp251xfd Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_MCP251XFD_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the MCUX FlexCAN Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS and
CONFIG_CAN_MAX_MB to CONFIG_CAN_MCUX_FLEXCAN_MAX_MB.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the STM32 bxCAN Kconfig symbols, renaming
CONFIG_CAN_MAX_STD_ID_FILTER to CONFIG_CAN_STM32_BXCAN_MAX_STD_ID_FILTERS
and CONFIG_CAN_MAX_EXT_ID_FILTER to
CONFIG_CAN_STM32_BXCAN_MAX_EXT_ID_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the STM32 FDCAN Kconfig symbols, renaming
CONFIG_CAN_MAX_STD_ID_FILTER to CONFIG_CAN_STM32_FDCAN_MAX_STD_ID_FILTERS
and CONFIG_CAN_MAX_EXT_ID_FILTER to
CONFIG_CAN_STM32_FDCAN_MAX_EXT_ID_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Use proper namespace for the CAN xmc4xxx Kconfig symbols, renaming
CONFIG_CAN_MAX_FILTER to CONFIG_CAN_XMC4XXX_MAX_FILTERS.

This prevents Kconfig symbol clashes between different CAN controller
drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Rename Kconfig option CONFIG_CAN_RCAR_MAX_FILTER to
CONFIG_CAN_RCAR_MAX_FILTERS to match remaining CAN driver Kconfig option
naming.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Increase the default number of software-limited CAN RX filters across the
drivers. Some of these were chosen quite conservative, requiring custom
configuration for even simple in-tree samples.

Users can reduce the number of available RX filters to reduce RAM footprint
as needed.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
@henrikbrixandersen
Copy link
Member Author

Now that the Kconfig is changed anyway, should it not be plural? _MAX_FILTERS

Thanks! Yes, good idea - I've changed it.

Remove setting of CONFIG_CAN_MAX_FILTER and rely on driver defaults.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Mention the CAN controller driver Kconfig namespace changes in the
migration guide.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants