From 42dd0264d115e4b70a4a044679dd121689e422f0 Mon Sep 17 00:00:00 2001 From: Dov Levenglick Date: Mon, 20 Jul 2015 17:33:03 +0300 Subject: [PATCH] mmc: core: change test of auto_bkops configured Changing the test of whether auto_bkops is configured allows for a case where the host tried to configure auto_bkops yet the CMD6 failed in configuring the device. This allows a case where manual bkops is configured on a eMMC 5.1 device Change-Id: Ia6c411f516bf27b8a5865109dcf4b290eb3d8e46 Signed-off-by: Dov Levenglick [subhashj@codeaurora.org: fixed trivial merge conflicts & fixed compilation error] Signed-off-by: Subhash Jadavani --- drivers/mmc/core/debugfs.c | 2 +- include/linux/mmc/card.h | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 7550db69f76f..374458c9fd6f 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -759,7 +759,7 @@ void mmc_add_card_debugfs(struct mmc_card *card) goto err; if (mmc_card_mmc(card) && (card->ext_csd.rev >= 5) && - (mmc_card_support_auto_bkops(card) || + (mmc_card_configured_auto_bkops(card) || mmc_card_configured_manual_bkops(card))) if (!debugfs_create_file("bkops_stats", S_IRUSR, root, card, &mmc_dbg_bkops_stats_fops)) diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index ce2a0aa79425..b652076be866 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -665,12 +665,10 @@ static inline bool mmc_card_configured_manual_bkops(const struct mmc_card *c) return c->ext_csd.man_bkops_en & EXT_CSD_BKOPS_MANUAL_EN; } -/* - * By software design, auto_bkops will be enabled on the device if it supports - * it. Therefore, testing if a card is configured to run bkops is synonymous - * to checking if it supports bkops - */ -#define mmc_card_configured_auto_bkops(c) mmc_card_support_auto_bkops(c) +static inline bool mmc_card_configured_auto_bkops(const struct mmc_card *c) +{ + return c->ext_csd.man_bkops_en & EXT_CSD_BKOPS_AUTO_EN; +} #define mmc_card_name(c) ((c)->cid.prod_name) #define mmc_card_id(c) (dev_name(&(c)->dev))