From: Sascha Hauer <s.hauer@pengutronix.de>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org, Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH] UBI: only read UBI_VID_HDR_SIZE when reading the vid_hdr
Date: Thu, 23 Jun 2016 17:06:31 +0200 [thread overview]
Message-ID: <20160623150631.GG20657@pengutronix.de> (raw)
In-Reply-To: <576BF461.2020108@nod.at>
On Thu, Jun 23, 2016 at 04:38:25PM +0200, Richard Weinberger wrote:
> Am 23.06.2016 um 15:29 schrieb 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);
>
> Hmm, I fear this will break as soon ubi->vid_hdr_shift is non-zero.
Ok, just tried and indeed it does break. Would it be an option to read
UBI_VID_HDR_SIZE + ubi->vid_hdr_shift bytes instead?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2016-06-23 15:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20160623150631.GG20657@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/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;
as well as URLs for NNTP newsgroup(s).