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_1 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 7AC4EC4338F for ; Thu, 22 Jul 2021 22:14:15 +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 D3A6A60EB4 for ; Thu, 22 Jul 2021 22:14:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3A6A60EB4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com 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 EF16082C54; Fri, 23 Jul 2021 00:14:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="iYDaj5//"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2820482C54; Fri, 23 Jul 2021 00:14:11 +0200 (CEST) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 168EA82C19 for ; Fri, 23 Jul 2021 00:14:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2f.google.com with SMTP id l16so484142qvw.1 for ; Thu, 22 Jul 2021 15:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ocWBOk7BVSP2olL6mReS3AuCJpnFjpzvqcvAExhmrwQ=; b=iYDaj5//YbR+eC7ze+yUgJP+gtyLyNxEuNtjrC4xkN7DrVBwIFVQJ5tdkW7BkR2ePx JOJu+pgR8TPfpE9eUo/Vtq8oENmf1FniZF3H8AVTERnhdKR8tNwLDiYAUdzeX43IIvMM 3s0bhdUjuylEMXMTodfGygGhS6DEtDGklLWlY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ocWBOk7BVSP2olL6mReS3AuCJpnFjpzvqcvAExhmrwQ=; b=p0MjARQ9ilA/+CINBNMqLgjmPuC27cq7Vj5qbnsoPX1DD2F8y+SN9aoU1QBsHJWBOF I6SvGm4ekonpdu3tBPQ9jTuboxVB317MhlZNlMx7Xss/2hg4Rj6X4u0Hcq3Zxwz3S+nG 5vpw+ypkGObsyzwhrF1vakWnwJpSIUVvuyW3wS2vGM5DbF3DHZ/ggOSxW2F1eyl2hoL6 Nrvwrjs532/nyG5GcXxN0MCLLUB6dAoBhwEmblau5KXdWRX3pNacbVN56X/3/2yt60WM Oy0Ho6CaXRZQUIXHN9WgNzPE5QzZ/A0xxx9fyArnB8plETKHE+8yYw/ko13ajQq+phQA QUNA== X-Gm-Message-State: AOAM532jycyW34190PeDO/Mi0mmcq0hvIeUdGoxE9R/jPtj1i2Roc63E 8GDciPGFQYlAIw6nQbMpBqI1Dg== X-Google-Smtp-Source: ABdhPJzom6iXZbCccMANlbwVC7Kob6cvCequTUZ7KLxXuKfP9f6xcVWy8FngrTPd9941pClCdceMnA== X-Received: by 2002:a05:6214:1cb:: with SMTP id c11mr2163837qvt.47.1626992045693; Thu, 22 Jul 2021 15:14:05 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5560-078f-fb66-41c1.res6.spectrum.com. [2603:6081:7b01:cbda:5560:78f:fb66:41c1]) by smtp.gmail.com with ESMTPSA id x14sm5517223qts.13.2021.07.22.15.14.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Jul 2021 15:14:04 -0700 (PDT) Date: Thu, 22 Jul 2021 18:14:02 -0400 From: Tom Rini To: Marek Behun Cc: Jagan Teki , Masami Hiramatsu , Simon Glass , Miquel Raynal , U-Boot-Denx , Patrice Chotard , Patrick Delaunay , Heiko Schocher , Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH RESEND u-boot-spi 0/8] Fix `mtd erase` when used with mtdpart Message-ID: <20210722221402.GI9379@bill-the-cat> References: <20210714235109.25228-1-marek.behun@nic.cz> <20210722224459.3bdacfb2@thinkpad> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ji4Rnx8WjMcV97wJ" Content-Disposition: inline In-Reply-To: <20210722224459.3bdacfb2@thinkpad> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --ji4Rnx8WjMcV97wJ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 22, 2021 at 10:44:59PM +0200, Marek Behun wrote: > On Wed, 21 Jul 2021 21:46:56 +0530 > Jagan Teki wrote: >=20 > > Hi Marek, > >=20 > > On Thu, Jul 15, 2021 at 5:21 AM Marek Beh=FAn wrot= e: > > > > > > Hello, > > > > > > I accidentally forgot to send this series to U-Boot's mailing list la= st > > > time, meaning it did not end up in patchwork, so now I am resending i= t. > > > Sorry for this mess. > > > > > > The original cover letter said: > > > > > > this patch series fixes the `mtd erase` command when used with mtdpart > > > with a partition of non-zero offset. > > > > > > Currently when the `mtd erase` command is used for such a partition, > > > it does not erase all blocks. Instead after a block is erased, the ne= xt > > > block address not current block address + block size, but current blo= ck > > > address + block size + partition offset, due to spi_nor_erase() not > > > calling mtd_erase_callback(): =20 > > > =3D> mtd erase "Rescue system" =20 > > > Erasing 0x00000000 ... 0x006fffff (1792 eraseblock(s)) > > > jedec_spi_nor spi-nor@0: at 0x100000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x201000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x302000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x403000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x504000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x605000, len 4096 > > > jedec_spi_nor spi-nor@0: at 0x706000, len 4096 > > > > > > This series adds some fixes to spi_nor_erase() function, then adds > > > calling of mtd_erase_callback() to fix this bug. > > > > > > The series also contains an improvement - adding the posibility to > > > interrupt spi_nor_erase() with Ctrl+C; and another one - making mtdpa= rt's > > > _erase() method more sane so that the above mentioned bug will not oc= cur > > > even if underlying driver does not call mtd_erase_callback(). > > > > > > Moreover I would also like to start a discussion regarding the MTD > > > subsystem: > > > - U-Boot's MTD subsystem is based on Linux's, with many #ifdef __U_BO= OT__ > > > macros > > > - this was done to make it easier to port Linux's patches to U-Boot > > > - the problem is that it seems nobody did port Linux's MTD patches to > > > U-Boot for a long time, the code is many times different from Linux= ', > > > and it would be very hard to align it > > > - therefore I propose to get rid of all the #ifdefs, remove the Linux > > > specific code, and continue developing the code independently from > > > Linux. This would make it impossible to apply Linux patches in some > > > kind of automatic way, but this is currently already impossible > > > anyway > > > What do you guys think? > > > > > > Marek > > > > > > Marek Beh=FAn (8): > > > mtd: spi-nor-core: Try cleaning up in case writing BAR failed > > > mtd: spi-nor-core: Check return value of write_enable() in > > > spi_nor_erase() > > > mtd: spi-nor-core: Don't overwrite return value if it is non-zero > > > mtd: spi-nor-core: Check return value of write_disable() in > > > spi_nor_erase() > > > mtd: spi-nor-core: Don't check for zero length in spi_nor_erase() > > > mtd: spi-nor-core: Call mtd_erase_callback() from spi_nor_erase() > > > mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase() > > > mtd: mtdpart: Make mtdpart's _erase method sane =20 > >=20 > > Found the build error with CI [1], would you please check? > >=20 > > [1] https://source.denx.de/u-boot/custodians/u-boot-spi/-/pipelines/8345 > >=20 > > Jagan. >=20 > Jagan, I am unable to get the output of the failed CI tests. Probably > because I do not have an account at source.denx.de. Jagan, please check the permissions on your tree, the results should be set to public. --=20 Tom --ji4Rnx8WjMcV97wJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmD57aoACgkQFHw5/5Y0 tyxRwAv/eo/7ju05Q/787T1H0uT+4S8VbxePBVkOBUq/WPbYb2PkbHO9wGDLI7zo TzAmhiH2RzLN0gAv8+gpquc7YeTsIps0gOIozZx5+3q5wsQ8LtwIBPNSpjRcwljf bkhq3tPqVrUiUaoOL9GEfcan2FVG6fvpVXZimzviOP+JWklMXwo6N2RyfG9CreK3 LxTFd3Xn+akA0V4AUeHJdi2RlRQs9IcaEyC+oXSoeIFP+mMsTACgHZXpmkLTz5ST caIPJGGV/Gak6iIDcdOdNX7lBqyUE9TpIMibCNLhtSv2To2Hc9BBUKHhLujWJDIS hYFD6hoFfdA0vRBBvqXsX3PaI1m+1yXPifNMt2FxXWFrOkdN/TK+2QS053+qws2+ RWU3FBMz36VX/AfEuOzkgCCmQtDNGcNgoatRTsM71HM4jwIEpJ9hU1hOFdZSlCJe 0fz08AovkWfpu34Wmi5mnc2h3sAd4ja40Od6XaarHS3X4Q4qgTURq9aKQuJAia3b psjAFxty =ZUR6 -----END PGP SIGNATURE----- --ji4Rnx8WjMcV97wJ--