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 X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CBBBC47088 for ; Wed, 26 May 2021 13:52:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 07417611C9 for ; Wed, 26 May 2021 13:52:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07417611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 97DE282D2D; Wed, 26 May 2021 15:52:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz 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; secure) header.d=nic.cz header.i=@nic.cz header.b="xPhNex59"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3337E82E2F; Wed, 26 May 2021 15:52:16 +0200 (CEST) Received: from mail.nic.cz (lists.nic.cz [IPv6:2001:1488:800:400::400]) (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 1AD1681DB3 for ; Wed, 26 May 2021 15:52:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from dellmb (unknown [IPv6:2001:1488:fffe:6:be02:5020:4be2:aff5]) by mail.nic.cz (Postfix) with ESMTPSA id A7C9A13FEDF; Wed, 26 May 2021 15:52:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1622037132; bh=INKKJSlzcgquZzyJRP20LiWpSYb3NgFEoC5K5Ir84Kw=; h=Date:From:To; b=xPhNex59ETa/i7/jPyQkGuURhunjpay7wJCZ7+cMn69F7o+C1EmG+CWzEbHqW06Sy HZK4ePSCNhQXz470NI07ab826bE/G9zHBbqLyZHC+LcJHN6k2pH4aAXpVUHdCb98Fw jpIQ7Qc5Sp4Xh7m6rSkXTfXMQNHW7+ptn288G+yI= Date: Wed, 26 May 2021 15:51:06 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Tom Rini Cc: Simon Glass , u-boot@lists.denx.de Subject: Re: problems with boards with CONFIG_DM disabled Message-ID: <20210526155106.56deb3dc@dellmb> In-Reply-To: <20210526125258.GZ17669@bill-the-cat> References: <20210526012756.31c98fa2@thinkpad> <20210526022554.1104c350@thinkpad> <20210526125258.GZ17669@bill-the-cat> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean On Wed, 26 May 2021 08:52:58 -0400 Tom Rini wrote: > On Wed, May 26, 2021 at 02:25:54AM +0200, Marek Behun wrote: > > On Wed, 26 May 2021 01:27:56 +0200 > > Marek Behun wrote: > > > > > Tom, Simon, > > > > > > now that LTO is merged I am working on > > > Support SPI NORs and OF partitions in `mtd list` > > > > > > but CI fails for some boards, see > > > https://github.com/u-boot/u-boot/pull/55 > > > > > > The reason is that there are still several boards which do not use > > > CONFIG_DM. > > > > > > On the previous version Simon commented that I should use > > > if (IS_ENABLED(...)) > > > instead of > > > #if > > > but this does not currently work for those boards with CONFIG_DM > > > disabled (struct udevice's members are not visible at all, and > > > functions from dm/device.h do not exist). > > > > > > There are multiple possible workarounds: > > > - use #if (until all boards are at CONFIG_DM) > > > - create static inline versions of functions from dm/device.h > > > returning failures when CONFIG_DM is not set (this would be > > > rather big :( ) > > > - wait till all those boards with CONFIG_DM disabled are removed > > > - ... > > > > Since there is rather a large number of defconfigs with CONFIG_DM > > disabled, and since the relevant code was rather complex > > > > if (!is_part && dev && mtd->dev == dev) || > > !strcmp(name, mtd->name) || > > (is_part && mtd->dev && !strcmp(name, mtd->dev->name)) > > > > I moved the code into a separate name matching function and for now > > created a non-DM version. > > > > Hopefully this will be acceptable and pass CI. > > There's two parts to it, I suppose. First, looking at the failed > build: > https://dev.azure.com/u-boot/u-boot/_build/results?buildId=2297&view=logs&j=9905d24b-10d5-587f-b981-9e43e4414ee0&t=4fbb7fc6-2c55-511b-8011-58267bbd0b81&l=510 > that's not a no-CONFIG_DM migration (SPL_DM is not required). > Second, I wonder what it would look like on top of my > WIP/make-DM_USB-fatal branch as that has removed a number of > non-migrated boards. The deadline for CONFIG_DM causing removal > itself is still a bit away, but that branch does remove a number of > boards. > I've solved this for now, hopefully in an acceptable way, check it out: https://patchwork.ozlabs.org/project/uboot/patch/20210526120826.8045-10-marek.behun@nic.cz/ look for mtd_device_matches_name, there are 2 implementations guarded by macros.