From: Jaehoon Chung <jh80.chung@samsung.com>
To: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Chris Ball <chris@printf.net>,
Seungwon Jeon <tgih.jun@samsung.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH v3 8/8] mmc: dw_mmc: fix the checking whether card is present
Date: Mon, 03 Feb 2014 20:15:39 +0900 [thread overview]
Message-ID: <52EF7A5B.3030902@samsung.com> (raw)
Broken card detection is assumed "the card is present".
Non-removable card didn't call get_cd().
dw-mmc controller didn't check whether card is present or not.
Because DW_MMC_CARD_PRESENT flag is set into dw_mci_get_cd().
If cd-pin is used, then dw_mci_get_cd() is called.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/host/dw_mmc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index ac2907d..0d6ab8f 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -910,6 +910,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci *host = slot->host;
+ struct dw_mci_board *brd = host->pdata;
WARN_ON(slot->mrq);
@@ -920,7 +921,8 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
*/
spin_lock_bh(&host->lock);
- if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) {
+ if (!(brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) &&
+ !test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) {
spin_unlock_bh(&host->lock);
mrq->cmd->error = -ENOMEDIUM;
mmc_request_done(mmc, mrq);
--
1.7.9.5
next reply other threads:[~2014-02-03 11:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 11:15 Jaehoon Chung [this message]
2014-02-06 11:29 ` [PATCH v3 8/8] mmc: dw_mmc: fix the checking whether card is present Seungwon Jeon
2014-02-07 2:45 ` Jaehoon Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52EF7A5B.3030902@samsung.com \
--to=jh80.chung@samsung.com \
--cc=chris@printf.net \
--cc=linux-mmc@vger.kernel.org \
--cc=tgih.jun@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).