-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
drivers: i2c: stm32: don't manage cache aside DMA support #87681
Conversation
@sgilbert182, could you have a look at this change. Some build currently fail on STM32 I2C driver and seem related to #81814. |
Will do, give me an hour or so |
428261f
to
1b75010
Compare
For info, my patch was not accurate enough. I've updated it. |
By the way, @JarmouniA, looking at other STM32 drivers, I saw some other equivalent potential issues in drivers/adc/adc_stm32.c, drivers/spi/spi_ll_stm32.c and drivers/serial/uart_stm32.c that are hidden by the fact |
1b75010
to
2125015
Compare
Comment addressed. |
I don't know if that's really problematic for the time being, since AFAIK STM32 targets that have DCache support (mainly CM7) in Zephyr also have an ARM MPU & it's enabled at the board level.
Maybe, to avoid potential issues later down the road. |
@erwango, may I ask your feedback on this change? It's needed to fix issues currently reported by CI tests on various P-Rs. |
FYI I've created #87757. |
2125015
to
1c2e93a
Compare
Fix STM32 I2C driver to not call cache management related functions when DMA is not used. This change fixes an issue introduced by commit 42c3a78 ("i2c: stm32: Add cache memory support"). The issue makes boards embedding this driver with both CONFIG_I2C_STM32_V2_DMA and CONFIG_ARCH_MPU disabled to fail to build with an error trace message like the below: .../i2c_ll_stm32_v2.c:701: undefined reference to `mem_attr_check_buf' Fixes: 42c3a78 Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
1c2e93a
to
cda1cdd
Compare
As discussed above, I restricted this P-R to a change in driver source file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Update PR title and description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hotfix!
Commit 42c3a78 ("i2c: stm32: Add cache memory support") introduced a call to mem_attr_check_buf() in STM32 I2C driver i2c_ll_stm32_v2.c without adding the config dependency on CONFIG_MEM_ATTR needed. Fix STM32 I2C Kconfig accordingly.By the way, select CONFIG_CACHE_MANAGEMENT and CONFIG_MEM_ATTR upon CONFIG_DCACHE=y instead of CONFIG_CPU_HAS_DCACHE to better relate to how STM32 I2C driver is implemented.(edited)
Fix STM32 I2C driver to not call cache management related functions when DMA is not used. This change fixes an issue introduced by commit 42c3a78 ("i2c: stm32: Add cache memory support"). The issue makes boards embedding this driver with both
CONFIG_I2C_STM32_V2_DMA
andCONFIG_ARCH_MPU
disabled to fail to build with an error trace message like the below:Fixes: 42c3a78