-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post DT API migration review #25251
Comments
#24745 is related and really should be addressed before release too. That involves assessing board defconfigs vs devicetree |
@erwango arm/infineon_xmc/ can be marked as done. Couldn't tick/edit myself. |
For potential pinmux conflicts please see #24745 (comment) which identifies these boards as potentially using the same pin for multiple peripherals (only the boards are identified here; use the referenced script to see the specific pins and roles)
Example of script output:
|
Pinmux conflicts on STM32 based boards with updated script in #24745
|
The pinctrl-0 was introduced for Atmel SAM (not SAM0). It allowed us to remove dts_fixup and soc_pinmap files. In this case, problems can happen only with SAM0 variations that have pinmux.c file. Should this to be applied on all boards///pínmux*.c files to avoid exceptions? I was wondering if there are exceptions, can we identify at review phase the possibles conflicts. |
@erwango I don't think I see anything that needs to change for ti_simplelink, so marking done. |
@nashif @MaureenHelm @ioannisg @anangl @jhedberg could you please check your respective platforms so we can close this soon? |
Describe the bug
Following move to new DT API (#25009 and cie), a systematic code review is needed around impacted code.
First reason is that a lot of code has been changed using scripts which is a usual source of bugs. Most of the time, lot of files where impacted, which is not easy to review, and hence some bugs have been merged (https://github.com/zephyrproject-rtos/zephyr/blame/master/boards/arm/atsamd21_xpro/pinmux.c#L23 -- fixed by #25252)
Second reason is that peripheral instances Kconfig symbols replacement by DT macros is not transparent in all areas. In a driver compiled under
CONFIG_SPI
control,CONFIG_SPI_1
is equivalent toDT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(spi1))
, but this is not valid in other areas.Under
boards/
orsoc/
, every piece of code underDT_HAS_NODE_STATUS_OKAY(spi1)
is compiled in, whatever the status ofCONFIG_SPI
. So SPI related pins or clocks are activated unconditionally. Since this is the case for all peripherals (SPI, CAN, I2C, ...) this could potentially lead to, among others:instances that used to be disabled in Kconfig but DT enables them by default, causing conflicts (eg. with shields).Covered separately by Mitigate changes in peripheral enable state after Kconfig replaced by DT status #24745.These two cases are typically tricky to detect, and since current code coverage is not sufficient to guarantee all potential bugs introduced will be detected.
So it is safer to systematically review each change and in case of doubt re-introduce a peripheral Kconfig control on newly introduced instance dt macros:
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(spi1)) && CONFIG_SPI
Expected behavior
No bugs where introduced following move to new DTS API
Impact
Wide spectrum of bugs in v2.3.0
Actions
I propose that each codeowner reviews, in his own area (boards/, soc/, ..) code impacted by new introduced DT macros (DT_HAS_NODE_STATUS_OKAY, DT_NODE_HAS_COMPAT_STATUS, ATMEL_SAM0_DT_SERCOM_CHECK, ..) and take appropriate actions.
In order to make this a task that can be completed in a finite amount of time, I've giving putting here
the various soc maintainers based on CODEOWNERS. I let people tick their area when they consider things are ok (don't hesitate to rework this list if required).
Check
boards/
andsoc/
for each of the hardware variants below:Add a dependency to the subsystem Kconfig variable if it was present previously:
#if DT_NODE_UART... && CONFIG_UART
EDIT: Following #25214,
DT_HAS_NODE_STATUS_OKAY(spi1)
is being replaced byDT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay)
EDIT: Adding x86 (@andrewboie )
The text was updated successfully, but these errors were encountered: