aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick/host
diff options
context:
space:
mode:
authorWei WANG <wei_wang@realsil.com.cn>2013-02-08 02:24:27 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-13 18:24:12 -0500
commitc3481955f6c78c8dd99921759306d7469c999ec2 (patch)
treeae65ba72e1076dd94690f16c2d03cdce56d7f34d /drivers/memstick/host
parent0cd5b6d08c7bf8b2d81eb1413ea1463cc72487b1 (diff)
mfd: rtsx: Fix issue that booting OS with SD card inserted
Realtek card reader supports both SD and MS card. According to the settings of rtsx MFD driver, SD host will be probed before MS host. If we boot/reboot Linux with SD card inserted, the resetting flow of SD card will succeed, and the following resetting flow of MS is sure to fail. Then MS upper-level driver will ask rtsx driver to turn power off. This request leads to the result that the following SD commands fail and SD card can't be accessed again. In this commit, Realtek's SD and MS host driver will check whether the card that upper driver requesting is the one existing in the slot. If not, Realtek's host driver will refuse the operation to make sure the exlusive accessing at the same time. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/memstick/host')
-rw-r--r--drivers/memstick/host/rtsx_pci_ms.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/memstick/host/rtsx_pci_ms.c b/drivers/memstick/host/rtsx_pci_ms.c
index f5ddb82dadb7..64a779c58a74 100644
--- a/drivers/memstick/host/rtsx_pci_ms.c
+++ b/drivers/memstick/host/rtsx_pci_ms.c
@@ -426,6 +426,9 @@ static void rtsx_pci_ms_request(struct memstick_host *msh)
426 426
427 dev_dbg(ms_dev(host), "--> %s\n", __func__); 427 dev_dbg(ms_dev(host), "--> %s\n", __func__);
428 428
429 if (rtsx_pci_card_exclusive_check(host->pcr, RTSX_MS_CARD))
430 return;
431
429 schedule_work(&host->handle_req); 432 schedule_work(&host->handle_req);
430} 433}
431 434
@@ -441,6 +444,10 @@ static int rtsx_pci_ms_set_param(struct memstick_host *msh,
441 dev_dbg(ms_dev(host), "%s: param = %d, value = %d\n", 444 dev_dbg(ms_dev(host), "%s: param = %d, value = %d\n",
442 __func__, param, value); 445 __func__, param, value);
443 446
447 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_MS_CARD);
448 if (err)
449 return err;
450
444 switch (param) { 451 switch (param) {
445 case MEMSTICK_POWER: 452 case MEMSTICK_POWER:
446 if (value == MEMSTICK_POWER_ON) 453 if (value == MEMSTICK_POWER_ON)