On Mon, Aug 24, 2026 at 10:44:15AM +0200, Julien Stephan wrote:

> While writing a MISC driver, I forgot to enable CONFIG_MISC. The only thing
> I got at boot was the following obscure error, with no hint about the root
> cause:
> 
>   initcall_run_r(): initcall initr_dm() failed
>   ### ERROR ### Please RESET the board ###
> 
> Commit 3346c87625b8 ("dm: Improve handling of a missing uclass") already
> tried to improve this case by returning a strange error code and adding a
> debug message. But since neither the debug message nor the return code are
> displayed by default, it was not very helpful in practice.
> 
> This series improves the situation in a few ways:
>  - a new dm_err() helper logs driver model errors at ERROR level, and the
>    boolean DM_WARN option becomes a per-stage log verbosity choice
>    (DM_NONE / DM_ERR / DM_WARN) with errors emitted by default. Note that
>    a disabled level is not removed entirely but degraded to DEBUG level,
>    which is compiled out by default, so even DM_NONE can still emit these
>    messages as debug output when debug logging is enabled;
>  - the missing-uclass message now uses dm_err(), so it shows up by default,
>    with a shorter string to limit the code-size overhead;
>  - the initcall failure now prints the actual error code (and its string
>    when ERRNO_STR is enabled), for both INITCALL() and INITCALL_EVT().
> 
> The existing DM_DEBUG option is left as-is for now: it works differently
> (it adds -DDEBUG to drivers/core/ via the Makefile and is not phase-aware).
> Unifying it into the new choice, along with converting the DM core debug()
> statements to log() as suggested in the "To Do" section of
> doc/develop/logging.rst, could be a follow-up series.

There are two issues here. One issue is that tests need to be adjusted,
as CI fails:
https://git.u-boot-project.org/u-boot/u-boot/-/jobs/83678
for example.
The second issue is that am335x_evm overflows in SPL due to size growth.
I am currently seeing if we can enable LTO on that family now, or if it
still has a run time problem. If the latter, then defaulting to
SPL_DM_ERR_NONE might be how that has to be handled.

For re-testing this in CI, please feel free to use a WIP branch or
something in the mediatek tree, or just a tree under your own username.
Thanks.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to