mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/3] ARM: Rockchip: bbu: allow forcing barebox update handler despite size
Date: Mon, 15 Apr 2024 07:28:15 +0200	[thread overview]
Message-ID: <20240415052815.366527-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240415052815.366527-1-a.fatoum@pengutronix.de>

The update handler correctly refuses to write a bootloader when it would
interfere with partitioning.

Depending on use case, the user may want to override this check though,
so allow the barebox update force parameter to override it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-rockchip/bbu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rockchip/bbu.c b/arch/arm/mach-rockchip/bbu.c
index f9681aad1aa4..f15b32937c3e 100644
--- a/arch/arm/mach-rockchip/bbu.c
+++ b/arch/arm/mach-rockchip/bbu.c
@@ -63,9 +63,9 @@ static int rockchip_bbu_mmc_handler(struct bbu_handler *handler,
 	space = cdev_unallocated_space(cdev_by_name(cdevname));
 
 	if (space < IMG_OFFSET_0 + data->len) {
-		pr_err("Unallocated space on %s (%lld) is too small for one image\n",
-		       data->devicefile, space);
-		return -ENOSPC;
+		if (!bbu_force(data, "Unallocated space on %s (%lld) is too small for one image\n",
+			       data->devicefile, space))
+			return -ENOSPC;
 	}
 
 	fd = open(data->devicefile, O_WRONLY);
-- 
2.39.2




  parent reply	other threads:[~2024-04-15  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  5:28 [PATCH 1/3] ARM: Rockchip: bbu: rename rk3568_bbu_mmc_register to rockchip_* Ahmad Fatoum
2024-04-15  5:28 ` [PATCH 2/3] ARM: Rockchip: bbu: output unallocated space size on error Ahmad Fatoum
2024-04-15  5:28 ` Ahmad Fatoum [this message]
2024-04-16 11:05 ` [PATCH 1/3] ARM: Rockchip: bbu: rename rk3568_bbu_mmc_register to rockchip_* Sascha Hauer

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=20240415052815.366527-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox