Revert "mmc: mmcblk: Add support for deferred SD bus resume"
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:49:10 +0000 (22:49 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 14:49:10 +0000 (22:49 +0800)
This reverts commit a31e8fffe82b08ace454b6190d60d31779ccf3d7.

drivers/mmc/card/Kconfig
drivers/mmc/card/block.c
drivers/mmc/core/core.c

index 86948f90c3ffe981139c96039d016c0e0a2fd4a6..3f2a912659aff9a6ad596d7271ad60df2a332752 100644 (file)
@@ -32,15 +32,6 @@ config MMC_BLOCK_BOUNCE
 
          If unsure, say Y here.
 
-config MMC_BLOCK_DEFERRED_RESUME
-       bool "Deferr MMC layer resume until I/O is requested"
-       depends on MMC_BLOCK
-       default n
-       help
-         Say Y here to enable deferred MMC resume until I/O
-         is requested. This will reduce overall resume latency and
-         save power when theres an SD card inserted but not being used.
-
 config SDIO_UART
        tristate "SDIO UART/GPS class support"
        help
index 853e5dbc1cdf5b66ed6c45b6c4c7d52fb44ae7ae..85f0e8cd875bac4f153788ff0012fc0b27e05dd5 100644 (file)
@@ -234,33 +234,6 @@ static u32 get_card_status(struct mmc_card *card, struct request *req)
        return cmd.resp[0];
 }
 
-static int
-mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
-{
-       struct mmc_command cmd;
-       int err;
-
-       /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
-       if (mmc_card_blockaddr(card))
-               return 0;
-
-       mmc_claim_host(card->host);
-       cmd.opcode = MMC_SET_BLOCKLEN;
-       cmd.arg = 512;
-       cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
-       err = mmc_wait_for_cmd(card->host, &cmd, 5);
-       mmc_release_host(card->host);
-
-       if (err) {
-               printk(KERN_ERR "%s: unable to set block size to %d: %d\n",
-                       md->disk->disk_name, cmd.arg, err);
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-
 static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 {
        struct mmc_blk_data *md = mq->data;
@@ -268,13 +241,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
        struct mmc_blk_request brq;
        int ret = 1, disable_multi = 0;
 
-#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
-       if (mmc_bus_needs_resume(card->host)) {
-               mmc_resume_bus(card->host);
-               mmc_blk_set_blksize(md, card);
-       }
-#endif
-
        mmc_claim_host(card->host);
 
        do {
@@ -589,6 +555,32 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
        return ERR_PTR(ret);
 }
 
+static int
+mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
+{
+       struct mmc_command cmd;
+       int err;
+
+       /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
+       if (mmc_card_blockaddr(card))
+               return 0;
+
+       mmc_claim_host(card->host);
+       cmd.opcode = MMC_SET_BLOCKLEN;
+       cmd.arg = 512;
+       cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
+       err = mmc_wait_for_cmd(card->host, &cmd, 5);
+       mmc_release_host(card->host);
+
+       if (err) {
+               printk(KERN_ERR "%s: unable to set block size to %d: %d\n",
+                       md->disk->disk_name, cmd.arg, err);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 static int mmc_blk_probe(struct mmc_card *card)
 {
        struct mmc_blk_data *md;
@@ -617,9 +609,6 @@ static int mmc_blk_probe(struct mmc_card *card)
                cap_str, md->read_only ? "(ro)" : "");
 
        mmc_set_drvdata(card, md);
-#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
-       mmc_set_bus_resume_policy(card->host, 1);
-#endif
        add_disk(md->disk);
        return 0;
 
@@ -643,9 +632,6 @@ static void mmc_blk_remove(struct mmc_card *card)
                mmc_blk_put(md);
        }
        mmc_set_drvdata(card, NULL);
-#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
-       mmc_set_bus_resume_policy(card->host, 0);
-#endif
 }
 
 #ifdef CONFIG_PM
@@ -664,9 +650,7 @@ static int mmc_blk_resume(struct mmc_card *card)
        struct mmc_blk_data *md = mmc_get_drvdata(card);
 
        if (md) {
-#ifndef CONFIG_MMC_BLOCK_DEFERRED_RESUME
                mmc_blk_set_blksize(md, card);
-#endif
                mmc_queue_resume(&md->queue);
        }
        return 0;
index de01a899d01f83124064a794fd6e964579bb5796..80994cf10a36983334c59d0db251a10e31f9ce85 100644 (file)
@@ -1076,12 +1076,6 @@ void mmc_rescan(struct work_struct *work)
        if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead)
                host->bus_ops->detect(host);
 
-       /* If the card was removed the bus will be marked
-        * as dead - extend the wakelock so userspace
-        * can respond */
-       if (host->bus_dead)
-               extend_wakelock = 1;
-
        mmc_bus_put(host);