From: Simon Glass <sjg@chromium.org>
To: Michal Suchanek <msuchanek@suse.de>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
"Sean Anderson" <seanga2@gmail.com>, "Stefan Roese" <sr@denx.de>,
"Vabhav Sharma" <vabhav.sharma@nxp.com>,
"Bin Meng" <bmeng.cn@gmail.com>,
"Ovidiu Panait" <ovpanait@gmail.com>,
"Michal Simek" <michal.simek@amd.com>,
"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
"Andrew Scull" <ascull@google.com>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>,
"Pali Rohár" <pali@kernel.org>,
"Pierre-Clément Tosi" <ptosi@google.com>,
"Lukasz Majewski" <lukma@denx.de>, "Marek Vasut" <marex@denx.de>,
"Jason Liu" <jason.hui.liu@nxp.com>,
"Loic Poulain" <loic.poulain@linaro.org>,
"Anatolij Gustschin" <agust@denx.de>,
"Heiko Schocher" <hs@denx.de>,
"Maxime Ripard" <maxime.ripard@free-electrons.com>,
"Eugen Hristev" <eugen.hristev@microchip.com>,
"Samuel Dionne-Riel" <samuel@dionne-riel.com>,
"Vyacheslav Bocharov" <adeep@lexina.in>,
"Diego Rondini" <diego.rondini@kynetics.com>,
"Peng Fan" <peng.fan@nxp.com>,
"Jaehoon Chung" <jh80.chung@samsung.com>,
"Matthias Brugger" <mbrugger@suse.com>,
"Liviu Dudau" <liviu.dudau@foss.arm.com>,
"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Joe Hershberger" <joe.hershberger@ni.com>,
"Ramon Fried" <rfried.dev@gmail.com>,
"Sean Anderson" <sean.anderson@seco.com>,
"Mark Kettenis" <kettenis@openbsd.org>,
"Peter Robinson" <pbrobinson@gmail.com>,
"Tom Warren" <twarren@nvidia.com>,
"moderated list:ARM STM STM32MP"
<uboot-stm32@st-md-mailman.stormreply.com>,
"AKASHI Takahiro" <takahiro.akashi@linaro.org>,
"Alexander Dahl" <ada@thorsis.com>,
"Samuel Holland" <samuel@sholland.org>,
"Eddie James" <eajames@linux.ibm.com>,
"Andrew Jeffery" <andrew@aj.id.au>,
"Tomas Hlavacek" <tmshlvck@gmail.com>,
"Viktor Křivák" <viktor.krivak@gmail.com>,
"Pavel Herrmann" <morpheus.ibis@gmail.com>
Subject: Re: [PATCH v5 00/15] Do not stop uclass iteration on error
Date: Thu, 29 Sep 2022 04:00:55 -0600 [thread overview]
Message-ID: <CAPnjgZ22op9HKiz6FX_GZcwHoQHWXy3Cnjw9rKoJAuxeN0kFRw@mail.gmail.com> (raw)
In-Reply-To: <cover.1664314042.git.msuchanek@suse.de>
Hi Michal,
On Tue, 27 Sept 2022 at 15:38, Michal Suchanek <msuchanek@suse.de> wrote:
>
> 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.
Thank you for taking this on. It has been bugging me for about 6
years. It is not an easy task and you have dug in and carefully looked
at each situation and how to fix it.
Regards,
Simon
>
> 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.
>
> Thanks
>
> Michal
>
> Michal Suchanek (15):
> 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
> dm: core: Switch uclass_*_device_err to use uclass_*_device_check
> 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/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 | 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/sysinfo/sysinfo-uclass.c | 10 +++-
> 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/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 | 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 +----
> 50 files changed, 269 insertions(+), 313 deletions(-)
>
> --
> 2.37.3
>
next prev parent reply other threads:[~2022-09-29 11:39 UTC|newest]
Thread overview: 133+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 17:59 [PATCH] dm: core: Do not stop uclass iteration on error Michal Suchanek
2022-08-04 19:22 ` Simon Glass
2022-08-04 19:36 ` Michal Suchánek
2022-08-04 20:30 ` Simon Glass
2022-08-17 8:27 ` [PATCH v2] " Michal Suchanek
2022-08-18 17:49 ` Simon Glass
2022-08-18 19:46 ` Michal Suchánek
2022-08-19 20:23 ` [PATCH v3] " Michal Suchanek
2022-08-28 1:52 ` Simon Glass
2022-08-30 10:23 ` Michal Suchánek
2022-08-30 15:56 ` Simon Glass
2022-08-30 16:48 ` Michal Suchánek
2022-08-31 3:15 ` Simon Glass
2022-08-31 7:39 ` Michal Suchánek
2022-08-31 17:44 ` Simon Glass
2022-09-17 15:02 ` Simon Glass
2022-09-17 17:04 ` Michal Suchánek
2022-09-24 20:09 ` Michal Suchánek
2022-09-25 14:15 ` Simon Glass
2022-09-25 16:38 ` Michal Suchánek
2022-09-25 8:27 ` [PATCH v4 00/21] " Michal Suchanek
2022-09-25 8:27 ` [PATCH v4 01/21] dm: pci: Fix doc typo first -> next Michal Suchanek
2022-09-29 9:59 ` Simon Glass
2022-10-22 1:06 ` Simon Glass
2022-09-25 8:27 ` [PATCH v4 02/21] dm: core: Add note about device_probe idempotence Michal Suchanek
2022-09-29 9:59 ` Simon Glass
2022-09-25 8:27 ` [PATCH v4 03/21] dm: core: Document return value of device bind functions Michal Suchanek
2022-09-29 9:59 ` Simon Glass
2022-09-25 8:27 ` [PATCH v4 04/21] dm: blk: Add probe in blk_first_device/blk_next_device Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-10-02 19:34 ` Michal Suchánek
2022-10-03 1:10 ` Simon Glass
2022-10-10 19:49 ` Michal Suchánek
2022-10-10 21:33 ` Michal Suchánek
2022-10-10 22:33 ` Simon Glass
2022-11-10 2:15 ` Simon Glass
2022-09-25 8:27 ` [PATCH v4 05/21] dm: core: Fix uclass_probe_all to really probe all devices Michal Suchanek
2022-09-25 8:27 ` [PATCH v4 06/21] dm: treewide: Do not opencode uclass_probe_all() Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 07/21] dm: pci: Fix device PCI iteration Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 08/21] bootstd: Fix listing boot devices Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 09/21] usb: ether: Fix error handling in usb_ether_init Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-25 8:28 ` [PATCH v4 10/21] stdio: Fix class iteration in stdio_add_devices() Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 11/21] video: ipuv3: Fix error handling when getting the display Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 12/21] w1: Fix bus counting in w1_get_bus Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 13/21] w1: Clean up device iteration in w1_bus_find_dev Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-25 8:28 ` [PATCH v4 14/21] dma: Eliminate unused variable in dma_get_cfg() Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-25 8:28 ` [PATCH v4 15/21] cmd: List all uclass devices regardless of probe error Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 16/21] dm: treewide: Use uclass_first_device_err when accessing one device Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 17/21] dm: treewide: Use uclass_next_device_err when accessing second device Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 18/21] dm: blk: Do not use uclass_next_device_err Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 19/21] dm: treewide: Do not use the return value of simple uclass iterator Michal Suchanek
2022-09-25 8:28 ` [PATCH v4 20/21] dm: core: Switch uclass_*_device_err to use uclass_*_device_check Michal Suchanek
2022-09-25 11:08 ` [PATCH] fixup: " Michal Suchanek
2022-09-29 10:00 ` [PATCH v4 20/21] " Simon Glass
2022-09-25 8:28 ` [PATCH v4 21/21] dm: core: Do not stop uclass iteration on error Michal Suchanek
2022-09-27 21:37 ` [PATCH v5 00/15] " Michal Suchanek
2022-09-27 21:37 ` [PATCH v5 01/15] dm: core: Fix uclass_probe_all to really probe all devices Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:37 ` [PATCH v5 02/15] dm: treewide: Do not opencode uclass_probe_all() Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:37 ` [PATCH v5 03/15] dm: pci: Fix device PCI iteration Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:37 ` [PATCH v5 04/15] bootstd: Fix listing boot devices Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-10-02 19:19 ` Michal Suchánek
2022-09-27 21:37 ` [PATCH v5 05/15] usb: ether: Fix error handling in usb_ether_init Michal Suchanek
2022-09-27 21:37 ` [PATCH v5 06/15] stdio: Fix class iteration in stdio_add_devices() Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:37 ` [PATCH v5 07/15] video: ipuv3: Fix error handling when getting the display Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 08/15] w1: Fix bus counting in w1_get_bus Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 09/15] cmd: List all uclass devices regardless of probe error Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-10-02 19:10 ` Michal Suchánek
2022-10-03 1:10 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 10/15] dm: treewide: Use uclass_first_device_err when accessing one device Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 11/15] dm: treewide: Use uclass_next_device_err when accessing second device Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 12/15] dm: blk: Do not use uclass_next_device_err Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 13/15] dm: core: Switch uclass_*_device_err to use uclass_*_device_check Michal Suchanek
2022-09-27 21:38 ` [PATCH v5 14/15] dm: treewide: Do not use the return value of simple uclass iterator Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-27 21:38 ` [PATCH v5 15/15] dm: core: Do not stop uclass iteration on error Michal Suchanek
2022-09-29 10:00 ` Simon Glass
2022-09-29 10:00 ` Simon Glass [this message]
2022-10-12 19:57 ` [PATCH v6 00/20] " Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 01/20] dm: core: Fix uclass_probe_all to really probe all devices Michal Suchanek
2022-10-12 22:14 ` Simon Glass
2022-10-17 21:29 ` Simon Glass
2022-10-12 19:57 ` [PATCH v6 02/20] dm: treewide: Do not opencode uclass_probe_all() Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 03/20] dm: pci: Fix device PCI iteration Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 04/20] bootstd: Fix listing boot devices Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 06/20] stdio: Fix class iteration in stdio_add_devices() Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 07/20] video: ipuv3: Fix error handling when getting the display Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 08/20] w1: Fix bus counting in w1_get_bus Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 09/20] cmd: List all uclass devices regardless of probe error Michal Suchanek
2022-10-12 19:57 ` [PATCH v6 10/20] dm: treewide: Use uclass_first_device_err when accessing one device Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 11/20] dm: treewide: Use uclass_next_device_err when accessing second device Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 12/20] dm: blk: Do not use uclass_next_device_err Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 13/20] net: eth-uclass: Do not set device on error Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 14/20] dm: pci: Update error handling in pci_sriov_init Michal Suchanek
2022-10-12 22:14 ` Simon Glass
2022-10-12 19:58 ` [PATCH v6 15/20] mpc83xx: gazerbeam: Update sysinfo_get error handling Michal Suchanek
2022-10-12 22:14 ` Simon Glass
2022-10-17 21:29 ` Simon Glass
2022-10-12 19:58 ` [PATCH v6 16/20] dm: core: Switch uclass_foreach_dev_probe to use simple iterator Michal Suchanek
2022-10-12 22:14 ` Simon Glass
2022-10-17 21:29 ` Simon Glass
2022-10-12 19:58 ` [PATCH v6 17/20] dm: core: Switch uclass_*_device_err to use uclass_*_device_check Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 18/20] dm: core: Non-activated device may be returned from uclass iterators that provide error handling Michal Suchanek
2022-10-12 22:14 ` Simon Glass
2022-10-12 19:58 ` [PATCH v6 19/20] dm: treewide: Do not use the return value of simple uclass iterator Michal Suchanek
2022-10-12 19:58 ` [PATCH v6 20/20] dm: core: Do not stop uclass iteration on error Michal Suchanek
2022-10-17 21:29 ` [PATCH v6 17/20] dm: core: Switch uclass_*_device_err to use uclass_*_device_check Simon Glass
2022-10-17 21:29 ` [PATCH v6 13/20] net: eth-uclass: Do not set device on error Simon Glass
2022-10-17 21:29 ` [PATCH v6 12/20] dm: blk: Do not use uclass_next_device_err Simon Glass
2022-10-17 21:29 ` [PATCH v6 11/20] dm: treewide: Use uclass_next_device_err when accessing second device Simon Glass
2022-10-17 21:29 ` [PATCH v6 10/20] dm: treewide: Use uclass_first_device_err when accessing one device Simon Glass
2022-10-17 21:29 ` [PATCH v6 09/20] cmd: List all uclass devices regardless of probe error Simon Glass
2022-10-17 21:29 ` [PATCH v6 07/20] video: ipuv3: Fix error handling when getting the display Simon Glass
2022-10-17 21:29 ` [PATCH v6 08/20] w1: Fix bus counting in w1_get_bus Simon Glass
2022-10-17 21:29 ` [PATCH v6 06/20] stdio: Fix class iteration in stdio_add_devices() Simon Glass
2022-10-17 21:29 ` [PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init Simon Glass
2022-10-17 21:29 ` [PATCH v6 04/20] bootstd: Fix listing boot devices Simon Glass
2022-10-17 21:29 ` [PATCH v6 03/20] dm: pci: Fix device PCI iteration Simon Glass
2022-10-17 21:29 ` [PATCH v6 02/20] dm: treewide: Do not opencode uclass_probe_all() Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPnjgZ22op9HKiz6FX_GZcwHoQHWXy3Cnjw9rKoJAuxeN0kFRw@mail.gmail.com \
--to=sjg@chromium.org \
--cc=ada@thorsis.com \
--cc=adeep@lexina.in \
--cc=agust@denx.de \
--cc=andrew@aj.id.au \
--cc=ascull@google.com \
--cc=bmeng.cn@gmail.com \
--cc=diego.rondini@kynetics.com \
--cc=eajames@linux.ibm.com \
--cc=eugen.hristev@microchip.com \
--cc=hs@denx.de \
--cc=ilias.apalodimas@linaro.org \
--cc=jason.hui.liu@nxp.com \
--cc=jh80.chung@samsung.com \
--cc=joe.hershberger@ni.com \
--cc=kettenis@openbsd.org \
--cc=liviu.dudau@foss.arm.com \
--cc=loic.poulain@linaro.org \
--cc=lukma@denx.de \
--cc=marex@denx.de \
--cc=maxime.ripard@free-electrons.com \
--cc=mbrugger@suse.com \
--cc=michal.simek@amd.com \
--cc=morpheus.ibis@gmail.com \
--cc=msuchanek@suse.de \
--cc=ovpanait@gmail.com \
--cc=pali@kernel.org \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=pbrobinson@gmail.com \
--cc=peng.fan@nxp.com \
--cc=ptosi@google.com \
--cc=rfried.dev@gmail.com \
--cc=samuel@dionne-riel.com \
--cc=samuel@sholland.org \
--cc=sean.anderson@seco.com \
--cc=seanga2@gmail.com \
--cc=sr@denx.de \
--cc=takahiro.akashi@linaro.org \
--cc=tmshlvck@gmail.com \
--cc=twarren@nvidia.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.com \
--cc=vabhav.sharma@nxp.com \
--cc=viktor.krivak@gmail.com \
--cc=vladimir.oltean@nxp.com \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).