[PATCH 1/1] dm: fix misleading messages

Simon Glass sjg at chromium.org
Sat Nov 4 23:57:39 CET 2023


Hi Heinrich,

On Sat, 4 Nov 2023 at 20:00, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> On 11/4/23 21:45, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Sat, 4 Nov 2023 at 18:47, Heinrich Schuchardt
> > <heinrich.schuchardt at canonical.com> wrote:
> >>
> >> When no RNG device exists for a driver referenced via U_BOOT_DRVINFO() we
> >> get messages like:
> >>
> >>      No match for driver 'arm-rndr'
> >>      Some drivers were not found
> >>
> >> This is misleading as it is not the driver that was not found, it is the
> >> device that is not found. Correct the messages.
> >>
> >> Reported-by: Andre Przywara <andre.przywara at arm.com>
> >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> >> ---
> >>   drivers/core/lists.c | 2 +-
> >>   drivers/core/root.c  | 2 +-
> >>   2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> >> index 8034a8f48d..e39d3acc97 100644
> >> --- a/drivers/core/lists.c
> >> +++ b/drivers/core/lists.c
> >> @@ -97,7 +97,7 @@ static int bind_drivers_pass(struct udevice *parent, bool pre_reloc_only)
> >>                          if (CONFIG_IS_ENABLED(OF_PLATDATA))
> >>                                  drt->dev = dev;
> >>                  } else if (ret != -EPERM) {
> >> -                       dm_warn("No match for driver '%s'\n", entry->name);
> >> +                       dm_warn("No device for driver '%s'\n", entry->name);
> >
> > This should be "No match for driver_info"
> >
> > It is not a device
> >
> >>                          if (!result || ret != -ENOENT)
> >>                                  result = ret;
> >>                  }
> >> diff --git a/drivers/core/root.c b/drivers/core/root.c
> >> index d4ae652bcf..29c918eb73 100644
> >> --- a/drivers/core/root.c
> >> +++ b/drivers/core/root.c
> >> @@ -167,7 +167,7 @@ int dm_scan_plat(bool pre_reloc_only)
> >>
> >>          ret = lists_bind_drivers(DM_ROOT_NON_CONST, pre_reloc_only);
> >>          if (ret == -ENOENT) {
> >> -               dm_warn("Some drivers were not found\n");
> >> +               dm_warn("Some devices were not found\n");
> >
> > Some driver_infos were not found
>
> This suggestion does not match the case that Andre and I were discussing in
>
> https://lore.kernel.org/u-boot/1ad4bd2c-e667-42b6-b637-8816a6c60d94@canonical.com/T/#m13fbf9011d74f713080284fb9963c90646d527fb
>
> U_BOOT_DRVINFO(cpu_arm_rndr) is triggering the arm-rndr driver's bind
> method. The bind method returns -ENOENT if there is no matching device.
>
> Neither the driver U_BOOT_DRIVER(arm_rndr) nor the driver info
> U_BOOT_DRVINFO(cpu_arm_rndr) is missing. It is the non-existence of a
> matching device that triggers the messages.

There are various errors which can be returned.

Then perhaps for that specific -ENOENT code you could indicate that
the device was matched but refused to bind? We just need to avoid
confusing language, although of course what is there is confusing too.

As mentioned to Andrew, we should not be using DRVINFO records outside SPL.


>
> Best regards
>
> Heinrich
>
> >
> > They are not devices
> >
> >>                  ret = 0;
> >>          }
> >>
> >> --
> >> 2.40.1
> >>
> >
> > Also please add a Fixes tag, I think for this:
> >
> > 20e442ab2df dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO()
> >
> > Regards,
> > Simon
>


More information about the U-Boot mailing list