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 30CC4C433EF for ; Fri, 22 Apr 2022 13:44:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DC7681DCD; Fri, 22 Apr 2022 15:44:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="E9Js5IoJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AFE481CA4; Fri, 22 Apr 2022 15:44:47 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E4A598209D for ; Fri, 22 Apr 2022 15:44:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=011196f9c1=patrice.chotard@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23M9dscc031810; Fri, 22 Apr 2022 15:44:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=L1wnWyNeqv41ZtebRJFy3L2vd5Kq27ErjpEBkQByVfs=; b=E9Js5IoJJhUKQguScCED4e52wLr7G3MqfwP3y7grRuQdqYa8i6Az4aBYpeWIwvhS1Mf1 HM0NnCND75tQQYuUV+se1ercDGvH3Rr8+Q4r5nJu1j9RUzESil68z6UISuD5i6TDIgt8 ffSkvrkrPCo7iIkHFKrLBa88preT89OntjgQ7qQkKBWCgDcDEPQHZZuf7e3MMoZ4f1JN XKH+72BUdwTJKajK6u9ueGByUZYM+hHwzpI76yfwDYZQaQJSSdOt7auk3EdKCMsQF8dE M1jF6P9VRmNxVFqDB34epJcZHABgQkz8vY1WErmOCR6MCdMILMXa/qI0PIJLHs1MT/6n PQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3ffpqh97hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Apr 2022 15:44:43 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 935B1100034; Fri, 22 Apr 2022 15:44:41 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 8CC5622177B; Fri, 22 Apr 2022 15:44:41 +0200 (CEST) Received: from [10.201.21.201] (10.75.127.45) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Fri, 22 Apr 2022 15:44:41 +0200 Message-ID: <5528e402-2794-cbcd-ea33-671549d46482@foss.st.com> Date: Fri, 22 Apr 2022 15:44:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 2/3] led: Mark device instance with DM_FLAG_PROBE_AFTER_BIND Content-Language: en-US To: Marek Vasut , CC: Patrick Delaunay , Sean Anderson , Simon Glass , Steven Lawrance References: <20220422131555.123598-1-marex@denx.de> <20220422131555.123598-2-marex@denx.de> From: Patrice CHOTARD In-Reply-To: <20220422131555.123598-2-marex@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-22_03,2022-04-22_01,2022-02-23_01 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 Hi Marek On 4/22/22 15:15, Marek Vasut wrote: > Calling device_probe() from uclass .post_bind() callback has all kinds > of odd side-effects, e.g. device instances not being available just yet. > Make use of the DM_FLAG_PROBE_AFTER_BIND instead, mark device instances > which need to be probe()d in order to configure the LED default state > with this flag and let the DM core do the device_probe() at the right > time instead. > > Fixes: 72675b063b6 ("led: Configure LED default-state on boot") > Signed-off-by: Marek Vasut > Cc: Patrice Chotard > Cc: Patrick Delaunay > Cc: Sean Anderson > Cc: Simon Glass > Cc: Steven Lawrance > --- > drivers/led/led-uclass.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c > index 5d7bf40896b..2ce72933b6c 100644 > --- a/drivers/led/led-uclass.c > +++ b/drivers/led/led-uclass.c > @@ -98,7 +98,9 @@ static int led_post_bind(struct udevice *dev) > * In case the LED has default-state DT property, trigger > * probe() to configure its default state during startup. > */ > - return device_probe(dev); > + dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND); > + > + return 0; > } > > static int led_post_probe(struct udevice *dev) Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Tested on stm32mp157c-dk2 board Thanks Patrice