[PATCH 2/2] Revert "common: add blkcache init"

Joel Johnson mrjoel at lixil.net
Sun Jan 26 17:48:59 CET 2020


This reverts commit 1526bcce0f7285087621e16e6720636d01839da8.

The commit causes boot failure using MMC environment for Marvell A38x
(tested with SolidRun Clearfog). The boot hangs after the following
message is printed to console:
    Loading Environment from MMC...

Other than bisecting to identify the problematic commit I haven't
tested further to determine a better possible fix to be compatible
with both A38x and m68k.

Signed-off-by: Joel Johnson <mrjoel at lixil.net>
---

 common/board_r.c         | 3 ---
 drivers/block/blkcache.c | 9 +--------
 include/blk.h            | 6 ------
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 4f56c19fcc..8a0c1114e7 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -864,9 +864,6 @@ static init_fnc_t init_sequence_r[] = {
 #endif
 #if defined(CONFIG_PRAM)
 	initr_mem,
-#endif
-#ifdef CONFIG_BLOCK_CACHE
-	blkcache_init,
 #endif
 	run_main_loop,
 };
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index f603aa129d..1fa64989d3 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -21,20 +21,13 @@ struct block_cache_node {
 	char *cache;
 };
 
-static struct list_head block_cache;
+static LIST_HEAD(block_cache);
 
 static struct block_cache_stats _stats = {
 	.max_blocks_per_entry = 8,
 	.max_entries = 32
 };
 
-int blkcache_init(void)
-{
-	INIT_LIST_HEAD(&block_cache);
-
-	return 0;
-}
-
 static struct block_cache_node *cache_find(int iftype, int devnum,
 					   lbaint_t start, lbaint_t blkcnt,
 					   unsigned long blksz)
diff --git a/include/blk.h b/include/blk.h
index 6f541bb2ba..ccc66e6a20 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -113,12 +113,6 @@ struct blk_desc {
 	(PAD_SIZE(size, blk_desc->blksz))
 
 #if CONFIG_IS_ENABLED(BLOCK_CACHE)
-
-/**
- * blkcache_init() - initialize the block cache list pointers
- */
-int blkcache_init(void);
-
 /**
  * blkcache_read() - attempt to read a set of blocks from cache
  *
-- 
2.20.1



More information about the U-Boot mailing list