All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <marek.behun@nic.cz>
To: Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Cc: "Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Patrick Delaunay" <patrick.delaunay@st.com>,
	"Heiko Schocher" <hs@denx.de>, "Pali Rohár" <pali@kernel.org>,
	"Marek Behún" <marek.behun@nic.cz>
Subject: [PATCH RESEND u-boot-spi 1/8] mtd: spi-nor-core: Try cleaning up in case writing BAR failed
Date: Thu, 15 Jul 2021 01:51:02 +0200	[thread overview]
Message-ID: <20210714235109.25228-2-marek.behun@nic.cz> (raw)
In-Reply-To: <20210714235109.25228-1-marek.behun@nic.cz>

Use the cleanup codepath of spi_nor_erase() also in the event of failure
of writing the BAR register.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
---
 drivers/mtd/spi/spi-nor-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 99e2f16349..7ce8dc5502 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -927,7 +927,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
 #ifdef CONFIG_SPI_FLASH_BAR
 		ret = write_bar(nor, addr);
 		if (ret < 0)
-			return ret;
+			goto erase_err;
 #endif
 		write_enable(nor);
 
-- 
2.31.1


  reply	other threads:[~2021-07-14 23:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 23:51 [PATCH RESEND u-boot-spi 0/8] Fix `mtd erase` when used with mtdpart Marek Behún
2021-07-14 23:51 ` Marek Behún [this message]
2021-07-20 18:32   ` [PATCH RESEND u-boot-spi 1/8] mtd: spi-nor-core: Try cleaning up in case writing BAR failed Simon Glass
2021-07-21 15:49   ` Jagan Teki
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 2/8] mtd: spi-nor-core: Check return value of write_enable() in spi_nor_erase() Marek Behún
2021-07-20 18:32   ` Simon Glass
2021-07-21 15:50   ` Jagan Teki
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 3/8] mtd: spi-nor-core: Don't overwrite return value if it is non-zero Marek Behún
2021-07-20 18:32   ` Simon Glass
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 4/8] mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase() Marek Behún
2021-07-20 18:32   ` Simon Glass
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 5/8] mtd: spi-nor-core: Don't check for zero length " Marek Behún
2021-07-20 18:32   ` Simon Glass
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 6/8] mtd: spi-nor-core: Call mtd_erase_callback() from spi_nor_erase() Marek Behún
2021-07-20 18:32   ` Simon Glass
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 7/8] mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase() Marek Behún
2021-07-20 18:33   ` Simon Glass
2021-07-14 23:51 ` [PATCH RESEND u-boot-spi 8/8] mtd: mtdpart: Make mtdpart's _erase method sane Marek Behún
2021-07-20 18:33   ` Simon Glass
2021-07-20 18:33 ` [PATCH RESEND u-boot-spi 0/8] Fix `mtd erase` when used with mtdpart Simon Glass
2021-07-21 16:16 ` Jagan Teki
2021-07-22 20:44   ` Marek Behun
2021-07-22 22:14     ` Tom Rini
2021-07-23  1:18   ` Marek Behun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210714235109.25228-2-marek.behun@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=hs@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=masami.hiramatsu@linaro.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pali@kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@st.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.