All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Crowe <mac@mcrowe.com>
To: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH 0/2] Support skipping bad blocks when seeking to start address
Date: Wed, 11 Jan 2017 16:22:35 +0000	[thread overview]
Message-ID: <20170111162235.GA32121@mcrowe.com> (raw)
In-Reply-To: <20170109145135.GA17740@mcrowe.com>

On Monday 09 January 2017 at 14:51:35 +0000, Mike Crowe wrote:
> However, I can't say I understand how the main loop in nandwrite.c can work
> if blockalign > 1. It contains the following lines of code:
> 
> |  ebsize_aligned = mtd.eb_size * blockalign;
> |  ...
> |  ret = mtd_is_bad(&mtd, fd, offs / ebsize_aligned);

I believe that the above line should read:

 ret = mtd_is_bad(&mtd, fd, offs / mtd.eb_size);

so that...

> |  ...		   
> |  offs +=  ebsize_aligned / blockalign;
> 
> The implementation of mtd_is_bad in libmtd.c contains:
> 
> |  seek = (loff_t)eb * mtd->eb_size;

...the above line works correctly.

This seems to have been introduced back in 2010 in
15d811481cf1cf61ae23fabbd1e191ebdbcf3881 when a direct ioctl call was
replaced by the call to mtd_is_bad.

But, if it really has been broken since then, I think it's worth
questioning how many people can actually be using the blockalign feature.

Thanks.

Mike.

  reply	other threads:[~2017-01-11 16:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 14:18 [PATCH 0/2] Support skipping bad blocks when seeking to start address Mike Crowe
2017-01-04 14:18 ` [PATCH 1/2] nandwrite: Add --skip-bad-blocks-to-start option Mike Crowe
2017-01-04 14:18 ` [PATCH 2/2] nanddump: " Mike Crowe
2017-01-05 13:38 ` [PATCH 0/2] Support skipping bad blocks when seeking to start address goliath
2017-01-05 14:18   ` Mike Crowe
2017-01-05 14:48     ` Boris Brezillon
2017-01-05 15:04       ` Mike Crowe
2017-01-09 12:18         ` David Oberhollenzer
2017-01-09 14:51           ` Mike Crowe
2017-01-11 16:22             ` Mike Crowe [this message]
2017-01-17 11:54 Mike Crowe
2017-01-23  6:47 ` David Oberhollenzer

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=20170111162235.GA32121@mcrowe.com \
    --to=mac@mcrowe.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=david.oberhollenzer@sigma-star.at \
    --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 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.