[PATCH v4 00/21] Do not stop uclass iteration on error

Michal Suchanek msuchanek at suse.de
Sun Sep 25 10:27:53 CEST 2022


Hello,

this patch series fixes the simple uclass iterators to be usable for
iterating uclasses even if some devices fail to probe.

Before this series when a probe error happens an error is returned
without any device pointer, and iteration cannot continue to devices
that happen to be after the failing device in the uclass list.

This is rarely expected, nor clearly documented, and for the most part
not useful in any way.

The first four patches are independent fixes, the remaining until the
last remove problematic iterator use.

All but the last are new in v4.

Thanks

Michal

Michal Suchanek (21):
  dm: pci: Fix doc typo first -> next
  dm: core: Add note about device_probe idempotence
  dm: core: Document return value of device bind functions
  dm: blk: Add probe in blk_first_device/blk_next_device
  dm: core: Fix uclass_probe_all to really probe all devices
  dm: treewide: Do not opencode uclass_probe_all()
  dm: pci: Fix device PCI iteration
  bootstd: Fix listing boot devices
  usb: ether: Fix error handling in usb_ether_init
  stdio: Fix class iteration in stdio_add_devices()
  video: ipuv3: Fix error handling when getting the display
  w1: Fix bus counting in w1_get_bus
  w1: Clean up device iteration in w1_bus_find_dev
  dma: Eliminate unused variable in dma_get_cfg()
  cmd: List all uclass devices regardless of probe error
  dm: treewide: Use uclass_first_device_err when accessing one device
  dm: treewide: Use uclass_next_device_err when accessing second device
  dm: blk: Do not use uclass_next_device_err
  dm: treewide: Do not use the return value of simple uclass iterator
  dm: core: Switch uclass_*_device_err to use uclass_*_device_check
  dm: core: Do not stop uclass iteration on error

 arch/arm/mach-k3/j721s2_init.c            |  2 +-
 arch/arm/mach-omap2/am33xx/board.c        |  4 +-
 arch/x86/cpu/broadwell/cpu.c              |  4 +-
 arch/x86/cpu/intel_common/cpu.c           |  4 +-
 arch/x86/lib/pinctrl_ich6.c               |  4 +-
 board/atmel/common/mac_eeprom.c           |  2 +-
 board/intel/cougarcanyon2/cougarcanyon2.c |  4 +-
 boot/bootdev-uclass.c                     |  7 +--
 cmd/adc.c                                 | 22 ++++----
 cmd/demo.c                                | 16 +++---
 cmd/gpio.c                                | 15 ++++--
 cmd/pmic.c                                | 15 +++---
 cmd/regulator.c                           | 13 ++---
 cmd/virtio.c                              |  9 ++--
 common/stdio.c                            | 33 +++++-------
 drivers/block/blk-uclass.c                | 62 ++++++++++-------------
 drivers/core/uclass.c                     | 56 ++++++++++----------
 drivers/cpu/cpu-uclass.c                  | 20 ++------
 drivers/dma/dma-uclass.c                  |  7 ++-
 drivers/gpio/gpio-uclass.c                | 14 +++--
 drivers/mmc/omap_hsmmc.c                  |  2 +-
 drivers/pci/pci-uclass.c                  | 19 ++-----
 drivers/serial/serial-uclass.c            |  2 +-
 drivers/serial/serial_bcm283x_mu.c        |  2 +-
 drivers/serial/serial_bcm283x_pl011.c     |  2 +-
 drivers/sysreset/sysreset_ast.c           |  2 +-
 drivers/usb/gadget/ether.c                | 11 ++--
 drivers/video/exynos/exynos_fb.c          | 24 ++++-----
 drivers/video/imx/mxc_ipuv3_fb.c          |  9 ++--
 drivers/video/mali_dp.c                   |  2 +-
 drivers/video/stm32/stm32_dsi.c           |  6 ++-
 drivers/video/tegra124/dp.c               |  7 +--
 drivers/virtio/virtio-uclass.c            | 15 +-----
 drivers/w1/w1-uclass.c                    | 29 +++++------
 include/dm/device-internal.h              |  4 +-
 include/dm/lists.h                        |  2 +
 include/dm/uclass.h                       | 35 +++++++------
 include/pci.h                             |  2 +-
 lib/acpi/acpi_table.c                     |  2 +-
 lib/efi_loader/efi_gop.c                  |  2 +-
 net/eth-uclass.c                          |  6 ++-
 test/boot/bootmeth.c                      |  2 +-
 test/dm/acpi.c                            | 14 ++---
 test/dm/core.c                            | 27 +++-------
 test/dm/devres.c                          |  4 +-
 test/dm/i2c.c                             |  8 +--
 test/dm/test-fdt.c                        | 27 +++++++---
 test/dm/virtio_device.c                   |  8 +--
 test/dm/virtio_rng.c                      |  2 +-
 test/fuzz/cmd_fuzz.c                      |  2 +-
 test/fuzz/virtio.c                        |  2 +-
 test/test-main.c                          | 11 +---
 52 files changed, 275 insertions(+), 330 deletions(-)

-- 
2.37.3



More information about the U-Boot mailing list