From 035148f45e7e02ee692800ea73c90b0a0e7c0ecc Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Thu, 5 Nov 2015 14:20:08 +0530 Subject: [PATCH] mmc: core: fix debugfs path to read ext_csd After reading ext_csd, the host is not claimed while doing unhalt if the card is in CQ mode. This may race with RPMB context which tries to halt and disable CQ in the card. This may unhalt the controller while RPMB is still going on, resulting in software request timeout for RPMB commands that are supposed to be sent in legacy mode with controller in halt state. Fix this by claiming the host till the unhalt is done in mmc_ext_csd_open() so as to prevent race with RPMB context. CRs-Fixed: 935719 Change-Id: I6d2738b21c3cd44c8fb6c99f63291059d5b18ee1 Signed-off-by: Sahitya Tummala [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani --- drivers/mmc/core/debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 0c55824a449b..c894f64c2e38 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -461,7 +461,6 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp) } err = mmc_get_ext_csd(card, &ext_csd); - mmc_put_card(card); if (err) goto out_free; @@ -478,6 +477,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp) mmc_hostname(card->host), __func__); } + mmc_put_card(card); kfree(ext_csd); return 0; @@ -487,6 +487,7 @@ out_free: pr_err("%s: %s: cmdq unhalt failed\n", mmc_hostname(card->host), __func__); } + mmc_put_card(card); out_free_halt: kfree(buf); return err;