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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable 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 284CBC34022 for ; Mon, 17 Feb 2020 17:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0ADBA208C4 for ; Mon, 17 Feb 2020 17:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729585AbgBQRYq (ORCPT ); Mon, 17 Feb 2020 12:24:46 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42764 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729584AbgBQRYq (ORCPT ); Mon, 17 Feb 2020 12:24:46 -0500 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1D9BE2667C2; Mon, 17 Feb 2020 17:24:44 +0000 (GMT) Date: Mon, 17 Feb 2020 18:24:38 +0100 From: Boris Brezillon To: Schrempf Frieder Cc: Boris Brezillon , Jeff Kletsky , liaoweixiong , Miquel Raynal , Richard Weinberger , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH v2 3/3] mtd: spinand: Don not erase the block before writing a bad block marker Message-ID: <20200217182438.76a25592@collabora.com> In-Reply-To: <20200217155213.5594-4-frieder.schrempf@kontron.de> References: <20200217155213.5594-1-frieder.schrempf@kontron.de> <20200217155213.5594-4-frieder.schrempf@kontron.de> Organization: Collabora X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org In the subject: s/Don not/Do not/ On Mon, 17 Feb 2020 15:54:12 +0000 Schrempf Frieder wrote: > From: Frieder Schrempf > > Currently when marking a block, we use spinand_erase_op() to erase > the block before writing the marker to the OOB area. Doing so without > waiting for the operation to finish can lead to the marking failing > silently and no bad block marker being written to the flash. > > In fact we don't need to do an erase at all before writing the BBM. > The ECC is disabled for the raw access to the OOB data and we don't s/the raw access/raw accesses/ > need to work around any issues with chips reporting ECC errors as it > is known to be the case for raw NAND. > > Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") > Cc: stable@vger.kernel.org > Signed-off-by: Frieder Schrempf Reviewed-by: Boris Brezillon > --- > Changes in v2: > * Instead of waiting for the erase operation to finish, just don't > do an erase at all, as it is not needed. > * Update the commit message > --- > drivers/mtd/nand/spi/core.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c > index a94287884453..8dda51bbdd11 100644 > --- a/drivers/mtd/nand/spi/core.c > +++ b/drivers/mtd/nand/spi/core.c > @@ -613,7 +613,6 @@ static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) > }; > int ret; > > - /* Erase block before marking it bad. */ > ret = spinand_select_target(spinand, pos->target); > if (ret) > return ret; > @@ -622,8 +621,6 @@ static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) > if (ret) > return ret; > > - spinand_erase_op(spinand, pos); > - > return spinand_write_page(spinand, &req); > } >