Skip to contentSkip to conversation

block: Add SPL_BLOCK_CACHE and default n

PATCH New Adam Ford 2 participants 2 messages Jun 11, 2018 – Jun 19, 2018 Block layer

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v3 1/1 block: Add SPL_BLOCK_CACHE and default n

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")

---
V3: Change dependency to only SPL_BLK and not BLOCK_CACHE
and further clean up macros/ifdefs

V2: Clean up macros and ifdefs

drivers/block/Kconfig +7 -0
index 0792373cfc..f9502b36ba 100644
@@ -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
drivers/block/Makefile +1 -1
index 5fcafb193e..0e80ce9405 100644
@@ -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
include/blk.h +1 -1
index fc0c239e46..86f6d5057f 100644
@@ -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
  *
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/1 block: Add SPL_BLOCK_CACHE and default n

Quoted 7 lines · Adam Ford

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")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180619/ff0b5920/attachment.sig>