From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97349C54EE9 for ; Sun, 25 Sep 2022 15:40:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EAB5584B1B; Sun, 25 Sep 2022 17:40:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="yW93g+H8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Z/MEVso9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB5F684A7A; Sun, 25 Sep 2022 10:28:36 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4D4AE8457B for ; Sun, 25 Sep 2022 10:28:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D0F3A1FD46; Sun, 25 Sep 2022 08:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664094513; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Eow8xUEMDUE6FQbbJUMhWi1sEuwn2YpWrhy9GRfVGxU=; b=yW93g+H83adqvHkkFvIpVpMynU+ouYUSCAO+Xuk3m827IeXZ4CV9H5oNB/HtfAAs9iVJEQ WvB8cyINeQH8KNHj712K/0lAqRZupnUlwCperL89kVZw7NDbLTJOqLG2RUyxuGlQKOCruR epr3y3IqEN612GkxVC8LznFKVnR4JcE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664094513; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Eow8xUEMDUE6FQbbJUMhWi1sEuwn2YpWrhy9GRfVGxU=; b=Z/MEVso9HfzuVMjtXNXpgh7d3denWZys6cB5I1mH8oIyQRoqDpGRRJ39pMzpL7T3g37W4x kf5i7Cd6DCRuC0Cg== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 970D42C175; Sun, 25 Sep 2022 08:28:30 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Bin Meng , Andrew Scull , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= , "Maciej W. Rozycki" , Vladimir Oltean , Heinrich Schuchardt , Simon Glass , AKASHI Takahiro , Vabhav Sharma , Sean Anderson , Ovidiu Panait , Michal Simek , =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= , Lukasz Majewski , Marek Vasut , Loic Poulain , Jason Liu , Anatolij Gustschin , Heiko Schocher , Maxime Ripard , Eugen Hristev , Alexander Dahl , Samuel Dionne-Riel , Patrick Delaunay , Vyacheslav Bocharov , Diego Rondini , Peng Fan , Jaehoon Chung , Matthias Brugger , Liviu Dudau , Patrice Chotard , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Sean Anderson , Andy Shevchenko , Mark Kettenis , Peter Robinson , Tom Warren , uboot-stm32@st-md-mailman.stormreply.com (moderated list:ARM STM STM32MP), Samuel Holland , Andrew Jeffery , Eddie James , Tomas Hlavacek , =?UTF-8?q?Viktor=20K=C5=99iv=C3=A1k?= , Pavel Herrmann Subject: [PATCH v4 00/21] Do not stop uclass iteration on error Date: Sun, 25 Sep 2022 10:27:53 +0200 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 25 Sep 2022 17:40:40 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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