From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 17 Mar 2016 15:23:44 -0600 Subject: [U-Boot] [RFC PATCH 2/2] mmc: add support for block device cache In-Reply-To: <1458164424-15363-3-git-send-email-eric@nelint.com> References: <56E9A92F.5000205@nelint.com> <1458164424-15363-1-git-send-email-eric@nelint.com> <1458164424-15363-3-git-send-email-eric@nelint.com> Message-ID: <56EB2060.8040309@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/16/2016 03:40 PM, Eric Nelson wrote: > Signed-off-by: Eric Nelson Patch description. > --- > drivers/mmc/mmc.c | 10 +++++++++- > drivers/mmc/mmc_write.c | 7 +++++++ Presumably it makes sense for the cache to work for IDE, SATA, USB, SCSI, ... too. I wonder if it's possible to put this code somewhere more central than mmc*.c so it automatically applies to dev_desc->block_read() (see include/part.h). Perhaps not since each implementation supplies its own block_read function directly, so the cache calls do need to be duplicated everywhere. > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > * > * SPDX-License-Identifier: GPL-2.0+ > */ > - > #include Nit: unrelated change. I think there is a missing call to cache_block_invalidate() when the MMC device gets re-enumerated/re-initialized. The user would do something to trigger this (e.g. mmc rescan) when they'd swapped an SD card out for example. Do you have any stats on how many operations this saves for typical FS operations such as: - Partition table type identification (with various types such as MBR/DOS, GPT, ...) - Partition enumeration - Filesystem identification (with various filesystems such as FAT, ext, ...) - File reads