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 27ABBC433F5 for ; Fri, 22 Apr 2022 23:07:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6079283CDF; Sat, 23 Apr 2022 01:07:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650668844; bh=TacTofZ558m2ni3fk1atNO5fC7X9ZhiD5dh3MA4AlD4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=b5qNWPF5TVuDprd8Ipq7QL7knew70uqKVqu/S4pl8hiRJwCjMZ5kXjy6+6k14cC1b e/XD4Ts5dCcDJZPOki8hwcs8pJLo5HAbKpMRsogIqA45P+sN/RcjwFVQekpYoxVRHt PiVgt46AbukKrAOl2oKc2Y+PDN1DHDYRivuv/o5n0iJYVzZv+A7lebwLjsmvDSiTjM u4g/gwtSHa4wmbZkRqo303PKD0rKdlYF6gbb1Xt4U0J7m5m+G5swCRKb+tMoQThbd0 s3UDp1GwwnAKvDhsrkz6zIgnkfW7eeMxblNk6XlrzFs312CbqeypttNs0CR1fR2dlr ruZQ7atrI651g== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id BA16B810E6; Sat, 23 Apr 2022 01:07:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650668842; bh=TacTofZ558m2ni3fk1atNO5fC7X9ZhiD5dh3MA4AlD4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MW+4EgM9fZn+vA6tng3zbwSTXDluqA9aWYd3RsHhOKFSY/2q90Xph740mUZTD8UlD 3C7byS1pMU2S8c5QiDvx3CLPK2IrIy3O7XR7gGi8pRBoUh6SNOWdcPhmWE2Pi+e6jW 6vFMKioCn3K+fbs6/xl2f+0qu66zYkuZ5fCw0T/wV9g/NA80bVg3vE2gqZKbeL+z8h YVxnnznEIGeaXXxDlqXYMpWhxJiDNW57nNY94F8lTR+EUuAR1T7b+y+NtOLCnYqFuX VArBXNcYA+a5nanvv0Y5PQBPRQyQ3X/HdpXruBVYKOv2d/hoEMgmixixHMtjyBrflh A7dj31myBn7Eg== Message-ID: Date: Sat, 23 Apr 2022 01:07:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 1/3] dm: core: Add DM_FLAG_PROBE_AFTER_BIND flag Content-Language: en-US To: Sean Anderson , u-boot@lists.denx.de Cc: Patrice Chotard , Patrick Delaunay , Simon Glass , Steven Lawrance References: <20220422131555.123598-1-marex@denx.de> <768910e4-b324-9956-4035-50798e0a3d74@denx.de> <45ab9552-34ed-6d18-c99b-6287d0c54c3a@gmail.com> From: Marek Vasut In-Reply-To: <45ab9552-34ed-6d18-c99b-6287d0c54c3a@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 4/23/22 00:45, Sean Anderson wrote: > On 4/22/22 9:52 AM, Marek Vasut wrote: >> On 4/22/22 15:49, Sean Anderson wrote: >>> On 4/22/22 9:15 AM, Marek Vasut wrote: >>>> Introduce DM_FLAG_PROBE_AFTER_BIND flag, which can be set by driver or >>>> uclass in .bind(), to indicate such driver instance should be probe()d >>>> once binding of all devices is complete. >>>> >>>> This is useful in case the driver determines that hardware >>>> initialization >>>> is mandatory on boot, and such initialization happens only in probe(). >>>> This also solves the inability to call device_probe() from .bind(). >>> >>> So why not add an init_leds function to init_sequence_r? >> >> Because this flag is generic solution and not hack specific to LEDs. > > Isn't init_sequence_r the generic solution? No, init_sequence_r is just a list of functions that gets called early on during boot to bring U-Boot up. One of the functions is initr_dm(), DM init, which brings up the driver model. The init_sequence_r has nothing to do with driver binding or probing though, that's the DM job. > Every device gets probed that way (or directly as a result of a command). No device probe gets triggered via init_sequence_r. There are many ad-hoc device_probe() calls in the various init_sequence_r function implementation, but that's all there because there is no better way to implement that within the DM framework so far. Now there is, with this flag, so those workarounds can also be cleaned up.