mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Franck Jullien <franck.jullien@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: [PATCH] cfi_flash: show progress while during erase
Date: Tue, 27 May 2014 08:50:08 +0200	[thread overview]
Message-ID: <CAJfOKBw9ZtwL-=QNhQ5=AZXsrRrJr0ij-oxAiWQnyReRr8cxjQ@mail.gmail.com> (raw)
In-Reply-To: <20140527054213.GM15686@pengutronix.de>

2014-05-27 7:42 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> On Mon, May 26, 2014 at 08:20:52PM +0200, Franck Jullien wrote:
>> Sascha,
>>
>> Any reason why you removed the progress bar here in this commit:
>> 2749fbac48374b5f5ced ?
>
> The reason was that with the conversion of the cfi driver to mtd the
> loop over the erase blocks was no longer in the cfi driver but in the
> mtd layer. So if you see a progress bar for each erased block. You are
> probably irritated because of this patch which came in later:
>
> | commit 0d7ac7c3817e006cc4e258522a989642f1be1538
> | Author: Sascha Hauer <s.hauer@pengutronix.de>
> | Date:   Sat May 25 00:16:31 2013 +0200
> |
> |     mtd: call mtd_erase with complete area if possible
> |
> |     If a device does not have bad blocks loop over the eraseblocks
> |     in the driver instead of the core. This allows the mtd_dataflash
> |     driver to erase blocks instead of pages to gain more speed during
> |     erasing. Also the mtd_dataflash driver modifies the erase_info
> |     struct which causes the outer loop in the core to never end.
> |
> |     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> |
> | diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
> | index 61744b6..f358098 100644
> | --- a/drivers/mtd/core.c
> | +++ b/drivers/mtd/core.c
> | @@ -107,6 +107,12 @@ static int mtd_op_erase(struct cdev *cdev, size_t count, loff_t offset)
> |       memset(&erase, 0, sizeof(erase));
> |       erase.mtd = mtd;
> |       erase.addr = offset;
> | +
> | +     if (!mtd->block_isbad) {
> | +             erase.len = count;
> | +             return mtd_erase(mtd, &erase);
> | +     }
> | +
> |       erase.len = mtd->erasesize;
> |
> |       while (count > 0) {
>
> This moves the eraseblock iteration back into the drivers when the
> device does not have bad blocks, which is the case for cfi flashes.
>

Ok. So brings back the progress bar in the cfi_flash driver is good.

For NAND devices we could add a progress bar in the mtd core file.
However, I don't have a nand on my board so I can't test it.

Now, what would you think if we had a command line option to make
erase quiet (-q) ?
By default we would have a progress bar displayed.

Franck.

> 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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-05-27  6:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 18:12 Franck Jullien
2014-05-26 18:20 ` Franck Jullien
2014-05-27  5:42   ` Sascha Hauer
2014-05-27  6:50     ` Franck Jullien [this message]
2014-05-27 18:24       ` Sascha Hauer
2014-05-26 19:04 ` Holger Schurig
2014-05-26 19:12   ` Franck Jullien

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='CAJfOKBw9ZtwL-=QNhQ5=AZXsrRrJr0ij-oxAiWQnyReRr8cxjQ@mail.gmail.com' \
    --to=franck.jullien@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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