Skip to content

Do not stop uclass iteration on error

Michal Suchanek u-boot 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest20 patches 21 repliesIn review
  2. v515 patches 17 repliesSuperseded
  3. v421 patches 15 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v31 patch12 repliesSuperseded
v21 patch2 repliesSuperseded
v11 patch3 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20dm: core: Fix uclass_probe_all to really probe all devicesdrivers/core/uclass.c test/dm/test-fdt.c+20 -112 replies
2/20dm: treewide: Do not opencode uclass_probe_all()drivers/cpu/cpu-uclass.c drivers/virtio/virtio-uclass.c test/dm/core.c +1 more+9 -541 reply
3/20dm: pci: Fix device PCI iterationdrivers/pci/pci-uclass.c+2 -21 reply
4/20bootstd: Fix listing boot devicesboot/bootdev-uclass.c+2 -21 reply
5/20usb: ether: Fix error handling in usb_ether_initdrivers/usb/gadget/ether.c+5 -61 reply
6/20stdio: Fix class iteration in stdio_add_devices()common/stdio.c+13 -191 reply
7/20video: ipuv3: Fix error handling when getting the displaydrivers/video/imx/mxc_ipuv3_fb.c+4 -51 reply
8/20w1: Fix bus counting in w1_get_busdrivers/w1/w1-uclass.c+11 -91 reply
9/20cmd: List all uclass devices regardless of probe errorcmd/adc.c cmd/demo.c cmd/gpio.c +2 more+43 -351 reply
10/20dm: treewide: Use uclass_first_device_err when accessing one devicearch/arm/mach-omap2/am33xx/board.c arch/x86/cpu/broadwell/cpu.c arch/x86/cpu/intel_common/cpu.c +22 more+43 -591 reply
11/20dm: treewide: Use uclass_next_device_err when accessing second devicearch/arm/mach-k3/j721s2_init.c board/atmel/common/mac_eeprom.c+2 -21 reply
12/20dm: blk: Do not use uclass_next_device_errdrivers/block/blk-uclass.c+6 -101 reply
13/20net: eth-uclass: Do not set device on errornet/eth-uclass.c+2 -01 reply
14/20dm: pci: Update error handling in pci_sriov_initdrivers/pci/pci-uclass.c+3 -41 reply
15/20mpc83xx: gazerbeam: Update sysinfo_get error handlingboard/gdsys/mpc8308/gazerbeam.c+9 -32 replies
16/20dm: core: Switch uclass_foreach_dev_probe to use simple iteratorinclude/dm/uclass.h+2 -22 replies
17/20dm: core: Switch uclass_*_device_err to use uclass_*_device_checkdrivers/core/uclass.c include/dm/uclass.h+25 -251 reply
18/20dm: core: Non-activated device may be returned from uclass iterators that provide error handlinginclude/dm/uclass.h+8 -41 reply
19/20dm: treewide: Do not use the return value of simple uclass iteratorcmd/virtio.c drivers/dma/dma-uclass.c drivers/gpio/gpio-uclass.c +2 more+17 -370 replies
20/20dm: core: Do not stop uclass iteration on errordrivers/core/uclass.c include/dm/uclass.h test/dm/core.c +1 more+48 -320 replies

Reviews trailers per patch

All 20 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/20R-b R-b
2/20R-b R-b
3/20R-b R-b
4/20R-b R-b
5/20R-b R-b
6/20R-b R-b
7/20R-b R-b
8/20R-b R-b
9/20R-b R-b
10/20R-b R-b
11/20R-b R-b
12/20R-b R-b
13/20R-b R-b
14/20R-b
15/20R-b R-b
16/20R-b R-b
17/20R-b R-b
18/20R-b
19/20R-b
20/20R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 00/20] Do not stop uclass iteration on error

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.

All but the last patch are new in v4 removing problematic iterator use.

v5:

Split off patches that can be applied independently

Fix uclass_foreach_dev_probe, pci_sriov_init, and sysinfo_get to work after the uclass_first_device_err change.

Document that uclass_first_device_err and uclass_first_device_check can return non-activated device on error.

Consolidate multiple similar cleanups into one patch.

v6:

Split off the fixups from uclass_*_device_err switch patch.

Thanks

Michal

Michal Suchanek (20):
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
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
net: eth-uclass: Do not set device on error
dm: pci: Update error handling in pci_sriov_init
mpc83xx: gazerbeam: Update sysinfo_get error handling
dm: core: Switch uclass_foreach_dev_probe to use simple iterator
dm: core: Switch uclass_*_device_err to use uclass_*_device_check
dm: core: Non-activated device may be returned from uclass iterators
that provide error handling
dm: treewide: Do not use the return value of simple uclass iterator
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/gdsys/mpc8308/gazerbeam.c           | 12 +++--
 board/intel/cougarcanyon2/cougarcanyon2.c |  4 +-
 boot/bootdev-uclass.c                     |  4 +-
 cmd/adc.c                                 | 20 ++++----
 cmd/demo.c                                | 15 +++---
 cmd/gpio.c                                | 15 ++++--
 cmd/pmic.c                                | 15 +++---
 cmd/regulator.c                           | 13 +++---
 cmd/virtio.c                              |  9 ++--
 common/stdio.c                            | 32 ++++++-------
 drivers/block/blk-uclass.c                | 16 +++----
 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                  | 26 ++++-------
 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          | 14 ++----
 drivers/video/imx/mxc_ipuv3_fb.c          |  9 ++--
 drivers/video/mali_dp.c                   |  2 +-
 drivers/video/stm32/stm32_dsi.c           |  2 +-
 drivers/video/tegra124/dp.c               |  4 +-
 drivers/virtio/virtio-uclass.c            | 15 +-----
 drivers/w1/w1-uclass.c                    | 29 ++++++------
 include/dm/uclass.h                       | 49 ++++++++++----------
 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                        | 46 ++++++++++++++-----
 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 +----
 50 files changed, 266 insertions(+), 313 deletions(-)
Signature · 1 line
2.37.3