[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1318125810-30505-1-git-send-email-wei_wang@realsil.com.cn>
Date: Sun, 9 Oct 2011 10:03:30 +0800
From: <wei_wang@...lsil.com.cn>
To: <gregkh@...e.de>, <devel@...uxdriverproject.org>,
<linux-kernel@...r.kernel.org>
CC: wwang <wei_wang@...lsil.com.cn>
Subject: [PATCH] staging:rts_pstor:Fix SDIO issue
From: wwang <wei_wang@...lsil.com.cn>
Fix a bug that SDIO and SD normal card would appear simultaneously if a SDIO card inserted.
Signed-off-by: wwang <wei_wang@...lsil.com.cn>
---
drivers/staging/rts_pstor/sd.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index fb62eaf..9ce63f7 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -3094,6 +3094,7 @@ int reset_sd_card(struct rtsx_chip *chip)
{
struct sd_info *sd_card = &(chip->sd_card);
int retval;
+ int reset_pass = 0;
sd_init_reg_addr(chip);
@@ -3134,7 +3135,10 @@ int reset_sd_card(struct rtsx_chip *chip)
if (chip->sd_ctl & RESET_MMC_FIRST) {
retval = reset_mmc(chip);
- if ((retval != STATUS_SUCCESS) && !sd_check_err_code(chip, SD_NO_CARD)) {
+ if (retval != STATUS_SUCCESS) {
+ if (sd_check_err_code(chip, SD_NO_CARD))
+ TRACE_RET(chip, STATUS_FAIL);
+
retval = reset_sd(chip);
if (retval != STATUS_SUCCESS) {
if (CHECK_PID(chip, 0x5209)) {
@@ -3143,7 +3147,11 @@ int reset_sd_card(struct rtsx_chip *chip)
TRACE_RET(chip, STATUS_FAIL);
}
}
+ } else {
+ reset_pass = 1;
}
+ } else {
+ reset_pass = 1;
}
} else {
retval = reset_sd(chip);
@@ -3161,13 +3169,16 @@ int reset_sd_card(struct rtsx_chip *chip)
if (!chip->sd_io) {
retval = reset_mmc(chip);
+ if (retval == STATUS_SUCCESS)
+ reset_pass = 1;
}
+ } else {
+ reset_pass = 1;
}
}
- if (retval != STATUS_SUCCESS) {
+ if (!reset_pass)
TRACE_RET(chip, STATUS_FAIL);
- }
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
if (retval != STATUS_SUCCESS) {
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists