[BUG] imxrt:lpi2c kconfig and source code discrepancy #13114
Labels
Arch: arm
Issues related to ARM (32-bit) architecture
Area: Kconfig
Kconfig issues
OS: Linux
Issues related to Linux (building system, etc)
Type: Bug
Something isn't working
Description / Steps to reproduce the issue
The imxrt's kconfig provides configs for I2C transaction timeouts:
The compile-time configuration logic is performed in these lines of
imcrt_lpi2c.c
. At the end of this code block, assuming you're not using dynamic timeouts,CONFIG_IMXRT_LPI2C_TIMEOTICKS
will be the value the driver uses for timeouts (whether it uses the value set by the user in a defconfig/kconfig or it's manually computed from the supplied seconds and ms)Issue 1
Assuming the top-level I2C config is enabled and
IMXRT_LPI2C_DYNTIMEO
is not set, these are always defined and given default values in the kconfig. If you want to define timeouts in terms of s and ms instead of ticks, then the lines on 86 - 90 should handle that, but in reality they don't and are dead code because CONFIG_IMXRT_LPI2C_TIMEOTICKS is always defined (since it has a default value).Solution: Remove the default value of
IMXRT_LPI2C_TIMEOTICKS
from the kconfigSolution Impact on Users: When users upgrade to the latest nuttx, if users never explicitly set this value in a
defconfig
, then the defaults values ofIMXRT_LPI2C_TIMEOSEC
andIMXRT_LPI2C_TIMEOMS
will be used instead, which may not result in the same number of timeout ticks as beforeIssue 2
IMXRT_LPI2C_DYNTIMEO_STARTSTOP isn't really used in the file. It's value is just set to a value in the config block on lines 92 - 95 and never used again.
Solution: Remove this from the kconfig and from the source file
Solution Impact on Users: none, except a compile-time failure because of a missing config option if they were explicitly setting it in a
defconfig
On which OS does this issue occur?
[Linux]
What is the version of your OS?
Ubuntu 22.04
NuttX Version
master
Issue Architecture
[arm]
Issue Area
[Kconfig]
Verification
The text was updated successfully, but these errors were encountered: