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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no 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 E70C4C4338F for ; Fri, 23 Jul 2021 01:18:57 +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 ED85560EBA for ; Fri, 23 Jul 2021 01:18:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ED85560EBA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3701782BED; Fri, 23 Jul 2021 03:18:54 +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="o596TTak"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C77682C19; Fri, 23 Jul 2021 03:18:52 +0200 (CEST) Received: from mail.nic.cz (lists.nic.cz [217.31.204.67]) (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 DE30482C4C for ; Fri, 23 Jul 2021 03:18:47 +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 thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 1882614095B; Fri, 23 Jul 2021 03:18:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1627003127; bh=PuK9IwTXcntocRN9riQY/dwW5JwDqhMjK3NSMBSzgbU=; h=Date:From:To; b=o596TTakuhXdw+czXlQlKSMzjA1u0DBML9A5da3npVD2gZMK76OWgBhhdj6Xvdh3O D6ucFdXr82k3Dy6eCD39+SZ/F5RA4bMLZsDo2WjzWIWmJXId1rYMuFt62TzGZFRz05 vypTbeF/Q6OYxb0kh79S4GD0mSJxMuuUKRveNl+g= Date: Fri, 23 Jul 2021 03:18:46 +0200 From: Marek Behun To: Jagan Teki Cc: Masami Hiramatsu , Simon Glass , Miquel Raynal , Tom Rini , U-Boot-Denx , Patrice Chotard , Patrick Delaunay , Heiko Schocher , Pali =?UTF-8?B?Um9ow6Fy?= Subject: Re: [PATCH RESEND u-boot-spi 0/8] Fix `mtd erase` when used with mtdpart Message-ID: <20210723031846.2a342c22@thinkpad> In-Reply-To: References: <20210714235109.25228-1-marek.behun@nic.cz> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; 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.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Jagan, On Wed, 21 Jul 2021 21:46:56 +0530 Jagan Teki wrote: > Found the build error with CI [1], would you please check? > > [1] https://source.denx.de/u-boot/custodians/u-boot-spi/-/pipelines/8345 > > Jagan. OK I think I've found out what is the problem. I've pushed new version into github CI to check if it builds correctly. The problem seems to be that after this series the function spi_nor_erase() calls mtd_erase_callback(), which is declared in the header file include/linux/mtd/mtd.h, if CONFIG_MTD_PARTITIONS is enabled, and defined as a static inline function otherwise. The problem is that for some boards we have CONFIG_MTD_PARTITIONS together with CONFIG_SPL_SPI_FLASH_SUPPORT. But in SPL, mtdpart.c (where mtd_erase_callback() is defined) is not compiled at all. Thus this leads to undefined reference to mtd_erase_callback(). This is another proof that the whole mtd subsystem has become a gross spaghetti code where hacks upon hacks were introduced by different people to solve different purposes, and the result makes me angry. :-D We really need to rewrite this. Anyway, for now I will just send v2 of this series with another patch fixing this issue, once CI ends smoothly. Marek