aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/rtsx_pci_sdmmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/rtsx_pci_sdmmc.c')
-rw-r--r--drivers/mmc/host/rtsx_pci_sdmmc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index f74b5adca642..468c92303167 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -678,12 +678,19 @@ static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
678 struct mmc_command *cmd = mrq->cmd; 678 struct mmc_command *cmd = mrq->cmd;
679 struct mmc_data *data = mrq->data; 679 struct mmc_data *data = mrq->data;
680 unsigned int data_size = 0; 680 unsigned int data_size = 0;
681 int err;
681 682
682 if (host->eject) { 683 if (host->eject) {
683 cmd->error = -ENOMEDIUM; 684 cmd->error = -ENOMEDIUM;
684 goto finish; 685 goto finish;
685 } 686 }
686 687
688 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD);
689 if (err) {
690 cmd->error = err;
691 goto finish;
692 }
693
687 mutex_lock(&pcr->pcr_mutex); 694 mutex_lock(&pcr->pcr_mutex);
688 695
689 rtsx_pci_start_run(pcr); 696 rtsx_pci_start_run(pcr);
@@ -901,6 +908,9 @@ static void sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
901 if (host->eject) 908 if (host->eject)
902 return; 909 return;
903 910
911 if (rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD))
912 return;
913
904 mutex_lock(&pcr->pcr_mutex); 914 mutex_lock(&pcr->pcr_mutex);
905 915
906 rtsx_pci_start_run(pcr); 916 rtsx_pci_start_run(pcr);
@@ -1073,6 +1083,10 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
1073 if (host->eject) 1083 if (host->eject)
1074 return -ENOMEDIUM; 1084 return -ENOMEDIUM;
1075 1085
1086 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD);
1087 if (err)
1088 return err;
1089
1076 mutex_lock(&pcr->pcr_mutex); 1090 mutex_lock(&pcr->pcr_mutex);
1077 1091
1078 rtsx_pci_start_run(pcr); 1092 rtsx_pci_start_run(pcr);
@@ -1122,6 +1136,10 @@ static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
1122 if (host->eject) 1136 if (host->eject)
1123 return -ENOMEDIUM; 1137 return -ENOMEDIUM;
1124 1138
1139 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_SD_CARD);
1140 if (err)
1141 return err;
1142
1125 mutex_lock(&pcr->pcr_mutex); 1143 mutex_lock(&pcr->pcr_mutex);
1126 1144
1127 rtsx_pci_start_run(pcr); 1145 rtsx_pci_start_run(pcr);