Skip to content

drivers/pinctrl, drivers/clk: Add debug output levels. - #19864

Merged
xiaoxiang781216 merged 2 commits into
apache:masterfrom
Fishwaldo:upstream-debug-levels
Aug 16, 2026
Merged

drivers/pinctrl, drivers/clk: Add debug output levels.#19864
xiaoxiang781216 merged 2 commits into
apache:masterfrom
Fishwaldo:upstream-debug-levels

Conversation

@Fishwaldo

Copy link
Copy Markdown
Contributor

Summary

Neither the pinctrl nor the clock framework has debug output of its own, so a
provider reporting a pad it could not configure, or a clock it could not
register, has to reach for the bare _err() and _info() macros. Those are
gated only by DEBUG_ERROR and DEBUG_INFO, so their output cannot be turned
off without silencing every subsystem that has not been given its own level.

This adds CONFIG_DEBUG_PINCTRL and CONFIG_DEBUG_CLK, each with the usual
three levels, and the matching pinctrlerr()/pinctrlwarn()/pinctrlinfo()
and clkerr()/clkwarn()/clkinfo() macros. Both follow the shape of the
DEBUG_RESET block they sit beside, and both are placed next to it in
Kconfig and in include/nuttx/debug.h.

One commit each, so either can be taken on its own.

Impact

None until something uses them. Nothing selects the new symbols, they default
to n, and each depends on its subsystem being enabled, so the build is
unchanged for every existing configuration. Additions only: no existing line is
modified.

Testing

sim:nsh configured with CLK, PINCTRL, DEBUG_CLK, DEBUG_PINCTRL and
both _INFO levels enabled: kconfig parses, all six symbols appear in the
resulting .config, and the image builds.

CONFIG_DEBUG_PINCTRL=y
CONFIG_DEBUG_PINCTRL_INFO=y
CONFIG_DEBUG_CLK=y
CONFIG_DEBUG_CLK_INFO=y

Also built with the symbols left at their defaults, which is a no-op change.

The pinctrl framework has no debug output of its own, so a provider
reporting a pad it could not configure has to reach for the bare _err()
and _info() macros.  Those are gated only by DEBUG_ERROR and DEBUG_INFO,
so the output cannot be turned off without silencing every subsystem that
has not been given its own level.

Add CONFIG_DEBUG_PINCTRL with the usual three levels and the matching
pinctrlerr(), pinctrlwarn() and pinctrlinfo() macros, in the same shape as
the reset ones above them.

Nothing selects these, so the build is unchanged until a provider starts
using them.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
The clock framework has no debug output of its own, so a provider
reporting a clock it could not register, or a tree it wants to dump at
startup, has to reach for the bare _err() and _info() macros.  Those are
gated only by DEBUG_ERROR and DEBUG_INFO, so the output cannot be turned
off without silencing every subsystem that has not been given its own
level.

Add CONFIG_DEBUG_CLK with the usual three levels and the matching
clkerr(), clkwarn() and clkinfo() macros, alongside the pinctrl ones in
the previous commit and for the same reason.

Nothing selects these, so the build is unchanged until a provider starts
using them.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
@github-actions github-actions Bot added Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Aug 16, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

hifive1-revb

@Fishwaldo

Copy link
Copy Markdown
Contributor Author

(FYI, Another PR coming soon that utilizes these logging functions)

@xiaoxiang781216
xiaoxiang781216 merged commit e9567a7 into apache:master Aug 16, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants