aboutsummaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAngelo Durgehello <angelo.dureghello@timesys.com>2020-01-21 10:37:27 +0100
committerTom Rini <trini@konsulko.com>2020-01-25 12:04:36 -0500
commit1526bcce0f7285087621e16e6720636d01839da8 (patch)
tree168d3316c1f9fec098444449d6d9b19304288e0d /drivers/block
parent5cde44e12adc180575d5ee35ef251e0470a10598 (diff)
downloadu-boot-1526bcce0f7285087621e16e6720636d01839da8.zip
u-boot-1526bcce0f7285087621e16e6720636d01839da8.tar.gz
u-boot-1526bcce0f7285087621e16e6720636d01839da8.tar.bz2
common: add blkcache init
On m68k, block_cache list is relocated, but next and prev list pointers are not adjusted to the relocated struct list_head address, so the first iteration over the block_cache list hangs. This patch initializes the block_cache list after relocation. Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com> Reviewed-by: Eric Nelson <eric@nelint.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/blkcache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index 1fa6498..f603aa1 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -21,13 +21,20 @@ struct block_cache_node {
char *cache;
};
-static LIST_HEAD(block_cache);
+static struct 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)