diff mbox

[U-Boot,RFC,V2,2/3] block: add Kconfig options for [CMD_]BLOCK_CACHE

Message ID 1458524727-4643-3-git-send-email-eric@nelint.com
State RFC
Delegated to: Tom Rini
Headers show

Commit Message

Eric Nelson March 21, 2016, 1:45 a.m. UTC
Allow the selection of CONFIG_BLOCK_CACHE, CONFIG_CMD_BLOCK_CACHE
using menuconfig.

Signed-off-by: Eric Nelson <eric@nelint.com>
---
 drivers/block/Kconfig | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Stephen Warren March 23, 2016, 5:24 p.m. UTC | #1
On 03/20/2016 07:45 PM, Eric Nelson wrote:
> Allow the selection of CONFIG_BLOCK_CACHE, CONFIG_CMD_BLOCK_CACHE
> using menuconfig.

I think this should be part of patch 1.
Eric Nelson March 23, 2016, 5:45 p.m. UTC | #2
On 03/23/2016 10:24 AM, Stephen Warren wrote:
> On 03/20/2016 07:45 PM, Eric Nelson wrote:
>> Allow the selection of CONFIG_BLOCK_CACHE, CONFIG_CMD_BLOCK_CACHE
>> using menuconfig.
> 
> I think this should be part of patch 1.

Works for me, especially as it adds some documentation in
the form of help text.
diff mbox

Patch

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index f35c4d4..6529efb 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -18,3 +18,22 @@  config DISK
 	  types can use this, such as AHCI/SATA. It does not provide any standard
 	  operations at present. The block device interface has not been converted
 	  to driver model.
+
+config BLOCK_CACHE
+	bool "Use block device cache"
+	default n
+	help
+	  This option enables a disk-block cache for all block devices.
+	  This is most useful when accessing filesystems under U-Boot since
+	  it will prevent repeated reads from directory structures.
+
+config CMD_BLOCK_CACHE
+	bool "Include block device cache control command (blkcache)"
+	depends on BLOCK_CACHE
+	default y if BLOCK_CACHE
+	help
+	  Enable the blkcache command, which can be used to control the
+	  operation of the cache functions.
+	  This is most useful when fine-tuning the operation of the cache
+	  during development, but also allows the cache to be disabled when
+	  it might hurt performance (e.g. when using the ums command).