[U-Boot] [PATCH] dm: core: don't fail to iterate if first one fails to probe

Simon Glass sjg at chromium.org
Thu Jul 13 19:10:01 UTC 2017


Hi Rob,

On 21 June 2017 at 04:52, Rob Clark <robdclark at gmail.com> wrote:
> On Wed, Jun 21, 2017 at 6:23 AM, Peter Robinson <pbrobinson at gmail.com> wrote:
>> On Tue, Jun 20, 2017 at 10:49 PM, Rob Clark <robdclark at gmail.com> wrote:
>>> efi_disk_register() would try to iterate all the blk devices.  But if
>>> the first one in the list failed to probe, uclass_first_device() would
>>> return NULL and no attempt would be made to register the remaining
>>> devices.  Also uclass_next_device() needs the same fix.
>>
>> This looks related/similar to the "efi_loader: disk: iterate only over
>> valid block devices" patch [1]
>>
>
> hmm, I don't see uclass_first_device_check() which I guess must be
> part of another in-flight patch?  I don't mind too much *how* we fix
> it, as long as it works.  (Although it seems more sensible to just
> make uclass_first_device()/etc dtrt rather than introducing another
> function that actually works properly.. but that is only my $0.02)

That patch is now in mainline. It was delayed for a release as I did
not get any reviews and so wasn't sure if it was needed.

I believe the common case is wanting to stop on error, since it means
something is wrong. The case of continuing onto another device when
the first one fails is unusual. We should always check return codes
and return errors when something is wrong.

I believe this case is happening because the device is removable and
therefore returns an error. Is that right? If so then we should return
a single error, such as -ENOMEDIUM so that the caller can ignore that
error, or consider it OK.

In general, though, errors should not be ignored.

Regards,
Simon

[...]


More information about the U-Boot mailing list