]> Pileus Git - ~andy/linux/blobdiff - drivers/mmc/core/sd.c
rt2x00: fix random stalls
[~andy/linux] / drivers / mmc / core / sd.c
index f2a05ea40f2a3ed705e220fd5216d508d538b033..c63ad03c29c7ff61065ec64d66ae28eeb90884cc 100644 (file)
@@ -307,8 +307,8 @@ static int mmc_read_switch(struct mmc_card *card)
                goto out;
        }
 
-       if (status[13] & UHS_SDR50_BUS_SPEED)
-               card->sw_caps.hs_max_dtr = 50000000;
+       if (status[13] & SD_MODE_HIGH_SPEED)
+               card->sw_caps.hs_max_dtr = HIGH_SPEED_MAX_DTR;
 
        if (card->scr.sda_spec3) {
                card->sw_caps.sd3_bus_mode = status[13];
@@ -661,7 +661,8 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
 
        /* SPI mode doesn't define CMD19 */
        if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning)
-               err = card->host->ops->execute_tuning(card->host);
+               err = card->host->ops->execute_tuning(card->host,
+                                                     MMC_SEND_TUNING_BLOCK);
 
 out:
        kfree(status);
@@ -960,7 +961,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
                        goto free_card;
 
                /* Card is an ultra-high-speed card */
-               mmc_sd_card_set_uhs(card);
+               mmc_card_set_uhs(card);
 
                /*
                 * Since initialization is now complete, enable preset
@@ -1018,6 +1019,14 @@ static void mmc_sd_remove(struct mmc_host *host)
        host->card = NULL;
 }
 
+/*
+ * Card detection - card is alive.
+ */
+static int mmc_sd_alive(struct mmc_host *host)
+{
+       return mmc_send_status(host->card, NULL);
+}
+
 /*
  * Card detection callback from host.
  */
@@ -1033,7 +1042,7 @@ static void mmc_sd_detect(struct mmc_host *host)
        /*
         * Just check if our card has been removed.
         */
-       err = mmc_send_status(host->card, NULL);
+       err = _mmc_detect_card_removed(host);
 
        mmc_release_host(host);
 
@@ -1102,6 +1111,7 @@ static const struct mmc_bus_ops mmc_sd_ops = {
        .suspend = NULL,
        .resume = NULL,
        .power_restore = mmc_sd_power_restore,
+       .alive = mmc_sd_alive,
 };
 
 static const struct mmc_bus_ops mmc_sd_ops_unsafe = {
@@ -1110,6 +1120,7 @@ static const struct mmc_bus_ops mmc_sd_ops_unsafe = {
        .suspend = mmc_sd_suspend,
        .resume = mmc_sd_resume,
        .power_restore = mmc_sd_power_restore,
+       .alive = mmc_sd_alive,
 };
 
 static void mmc_sd_attach_bus_ops(struct mmc_host *host)