All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks
@ 2019-09-12 14:41 Stefan Roese
  2019-09-12 14:41 ` [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info() Stefan Roese
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Stefan Roese @ 2019-09-12 14:41 UTC (permalink / raw)
  To: u-boot

From: Quentin Schulz <quentin.schulz@bootlin.com>

Some users of static UBI volumes implement their own integrity check,
thus making the volume CRC check done at open time useless. For
instance, this is the case when one use the ubiblock + dm-verity +
squashfs combination, where dm-verity already checks integrity of the
block device but this time at the block granularity instead of verifying
the whole volume.

Skipping this test drastically improves the boot-time.

Adapted to U-Boot by Stefan Roese.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Heiko Schocher <hs@denx.de>
---
 cmd/ubi.c                   | 25 +++++++++++++++++++------
 drivers/mtd/ubi/kapi.c      |  2 +-
 drivers/mtd/ubi/ubi-media.h |  6 ++++++
 drivers/mtd/ubi/ubi.h       |  4 ++++
 drivers/mtd/ubi/vmt.c       | 12 ++++++++++++
 drivers/mtd/ubi/vtbl.c      |  3 +++
 include/mtd/ubi-user.h      | 18 ++++++++++++++++--
 7 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/cmd/ubi.c b/cmd/ubi.c
index ca5dc9021b..c857f07d93 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -146,7 +146,8 @@ bad:
 	return err;
 }
 
-static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id)
+static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
+			  bool skipcheck)
 {
 	struct ubi_mkvol_req req;
 	int err;
@@ -163,7 +164,10 @@ static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id)
 	strcpy(req.name, volume);
 	req.name_len = strlen(volume);
 	req.name[req.name_len] = '\0';
-	req.padding1 = 0;
+	req.flags = 0;
+	if (skipcheck)
+		req.flags |= UBI_VOL_SKIP_CRC_CHECK_FLG;
+
 	/* It's duplicated at drivers/mtd/ubi/cdev.c */
 	err = verify_mkvol_req(ubi, &req);
 	if (err) {
@@ -469,6 +473,7 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int64_t size = 0;
 	ulong addr = 0;
+	bool skipcheck = false;
 
 	if (argc < 2)
 		return CMD_RET_USAGE;
@@ -527,6 +532,12 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		/* Use maximum available size */
 		size = 0;
 
+		/* E.g., create volume with "skipcheck" bit set */
+		if (argc == 7) {
+			skipcheck = strncmp(argv[6], "--skipcheck", 11) == 0;
+			argc--;
+		}
+
 		/* E.g., create volume size type vol_id */
 		if (argc == 6) {
 			id = simple_strtoull(argv[5], NULL, 16);
@@ -555,8 +566,10 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			printf("No size specified -> Using max size (%lld)\n", size);
 		}
 		/* E.g., create volume */
-		if (argc == 3)
-			return ubi_create_vol(argv[2], size, dynamic, id);
+		if (argc == 3) {
+			return ubi_create_vol(argv[2], size, dynamic, id,
+					      skipcheck);
+		}
 	}
 
 	if (strncmp(argv[1], "remove", 6) == 0) {
@@ -623,7 +636,7 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 
 U_BOOT_CMD(
-	ubi, 6, 1, do_ubi,
+	ubi, 7, 1, do_ubi,
 	"ubi commands",
 	"detach"
 		" - detach ubi from a mtd partition\n"
@@ -634,7 +647,7 @@ U_BOOT_CMD(
 		" - Display volume and ubi layout information\n"
 	"ubi check volumename"
 		" - check if volumename exists\n"
-	"ubi create[vol] volume [size] [type] [id]\n"
+	"ubi create[vol] volume [size] [type] [id] [--skipcheck]\n"
 		" - create volume name with size ('-' for maximum"
 		" available size)\n"
 	"ubi write[vol] address volume size"
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
index 2e171b0209..bcea71b1b2 100644
--- a/drivers/mtd/ubi/kapi.c
+++ b/drivers/mtd/ubi/kapi.c
@@ -196,7 +196,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode)
 	desc->mode = mode;
 
 	mutex_lock(&ubi->ckvol_mutex);
-	if (!vol->checked) {
+	if (!vol->checked && !vol->skip_check) {
 		/* This is the first open - check the volume */
 		err = ubi_check_volume(ubi, vol_id);
 		if (err < 0) {
diff --git a/drivers/mtd/ubi/ubi-media.h b/drivers/mtd/ubi/ubi-media.h
index bd7a580961..4af85c4247 100644
--- a/drivers/mtd/ubi/ubi-media.h
+++ b/drivers/mtd/ubi/ubi-media.h
@@ -48,6 +48,11 @@ enum {
  * Volume flags used in the volume table record.
  *
  * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume
+ * @UBI_VTBL_SKIP_CRC_CHECK_FLG: skip the CRC check done on a static volume at
+ *				 open time. Should only be set on volumes that
+ *				 are used by upper layers doing this kind of
+ *				 check. Main use-case for this flag is
+ *				 boot-time reduction
  *
  * %UBI_VTBL_AUTORESIZE_FLG flag can be set only for one volume in the volume
  * table. UBI automatically re-sizes the volume which has this flag and makes
@@ -79,6 +84,7 @@ enum {
  */
 enum {
 	UBI_VTBL_AUTORESIZE_FLG = 0x01,
+	UBI_VTBL_SKIP_CRC_CHECK_FLG = 0x02,
 };
 
 /*
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 918d03590c..f44960186b 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -293,6 +293,9 @@ struct ubi_fm_pool {
  *           atomic LEB change
  *
  * @eba_tbl: EBA table of this volume (LEB->PEB mapping)
+ * @skip_check: %1 if CRC check of this static volume should be skipped.
+ *		Directly reflects the presence of the
+ *		%UBI_VTBL_SKIP_CRC_CHECK_FLG flag in the vtbl entry
  * @checked: %1 if this static volume was checked
  * @corrupted: %1 if the volume is corrupted (static volumes only)
  * @upd_marker: %1 if the update marker is set for this volume
@@ -341,6 +344,7 @@ struct ubi_volume {
 	void *upd_buf;
 
 	int *eba_tbl;
+	unsigned int skip_check:1;
 	unsigned int checked:1;
 	unsigned int corrupted:1;
 	unsigned int upd_marker:1;
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 94c8a98d47..a2ff1b5769 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -162,6 +162,9 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
 	if (!vol)
 		return -ENOMEM;
 
+	if (req->flags & UBI_VOL_SKIP_CRC_CHECK_FLG)
+		vol->skip_check = 1;
+
 	spin_lock(&ubi->volumes_lock);
 	if (vol_id == UBI_VOL_NUM_AUTO) {
 		/* Find unused volume ID */
@@ -295,6 +298,10 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
 		vtbl_rec.vol_type = UBI_VID_DYNAMIC;
 	else
 		vtbl_rec.vol_type = UBI_VID_STATIC;
+
+	if (vol->skip_check)
+		vtbl_rec.flags |= UBI_VTBL_SKIP_CRC_CHECK_FLG;
+
 	memcpy(vtbl_rec.name, vol->name, vol->name_len);
 
 	err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec);
@@ -738,6 +745,11 @@ static int self_check_volume(struct ubi_device *ubi, int vol_id)
 			ubi_err(ubi, "bad used_bytes");
 			goto fail;
 		}
+
+		if (vol->skip_check) {
+			ubi_err(ubi, "bad skip_check");
+			goto fail;
+		}
 	} else {
 		if (vol->used_ebs < 0 || vol->used_ebs > vol->reserved_pebs) {
 			ubi_err(ubi, "bad used_ebs");
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index fe96d3a894..fb535c1a87 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -554,6 +554,9 @@ static int init_volumes(struct ubi_device *ubi,
 		vol->name[vol->name_len] = '\0';
 		vol->vol_id = i;
 
+		if (vtbl[i].flags & UBI_VTBL_SKIP_CRC_CHECK_FLG)
+			vol->skip_check = 1;
+
 		if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) {
 			/* Auto re-size flag may be set only for one volume */
 			if (ubi->autoresize_vol_id != -1) {
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index cd81ef965c..8d472cc013 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -271,6 +271,20 @@ struct ubi_attach_req {
 	__s8 padding[10];
 };
 
+/*
+ * UBI volume flags.
+ *
+ * @UBI_VOL_SKIP_CRC_CHECK_FLG: skip the CRC check done on a static volume at
+ *				open time. Only valid for static volumes and
+ *				should only be used if the volume user has a
+ *				way to verify data integrity
+ */
+enum {
+	UBI_VOL_SKIP_CRC_CHECK_FLG = 0x1,
+};
+
+#define UBI_VOL_VALID_FLGS	(UBI_VOL_SKIP_CRC_CHECK_FLG)
+
 /**
  * struct ubi_mkvol_req - volume description data structure used in
  *                        volume creation requests.
@@ -278,7 +292,7 @@ struct ubi_attach_req {
  * @alignment: volume alignment
  * @bytes: volume size in bytes
  * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME)
- * @padding1: reserved for future, not used, has to be zeroed
+ * @flags: volume flags (%UBI_VOL_SKIP_CRC_CHECK_FLG)
  * @name_len: volume name length
  * @padding2: reserved for future, not used, has to be zeroed
  * @name: volume name
@@ -307,7 +321,7 @@ struct ubi_mkvol_req {
 	__s32 alignment;
 	__s64 bytes;
 	__s8 vol_type;
-	__s8 padding1;
+	__u8 flags;
 	__s16 name_len;
 	__s8 padding2[4];
 	char name[UBI_MAX_VOLUME_NAME + 1];
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info()
  2019-09-12 14:41 [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Stefan Roese
@ 2019-09-12 14:41 ` Stefan Roese
  2019-09-17  5:39   ` Heiko Schocher
  2019-09-12 14:41 ` [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr Stefan Roese
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Stefan Roese @ 2019-09-12 14:41 UTC (permalink / raw)
  To: u-boot

It might be interesting, if "skip_check" is set of not, so lets print
this flag in ubi_dump_vol_info() as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Heiko Schocher <hs@denx.de>
---
 drivers/mtd/ubi/debug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index 0a7427522c..f3d348da83 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -109,6 +109,7 @@ void ubi_dump_vol_info(const struct ubi_volume *vol)
 	printf("\tlast_eb_bytes   %d\n", vol->last_eb_bytes);
 	printf("\tcorrupted       %d\n", vol->corrupted);
 	printf("\tupd_marker      %d\n", vol->upd_marker);
+	printf("\tskip_check      %d\n", vol->skip_check);
 
 	if (vol->name_len <= UBI_VOL_NAME_MAX &&
 	    strnlen(vol->name, vol->name_len + 1) == vol->name_len) {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr
  2019-09-12 14:41 [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Stefan Roese
  2019-09-12 14:41 ` [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info() Stefan Roese
@ 2019-09-12 14:41 ` Stefan Roese
  2019-09-13 21:11   ` Andreas Dannenberg
  2019-09-17  5:45   ` Heiko Schocher
  2019-09-17  5:37 ` [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Heiko Schocher
  2019-10-16  8:59 ` Heiko Schocher
  3 siblings, 2 replies; 10+ messages in thread
From: Stefan Roese @ 2019-09-12 14:41 UTC (permalink / raw)
  To: u-boot

U-Boot now supports the "skip_check" flag to optionally skip the CRC
check at open time. Currently its only possible to set this bit upon
UBI volume creation. But it might be very useful to also set this bit
on already installed systems (e.g. field upgrade) to make also use of
the boot-time decrease on those systems.

This patch now adds a new "ubi" command "ubi skipcheck" to set or clear
this bit in the UBI volume header:

=> ubi skipcheck rootfs0 on
Setting skip_check on volume rootfs0

BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based
target with 128MiB of SPI NAND.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Heiko Schocher <hs@denx.de>
---
 cmd/ubi.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/cmd/ubi.c b/cmd/ubi.c
index c857f07d93..42b5641b32 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -419,6 +419,30 @@ static int ubi_dev_scan(struct mtd_info *info, const char *vid_header_offset)
 	return 0;
 }
 
+static int ubi_set_skip_check(char *volume, bool skip_check)
+{
+	struct ubi_vtbl_record vtbl_rec;
+	struct ubi_volume *vol;
+
+	vol = ubi_find_volume(volume);
+	if (vol == NULL)
+		return ENODEV;
+
+	printf("%sing skip_check on volume %s\n",
+	       skip_check ? "Sett" : "Clear", volume);
+
+	vtbl_rec = ubi->vtbl[vol->vol_id];
+	if (skip_check) {
+		vtbl_rec.flags |= UBI_VTBL_SKIP_CRC_CHECK_FLG;
+		vol->skip_check = 1;
+	} else {
+		vtbl_rec.flags &= ~UBI_VTBL_SKIP_CRC_CHECK_FLG;
+		vol->skip_check = 0;
+	}
+
+	return ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec);
+}
+
 static int ubi_detach(void)
 {
 #ifdef CONFIG_CMD_UBIFS
@@ -578,6 +602,14 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			return ubi_remove_vol(argv[2]);
 	}
 
+	if (strncmp(argv[1], "skipcheck", 9) == 0) {
+		/* E.g., change skip_check flag */
+		if (argc == 4) {
+			skipcheck = strncmp(argv[3], "on", 2) == 0;
+			return ubi_set_skip_check(argv[2], skipcheck);
+		}
+	}
+
 	if (strncmp(argv[1], "write", 5) == 0) {
 		int ret;
 
@@ -658,6 +690,8 @@ U_BOOT_CMD(
 		" - Read volume to address with size\n"
 	"ubi remove[vol] volume"
 		" - Remove volume\n"
+	"ubi skipcheck volume on/off"
+		" - Set or clear skip_check flag in volume header\n"
 	"[Legends]\n"
 	" volume: character name\n"
 	" size: specified in bytes\n"
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr
  2019-09-12 14:41 ` [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr Stefan Roese
@ 2019-09-13 21:11   ` Andreas Dannenberg
  2019-09-17  5:45   ` Heiko Schocher
  1 sibling, 0 replies; 10+ messages in thread
From: Andreas Dannenberg @ 2019-09-13 21:11 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Thu, Sep 12, 2019 at 04:41:03PM +0200, Stefan Roese wrote:
> U-Boot now supports the "skip_check" flag to optionally skip the CRC
> check at open time. Currently its only possible to set this bit upon
> UBI volume creation. But it might be very useful to also set this bit
> on already installed systems (e.g. field upgrade) to make also use of
> the boot-time decrease on those systems.
> 
> This patch now adds a new "ubi" command "ubi skipcheck" to set or clear
> this bit in the UBI volume header:
> 
> => ubi skipcheck rootfs0 on
> Setting skip_check on volume rootfs0
> 
> BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based
> target with 128MiB of SPI NAND.

This is a useful series, thanks for preparing/submitting.

But how about adding the above info to the doc/README.ubi file
(updating the copy&paste of the help text and the example so the new
flag is shown, and giving a quick summary of what this option does).


--
Andreas Dannenberg
Texas Instruments Inc



> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  cmd/ubi.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/cmd/ubi.c b/cmd/ubi.c
> index c857f07d93..42b5641b32 100644
> --- a/cmd/ubi.c
> +++ b/cmd/ubi.c
> @@ -419,6 +419,30 @@ static int ubi_dev_scan(struct mtd_info *info, const char *vid_header_offset)
>  	return 0;
>  }
>  
> +static int ubi_set_skip_check(char *volume, bool skip_check)
> +{
> +	struct ubi_vtbl_record vtbl_rec;
> +	struct ubi_volume *vol;
> +
> +	vol = ubi_find_volume(volume);
> +	if (vol == NULL)
> +		return ENODEV;
> +
> +	printf("%sing skip_check on volume %s\n",
> +	       skip_check ? "Sett" : "Clear", volume);
> +
> +	vtbl_rec = ubi->vtbl[vol->vol_id];
> +	if (skip_check) {
> +		vtbl_rec.flags |= UBI_VTBL_SKIP_CRC_CHECK_FLG;
> +		vol->skip_check = 1;
> +	} else {
> +		vtbl_rec.flags &= ~UBI_VTBL_SKIP_CRC_CHECK_FLG;
> +		vol->skip_check = 0;
> +	}
> +
> +	return ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec);
> +}
> +
>  static int ubi_detach(void)
>  {
>  #ifdef CONFIG_CMD_UBIFS
> @@ -578,6 +602,14 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  			return ubi_remove_vol(argv[2]);
>  	}
>  
> +	if (strncmp(argv[1], "skipcheck", 9) == 0) {
> +		/* E.g., change skip_check flag */
> +		if (argc == 4) {
> +			skipcheck = strncmp(argv[3], "on", 2) == 0;
> +			return ubi_set_skip_check(argv[2], skipcheck);
> +		}
> +	}
> +
>  	if (strncmp(argv[1], "write", 5) == 0) {
>  		int ret;
>  
> @@ -658,6 +690,8 @@ U_BOOT_CMD(
>  		" - Read volume to address with size\n"
>  	"ubi remove[vol] volume"
>  		" - Remove volume\n"
> +	"ubi skipcheck volume on/off"
> +		" - Set or clear skip_check flag in volume header\n"
>  	"[Legends]\n"
>  	" volume: character name\n"
>  	" size: specified in bytes\n"
> -- 
> 2.23.0
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks
  2019-09-12 14:41 [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Stefan Roese
  2019-09-12 14:41 ` [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info() Stefan Roese
  2019-09-12 14:41 ` [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr Stefan Roese
@ 2019-09-17  5:37 ` Heiko Schocher
  2019-10-16  8:59 ` Heiko Schocher
  3 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2019-09-17  5:37 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Am 12.09.2019 um 16:41 schrieb Stefan Roese:
> From: Quentin Schulz <quentin.schulz@bootlin.com>
> 
> Some users of static UBI volumes implement their own integrity check,
> thus making the volume CRC check done at open time useless. For
> instance, this is the case when one use the ubiblock + dm-verity +
> squashfs combination, where dm-verity already checks integrity of the
> block device but this time at the block granularity instead of verifying
> the whole volume.
> 
> Skipping this test drastically improves the boot-time.
> 
> Adapted to U-Boot by Stefan Roese.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>   cmd/ubi.c                   | 25 +++++++++++++++++++------
>   drivers/mtd/ubi/kapi.c      |  2 +-
>   drivers/mtd/ubi/ubi-media.h |  6 ++++++
>   drivers/mtd/ubi/ubi.h       |  4 ++++
>   drivers/mtd/ubi/vmt.c       | 12 ++++++++++++
>   drivers/mtd/ubi/vtbl.c      |  3 +++
>   include/mtd/ubi-user.h      | 18 ++++++++++++++++--
>   7 files changed, 61 insertions(+), 9 deletions(-)

Patch look good to me, queued until next merge window opens.

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko


-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info()
  2019-09-12 14:41 ` [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info() Stefan Roese
@ 2019-09-17  5:39   ` Heiko Schocher
  2019-10-16  8:59     ` Heiko Schocher
  0 siblings, 1 reply; 10+ messages in thread
From: Heiko Schocher @ 2019-09-17  5:39 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Am 12.09.2019 um 16:41 schrieb Stefan Roese:
> It might be interesting, if "skip_check" is set of not, so lets print

s/of/or ?

> this flag in ubi_dump_vol_info() as well.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>   drivers/mtd/ubi/debug.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

queued until next merge window opens. I corrected the commit message.

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr
  2019-09-12 14:41 ` [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr Stefan Roese
  2019-09-13 21:11   ` Andreas Dannenberg
@ 2019-09-17  5:45   ` Heiko Schocher
  2019-09-17  5:54     ` Stefan Roese
  1 sibling, 1 reply; 10+ messages in thread
From: Heiko Schocher @ 2019-09-17  5:45 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Am 12.09.2019 um 16:41 schrieb Stefan Roese:
> U-Boot now supports the "skip_check" flag to optionally skip the CRC
> check at open time. Currently its only possible to set this bit upon
> UBI volume creation. But it might be very useful to also set this bit
> on already installed systems (e.g. field upgrade) to make also use of
> the boot-time decrease on those systems.
> 
> This patch now adds a new "ubi" command "ubi skipcheck" to set or clear
> this bit in the UBI volume header:
> 
> => ubi skipcheck rootfs0 on
> Setting skip_check on volume rootfs0
> 
> BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based
> target with 128MiB of SPI NAND.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>   cmd/ubi.c | 34 ++++++++++++++++++++++++++++++++++
>   1 file changed, 34 insertions(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

Could you please send a v2 with the suggestion from Andreas to add
some infos into doc/README.ubi?

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr
  2019-09-17  5:45   ` Heiko Schocher
@ 2019-09-17  5:54     ` Stefan Roese
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Roese @ 2019-09-17  5:54 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On 17.09.19 07:45, Heiko Schocher wrote:
> Hello Stefan,
> 
> Am 12.09.2019 um 16:41 schrieb Stefan Roese:
>> U-Boot now supports the "skip_check" flag to optionally skip the CRC
>> check at open time. Currently its only possible to set this bit upon
>> UBI volume creation. But it might be very useful to also set this bit
>> on already installed systems (e.g. field upgrade) to make also use of
>> the boot-time decrease on those systems.
>>
>> This patch now adds a new "ubi" command "ubi skipcheck" to set or clear
>> this bit in the UBI volume header:
>>
>> => ubi skipcheck rootfs0 on
>> Setting skip_check on volume rootfs0
>>
>> BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based
>> target with 128MiB of SPI NAND.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
>> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
>> Cc: Heiko Schocher <hs@denx.de>
>> ---
>>    cmd/ubi.c | 34 ++++++++++++++++++++++++++++++++++
>>    1 file changed, 34 insertions(+)
> 
> Reviewed-by: Heiko Schocher <hs@denx.de>
> 
> Could you please send a v2 with the suggestion from Andreas to add
> some infos into doc/README.ubi?

Yes, its on my list for today. ;)

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks
  2019-09-12 14:41 [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Stefan Roese
                   ` (2 preceding siblings ...)
  2019-09-17  5:37 ` [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Heiko Schocher
@ 2019-10-16  8:59 ` Heiko Schocher
  3 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2019-10-16  8:59 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Am 12.09.2019 um 16:41 schrieb Stefan Roese:
> From: Quentin Schulz <quentin.schulz@bootlin.com>
> 
> Some users of static UBI volumes implement their own integrity check,
> thus making the volume CRC check done at open time useless. For
> instance, this is the case when one use the ubiblock + dm-verity +
> squashfs combination, where dm-verity already checks integrity of the
> block device but this time at the block granularity instead of verifying
> the whole volume.
> 
> Skipping this test drastically improves the boot-time.
> 
> Adapted to U-Boot by Stefan Roese.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>   cmd/ubi.c                   | 25 +++++++++++++++++++------
>   drivers/mtd/ubi/kapi.c      |  2 +-
>   drivers/mtd/ubi/ubi-media.h |  6 ++++++
>   drivers/mtd/ubi/ubi.h       |  4 ++++
>   drivers/mtd/ubi/vmt.c       | 12 ++++++++++++
>   drivers/mtd/ubi/vtbl.c      |  3 +++
>   include/mtd/ubi-user.h      | 18 ++++++++++++++++--
>   7 files changed, 61 insertions(+), 9 deletions(-)

Thanks!

applied to u-boot-ubi.git master

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info()
  2019-09-17  5:39   ` Heiko Schocher
@ 2019-10-16  8:59     ` Heiko Schocher
  0 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2019-10-16  8:59 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Am 17.09.2019 um 07:39 schrieb Heiko Schocher:
> Hello Stefan,
> 
> Am 12.09.2019 um 16:41 schrieb Stefan Roese:
>> It might be interesting, if "skip_check" is set of not, so lets print
> 
> s/of/or ?
> 
>> this flag in ubi_dump_vol_info() as well.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Quentin Schulz <quentin.schulz@bootlin.com>
>> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
>> Cc: Heiko Schocher <hs@denx.de>
>> ---
>>   drivers/mtd/ubi/debug.c | 1 +
>>   1 file changed, 1 insertion(+)
> 
> Reviewed-by: Heiko Schocher <hs@denx.de>
> 
> queued until next merge window opens. I corrected the commit message.

Thanks!

applied to u-boot-ubi.git master

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-16  8:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 14:41 [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Stefan Roese
2019-09-12 14:41 ` [U-Boot] [PATCH 2/3] ubi: Print skip_check in ubi_dump_vol_info() Stefan Roese
2019-09-17  5:39   ` Heiko Schocher
2019-10-16  8:59     ` Heiko Schocher
2019-09-12 14:41 ` [U-Boot] [PATCH 3/3] ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr Stefan Roese
2019-09-13 21:11   ` Andreas Dannenberg
2019-09-17  5:45   ` Heiko Schocher
2019-09-17  5:54     ` Stefan Roese
2019-09-17  5:37 ` [U-Boot] [PATCH 1/3] ubi: provide a way to skip CRC checks Heiko Schocher
2019-10-16  8:59 ` Heiko Schocher

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.