public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] UBI: init eba tables before wl when attaching a device
@ 2011-10-10 11:08 Holger Brunck
  2011-10-12  9:39 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Brunck @ 2011-10-10 11:08 UTC (permalink / raw)
  To: u-boot

This fixes that u-boot gets stuck when a bitflip was detected
during "ubi part <ubi_device>". If a bitflip was detected UBI tries
to copy the PEB to a different place. This needs that the eba table
are initialized, but this was done after the wear levelling worker
detects the bitflip. So changes the initialisation of these two
tasks in u-boot.

This is a u-boot specific patch and not needed in the linux layer,
because due to commit 1b1f9a9d00447d
UBI: Ensure that "background thread" operations are really executed
we schedule these tasks in place and not as in linux after the inital
task which schedule this new task is finished.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Stefan Roese <sr@denx.de>
---
 drivers/mtd/ubi/build.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 3ea0e6c..d144ac2 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -476,21 +476,21 @@ static int attach_by_scanning(struct ubi_device *ubi)
 	if (err)
 		goto out_si;
 
-	err = ubi_wl_init_scan(ubi, si);
-	if (err)
-		goto out_vtbl;
-
 	err = ubi_eba_init_scan(ubi, si);
 	if (err)
 		goto out_wl;
 
+	err = ubi_wl_init_scan(ubi, si);
+	if (err)
+		goto out_vtbl;
+
 	ubi_scan_destroy_si(si);
 	return 0;
 
-out_wl:
-	ubi_wl_close(ubi);
 out_vtbl:
 	vfree(ubi->vtbl);
+out_wl:
+	ubi_wl_close(ubi);
 out_si:
 	ubi_scan_destroy_si(si);
 	return err;
-- 
1.7.1

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

* [U-Boot] [PATCH] UBI: init eba tables before wl when attaching a device
  2011-10-10 11:08 [U-Boot] [PATCH] UBI: init eba tables before wl when attaching a device Holger Brunck
@ 2011-10-12  9:39 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2011-10-12  9:39 UTC (permalink / raw)
  To: u-boot

Hi Holger,

On Monday 10 October 2011 13:08:19 Holger Brunck wrote:
> This fixes that u-boot gets stuck when a bitflip was detected
> during "ubi part <ubi_device>". If a bitflip was detected UBI tries
> to copy the PEB to a different place. This needs that the eba table
> are initialized, but this was done after the wear levelling worker
> detects the bitflip. So changes the initialisation of these two
> tasks in u-boot.
> 
> This is a u-boot specific patch and not needed in the linux layer,
> because due to commit 1b1f9a9d00447d
> UBI: Ensure that "background thread" operations are really executed
> we schedule these tasks in place and not as in linux after the inital
> task which schedule this new task is finished.

Applied to u-boot-ubi/master. Thanks.

Best regards,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

end of thread, other threads:[~2011-10-12  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 11:08 [U-Boot] [PATCH] UBI: init eba tables before wl when attaching a device Holger Brunck
2011-10-12  9:39 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox