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.ch...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to