linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: rric@kernel.org, ulf.hansson@linaro.org,
	linus.walleij@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: beanhuo@micron.com, stable@vger.kernel.org
Subject: [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup
Date: Fri, 19 Mar 2021 13:13:57 +0100	[thread overview]
Message-ID: <20210319121357.255176-3-huobean@gmail.com> (raw)
In-Reply-To: <20210319121357.255176-1-huobean@gmail.com>

From: Bean Huo <beanhuo@micron.com>

Currently, we have two ways to issue multiple-block read/write the
command to the eMMC. One is by normal IO request path fs->block->mmc.
Another one is that we can issue multiple-block read/write through
MMC ioctl interface. For the first path, mrq->stop, and mrq->stop->opcode
will be initialized in mmc_blk_data_prep(). However, for the second IO
path, mrq->stop is not initialized since it is a pre-defined multiple
blocks read/write.

Meanwhile, if it is open-ended multiple block read/write command,
STOP_TRANSMISSION CMD12 will be issued later in mmc_blk_issue_drv_op(),
since it is MMC_IOC_MULTI_CMD.

So, delete these if-statement checkups, let these kinds of multiple-block
read/write request go.

Fixes 'ba3869ff32e4 ("mmc: cavium: Add core MMC driver for Cavium SOCs")'
Cc: stable@vger.kernel.org
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/cavium.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
index 95a41983c6c0..8fb7cbcf62ad 100644
--- a/drivers/mmc/host/cavium.c
+++ b/drivers/mmc/host/cavium.c
@@ -654,8 +654,7 @@ static void cvm_mmc_dma_request(struct mmc_host *mmc,
 	struct mmc_data *data;
 	u64 emm_dma, addr;
 
-	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
-	    !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
+	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len) {
 		dev_err(&mmc->card->dev, "Error: %s no data\n", __func__);
 		goto error;
 	}
-- 
2.25.1


  parent reply	other threads:[~2021-03-19 12:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 12:13 [PATCH v1 0/2] wo minor changes for Cavium MMC host driver Bean Huo
2021-03-19 12:13 ` [PATCH v1 1/2] mmc: cavium: Use '"%s...", __func__' to print function name Bean Huo
2021-03-19 14:12   ` Ulf Hansson
2021-03-19 12:13 ` Bean Huo [this message]
2021-03-19 14:09   ` [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup Ulf Hansson
2021-03-19 15:42     ` Bean Huo
2021-04-29 20:30       ` Bean Huo
2021-05-10 14:01         ` Ulf Hansson

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=20210319121357.255176-3-huobean@gmail.com \
    --to=huobean@gmail.com \
    --cc=beanhuo@micron.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.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).