Commit b22217f9 authored by Micky Ching's avatar Micky Ching Committed by Ulf Hansson

mmc: rtsx: finish request if no card exist

Return error-code directly if no card exist, this can
make card remove faster.
Signed-off-by: default avatarMicky Ching <micky_ching@realsil.com.cn>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 3e7cf902
...@@ -100,6 +100,11 @@ static void sd_print_debug_regs(struct realtek_pci_sdmmc *host) ...@@ -100,6 +100,11 @@ static void sd_print_debug_regs(struct realtek_pci_sdmmc *host)
#define sd_print_debug_regs(host) #define sd_print_debug_regs(host)
#endif /* DEBUG */ #endif /* DEBUG */
static inline int sd_get_cd_int(struct realtek_pci_sdmmc *host)
{
return rtsx_pci_readl(host->pcr, RTSX_BIPR) & SD_EXIST;
}
static void sd_cmd_set_sd_cmd(struct rtsx_pcr *pcr, struct mmc_command *cmd) static void sd_cmd_set_sd_cmd(struct rtsx_pcr *pcr, struct mmc_command *cmd)
{ {
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD_CMD0, 0xFF, rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD_CMD0, 0xFF,
...@@ -798,7 +803,7 @@ static void sd_request(struct work_struct *work) ...@@ -798,7 +803,7 @@ static void sd_request(struct work_struct *work)
unsigned int data_size = 0; unsigned int data_size = 0;
int err; int err;
if (host->eject) { if (host->eject || !sd_get_cd_int(host)) {
cmd->error = -ENOMEDIUM; cmd->error = -ENOMEDIUM;
goto finish; goto finish;
} }
...@@ -1116,7 +1121,7 @@ static int sdmmc_get_cd(struct mmc_host *mmc) ...@@ -1116,7 +1121,7 @@ static int sdmmc_get_cd(struct mmc_host *mmc)
u32 val; u32 val;
if (host->eject) if (host->eject)
return -ENOMEDIUM; return cd;
mutex_lock(&pcr->pcr_mutex); mutex_lock(&pcr->pcr_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment