block: Add SPL_BLOCK_CACHE and default n
authorAdam Ford <aford173@gmail.com>
Mon, 11 Jun 2018 22:17:48 +0000 (17:17 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 18 Jun 2018 18:43:13 +0000 (14:43 -0400)
When enabling BLOCK_CACHE on devices with limited RAM during SPL,
some devices may not boot.  This creates an option to enable
block caching in SPL by defaults off.  It is dependent on SPL_BLK

Fixes: 46960ad6d09b ("block: Have BLOCK_CACHE default to y in some cases")

Signed-off-by: Adam Ford <aford173@gmail.com>
drivers/block/Kconfig
drivers/block/Makefile
include/blk.h

index 0792373..f9502b3 100644 (file)
@@ -37,6 +37,13 @@ config BLOCK_CACHE
          it will prevent repeated reads from directory structures and other
          filesystem data structures.
 
+config SPL_BLOCK_CACHE
+       bool "Use block device cache in SPL"
+       depends on SPL_BLK
+       default n
+       help
+         This option enables the disk-block cache in SPL
+
 config IDE
        bool "Support IDE controllers"
        select HAVE_BLOCK_DEVICE
index 5fcafb1..0e80ce9 100644 (file)
@@ -11,4 +11,4 @@ endif
 
 obj-$(CONFIG_IDE) += ide.o
 obj-$(CONFIG_SANDBOX) += sandbox.o
-obj-$(CONFIG_BLOCK_CACHE) += blkcache.o
+obj-$(CONFIG_$(SPL_)BLOCK_CACHE) += blkcache.o
index fc0c239..86f6d50 100644 (file)
@@ -111,7 +111,7 @@ struct blk_desc {
 #define PAD_TO_BLOCKSIZE(size, blk_desc) \
        (PAD_SIZE(size, blk_desc->blksz))
 
-#ifdef CONFIG_BLOCK_CACHE
+#if CONFIG_IS_ENABLED(BLOCK_CACHE)
 /**
  * blkcache_read() - attempt to read a set of blocks from cache
  *