linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Bean Huo <huobean@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bean Huo <beanhuo@micron.com>,
	Michael Brunner <Michael.Brunner@kontron.com>
Subject: Re: [PATCH v1] mmc: block: Disable CMDQ on the ioctl path
Date: Tue, 11 May 2021 12:56:37 +0200	[thread overview]
Message-ID: <CAPDyKFq-9G9M0HZjdBgCbrfPJTvq35eqy4NazsJeG8PH5YioPw@mail.gmail.com> (raw)
In-Reply-To: <20210504203209.361597-1-huobean@gmail.com>

On Tue, 4 May 2021 at 22:32, Bean Huo <huobean@gmail.com> wrote:
>
> From: Bean Huo <beanhuo@micron.com>
>
> According to the eMMC Spec:
> "When command queuing is enabled (CMDQ Mode En bit in CMDQ_MODE_EN
> field is set to ‘1’) class 11 commands are the only method through
> which data transfer tasks can be issued. Existing data transfer
> commands, namely CMD18/CMD17 and CMD25/CMD24, are not supported when
> command queuing is enabled."
> which means if CMDQ is enabled, the FFU commands will not be supported.
> To fix this issue, just simply disable CMDQ on the ioctl path, and
> re-enable CMDQ once ioctl request is completed.
>
> Tested-by: Michael Brunner <Michael.Brunner@kontron.com>
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Applied for next and by adding a fixes/stable tag, thanks!

Kind regards
Uffe

> ---
>  drivers/mmc/core/block.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 689eb9afeeed..21fb99883b1e 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -1004,6 +1004,11 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req)
>
>         switch (mq_rq->drv_op) {
>         case MMC_DRV_OP_IOCTL:
> +               if (card->ext_csd.cmdq_en) {
> +                       ret = mmc_cmdq_disable(card);
> +                       if (ret)
> +                               break;
> +               }

This should have a "fallthrough;" statement. No need for a respin, I
have amended the change this time.

>         case MMC_DRV_OP_IOCTL_RPMB:
>                 idata = mq_rq->drv_op_data;
>                 for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) {
> @@ -1014,6 +1019,8 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req)
>                 /* Always switch back to main area after RPMB access */
>                 if (rpmb_ioctl)
>                         mmc_blk_part_switch(card, 0);
> +               else if (card->reenable_cmdq && !card->ext_csd.cmdq_en)
> +                       mmc_cmdq_enable(card);
>                 break;
>         case MMC_DRV_OP_BOOT_WP:
>                 ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP,
> --
> 2.25.1
>

Kind regards
Uffe

      parent reply	other threads:[~2021-05-11 10:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 20:32 [PATCH v1] mmc: block: Disable CMDQ on the ioctl path Bean Huo
2021-05-05  4:41 ` Adrian Hunter
2021-05-11 10:56 ` Ulf Hansson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFq-9G9M0HZjdBgCbrfPJTvq35eqy4NazsJeG8PH5YioPw@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=Michael.Brunner@kontron.com \
    --cc=adrian.hunter@intel.com \
    --cc=beanhuo@micron.com \
    --cc=huobean@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).