linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr
@ 2016-06-23 13:29 Sascha Hauer
  2016-06-23 14:38 ` Richard Weinberger
  0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2016-06-23 13:29 UTC (permalink / raw)
  To: linux-mtd; +Cc: Artem Bityutskiy, Richard Weinberger, Sascha Hauer

When reading the vid hdr from the device UBI always reads a whole
page. Instead, read only the data we actually need and speed up
attachment of UBI devices by potentially making use of reading
subpages.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---

Please review carefully. It obviously works and speeds up UBI attachment
from 3s to 2s here in one case and I have not found places where this patch
makes problems, but there might be a reason I haven't seen why in case of
the ec header only the header is read while in case of the vid header the
whole page is read.

 drivers/mtd/ubi/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 10cf3b5..31918a0 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -1019,7 +1019,7 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
 
 	p = (char *)vid_hdr - ubi->vid_hdr_shift;
 	read_err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
-			  ubi->vid_hdr_alsize);
+			  UBI_VID_HDR_SIZE);
 	if (read_err && read_err != UBI_IO_BITFLIPS && !mtd_is_eccerr(read_err))
 		return read_err;
 
-- 
2.8.1

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

end of thread, other threads:[~2016-06-27  7:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-23 13:29 [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr Sascha Hauer
2016-06-23 14:38 ` Richard Weinberger
2016-06-23 15:06   ` Sascha Hauer
2016-06-23 15:16     ` Richard Weinberger
2016-06-24  6:10       ` Sascha Hauer
2016-06-24  7:39         ` Boris Brezillon
2016-06-25  8:39           ` [PATCH] ubi: Speedup ubi_io_read_vid_hdr() Richard Weinberger
2016-06-25  9:02             ` Richard Weinberger
2016-06-27  5:22             ` Sascha Hauer
2016-06-27  7:05               ` Richard Weinberger
2016-06-25  8:41           ` [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).