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 620F2C433F5 for ; Sat, 19 Mar 2022 15:18:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 25CD1833ED; Sat, 19 Mar 2022 16:18:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca 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=akkea.ca header.i=@akkea.ca header.b="dKOvGxLs"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="vpdCwlCm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C24BC83689; Sat, 19 Mar 2022 16:18:34 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (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 3B6FB8198F for ; Sat, 19 Mar 2022 16:18:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 185DC4E200C; Sat, 19 Mar 2022 15:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647703109; bh=1hCCXCjtcgmX0/1bbcfG9PrIGczLJcp5nKP82mHQaoU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=dKOvGxLsO7vjHXCPlD5qhXamEpSM89wZqlYXFfjeX38r8dZv5QMiujXtkalIqZLbE gLh5F4XT6Ay7Hx6iGZ1VQDwzeIfBZLmA20vDgBx6xUJQMXM/WjYovJMgzJlPkH6QfM p2p3BdTFM4TTVnb86ykaCiMy3xPuO0PDjs+jSFS4= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IsBDByeU4zdu; Sat, 19 Mar 2022 15:18:28 +0000 (UTC) Received: from www.akkea.ca (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 431C64E2006; Sat, 19 Mar 2022 15:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1647703108; bh=1hCCXCjtcgmX0/1bbcfG9PrIGczLJcp5nKP82mHQaoU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=vpdCwlCmjc13jjwjPk0KMXccgFn/Zv8G7fBGH7vxPEg/nd0OikblUijv19pxseD4a EabZkDebjp2nFZ8nFBy9icXEHthHDtKPoDb5kCWrOUBFkHDevTfPoclJPD3Z3q/2SS 0d1YG2z9nys8qXiLUv6foCUf8aFlVkqMqPKkZsqE= MIME-Version: 1.0 Date: Sat, 19 Mar 2022 08:18:28 -0700 From: Angus Ainslie To: Simon Glass Cc: U-Boot Mailing List , kernel@puri.sm, dl-uboot-imx Subject: Re: [PATCH v2] core: devres: optionally build devres into the SPL In-Reply-To: <9e3e1e33c0eb30165603757b7ea67adf@akkea.ca> References: <20220228203307.206022-1-angus@akkea.ca> <9e3e1e33c0eb30165603757b7ea67adf@akkea.ca> Message-ID: X-Sender: angus@akkea.ca User-Agent: Roundcube Webmail/1.3.17 Content-Type: text/plain; charset=US-ASCII; 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 2022-03-19 07:15, Angus Ainslie wrote: > Hi Simon, > > On 2022-03-18 15:41, Simon Glass wrote: >> Hi Angus, >> >> On Tue, 1 Mar 2022 at 07:58, Simon Glass wrote: >>> >>> On Mon, 28 Feb 2022 at 13:33, Angus Ainslie wrote: >>> > >>> > Add a CONFIG_SPL_DEVRES option >>> > >>> > Signed-off-by: Angus Ainslie >>> > --- >>> > >>> > Changes since v1: >>> > >>> > Instead of gaurding the source add an SPL_DEVRES option >>> > >>> > drivers/core/Kconfig | 13 +++++++++++++ >>> > drivers/core/Makefile | 2 +- >>> > 2 files changed, 14 insertions(+), 1 deletion(-) >> >> Unfortunately this break the tests, e.g. building sandbox_spl - can >> you please take a look? >> >> sandbox_spl: +make O=build-sandbox_spl -s sandbox_spl_defconfig >> +make O=build-sandbox_spl -s -j4 >> /usr/bin/ld: /tmp/ccsYY64W.ltrans0.ltrans.o: in function >> `device_unbind': >> build-sandbox_spl/spl/../../drivers/core/device-remove.c:120: >> undefined reference to `devres_release_all' >> /usr/bin/ld: /tmp/ccsYY64W.ltrans0.ltrans.o: in function >> `device_free': >> build-sandbox_spl/spl/../../drivers/core/device-remove.c:157: >> undefined reference to `devres_release_probe' >> collect2: error: ld returned 1 exit status >> make[3]: *** [../scripts/Makefile.spl:509: spl/u-boot-spl] Error 1 >> make[2]: *** [Makefile:2094: spl/u-boot-spl] Error 2 >> make[1]: *** [Makefile:177: sub-make] Error 2 >> Exit code: 2 >> > > So the problem here is that CONFIG_DM_DEVICE_REMOVE can be defined > without CONFIG_DEVRES being defined. > > Is there a way to make DM_DEVICE_REMOVE dependant on DEVRES or do I > need to add "&& CONFIG_IS_ENABLED(DEVRES)" everywhere that I find > "CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)" ? > The test failure can be "fixed" using this diff --git a/configs/sandbox_noinst_defconfig b/configs/sandbox_noinst_defconfig index ec912cf0ec8..69c97921744 100644 --- a/configs/sandbox_noinst_defconfig +++ b/configs/sandbox_noinst_defconfig @@ -105,6 +105,7 @@ CONFIG_SYSCON=y CONFIG_SPL_SYSCON=y CONFIG_DEVRES=y CONFIG_DEBUG_DEVRES=y +CONFIG_SPL_DEVRES=y # CONFIG_SPL_SIMPLE_BUS is not set CONFIG_ADC=y CONFIG_ADC_SANDBOX=y diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig index 1687ccf4530..2fcda46dfd1 100644 --- a/configs/sandbox_spl_defconfig +++ b/configs/sandbox_spl_defconfig @@ -107,6 +107,7 @@ CONFIG_SYSCON=y CONFIG_SPL_SYSCON=y CONFIG_DEVRES=y CONFIG_DEBUG_DEVRES=y +CONFIG_SPL_DEVRES=y # CONFIG_SPL_SIMPLE_BUS is not set CONFIG_ADC=y CONFIG_ADC_SANDBOX=y But is that the right way based on the questions above ? > Thanks > Angus > >> Regards, >> Simon