From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpA9k-0000Fg-Bs for barebox@lists.infradead.org; Tue, 27 May 2014 05:42:37 +0000 Date: Tue, 27 May 2014 07:42:13 +0200 From: Sascha Hauer Message-ID: <20140527054213.GM15686@pengutronix.de> References: <1401127952-10811-1-git-send-email-franck.jullien@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH] cfi_flash: show progress while during erase To: Franck Jullien Cc: barebox 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 | 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 | | 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. 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