]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
mmc: card: switching form CQ mode to normal mode
authorAnubhav <anubhavj@nvidia.com>
Wed, 12 Apr 2017 13:03:44 +0000 (18:33 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 16 May 2017 13:05:57 +0000 (06:05 -0700)
-Since CQ needs to be disabled before invoking FFU, so
switching to normal mode from CQ mode before invoking FFU.

Bug 200215393

Change-Id: Idacf23b4dc16da1a7c1f061b1d35f337350e5107
Signed-off-by: Anubhav <anubhavj@nvidia.com>
Reviewed-on: http://git-master/r/1480647
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
drivers/mmc/card/block.c

index 3864e30d5a62c480c2bf5d0689a1efc03c9ceb0a..431f06e8abe9886cee41995e9f183b513362b32e 100644 (file)
@@ -143,6 +143,9 @@ static inline int mmc_blk_part_switch(struct mmc_card *card,
                                      struct mmc_blk_data *md);
 static int get_card_status(struct mmc_card *card, u32 *status, int retries);
 
+static int mmc_blk_hw_cmdq_switch(struct mmc_card *card,
+               struct mmc_blk_data *md, bool enable);
+
 static inline void mmc_blk_clear_packed(struct mmc_queue_req *mqrq)
 {
        struct mmc_packed *packed = mqrq->packed;
@@ -881,11 +884,19 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
        mmc_get_card(card);
 
        if (idata->ic.opcode == MMC_FFU_INVOKE_OP) {
+               err = mmc_blk_hw_cmdq_switch(card, md, false);
+               if (err)
+                       pr_debug("%s: cmdq: switch failed, %d\n",
+                       mmc_hostname(card->host), err);
                err = mmc_ffu_invoke(card, idata->buf);
+               err = mmc_blk_hw_cmdq_switch(card, md, true);
+               if (err)
+                       pr_debug("%s: cmdq: switch failed, %d\n",
+                       mmc_hostname(card->host), err);
+               mmc_put_card(card);
                goto cmd_done;
        }
 
-
        ioc_err = __mmc_blk_ioctl_cmd(card, md, idata);
 
        mmc_put_card(card);