mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wenchao Chen <wenchao.chen666@gmail.com>
To: ulf.hansson@linaro.org, adrian.hunter@intel.com,
	orsonzhai@gmail.com, baolin.wang@linux.alibaba.com,
	zhang.lyra@gmail.com, axboe@kernel.dk, avri.altman@wdc.com,
	kch@nvidia.com
Cc: CLoehle@hyperstone.com, vincent.whitchurch@axis.com,
	bigeasy@linutronix.de, s.shtylyov@omp.ru,
	michael@allwinnertech.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, megoo.tang@gmail.com,
	lzx.stg@gmail.com
Subject: [PATCH V2 1/2] mmc: block: Support Host to control FUA
Date: Fri, 21 Oct 2022 15:30:24 +0800	[thread overview]
Message-ID: <20221021073025.18831-2-wenchao.chen666@gmail.com> (raw)
In-Reply-To: <20221021073025.18831-1-wenchao.chen666@gmail.com>

From: Wenchao Chen <wenchao.chen@unisoc.com>

This patch introduces host->fua_disable for MMC host controller.
The host can turn off FUA to improve performance.

Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
---
V1 -> V2
Address Chaitanyak's suggestions
Address Avri's suggestions
---
 drivers/mmc/core/block.c | 3 ++-
 include/linux/mmc/host.h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 54cd009aee50..333e819e077a 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2490,7 +2490,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	    ((card->ext_csd.rel_param & EXT_CSD_WR_REL_PARAM_EN) ||
 	     card->ext_csd.rel_sectors)) {
 		md->flags |= MMC_BLK_REL_WR;
-		fua_enabled = true;
+		if (!card->host->fua_disable)
+			fua_enabled = true;
 		cache_enabled = true;
 	}
 	if (mmc_cache_enabled(card->host))
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8fdd3cf971a3..16a5bee3eeae 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -517,6 +517,9 @@ struct mmc_host {
 	struct blk_crypto_profile crypto_profile;
 #endif
 
+	/* Host FUA support */
+	bool			fua_disable;
+
 	/* Host Software Queue support */
 	bool			hsq_enabled;
 
-- 
2.17.1


  reply	other threads:[~2022-10-21  7:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  7:30 [PATCH V2 0/2] " Wenchao Chen
2022-10-21  7:30 ` Wenchao Chen [this message]
2022-10-21  7:53   ` [PATCH V2 1/2] " Avri Altman
2022-10-21  8:47     ` Wenchao Chen
2022-10-21  9:37       ` Avri Altman
2022-10-21  7:30 ` [PATCH V2 2/2] mmc: sdhci-sprd: enable fua_disable for SPRDSDHCI Wenchao Chen
2022-10-21  9:42 ` [PATCH V2 0/2] mmc: block: Support Host to control FUA Avri Altman
2022-10-21 15:50 ` Adrian Hunter
2022-11-11  7:58   ` Wenchao Chen
2022-11-11 11:34     ` Ulf Hansson
2022-11-11 12:04       ` Ulf Hansson
2023-02-09 14:50         ` Ulf Hansson
2023-02-13  8:21           ` Wenchao Chen
2023-02-15 15:13             ` Ulf Hansson
2022-11-18 10:11     ` Adrian Hunter
2022-11-18 10:54       ` Wenchao Chen
2022-11-18 11:26         ` Adrian Hunter
2022-10-21 16:10 ` Christian Löhle
2022-10-21 16:32   ` Christian Löhle

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=20221021073025.18831-2-wenchao.chen666@gmail.com \
    --to=wenchao.chen666@gmail.com \
    --cc=CLoehle@hyperstone.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bigeasy@linutronix.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=lzx.stg@gmail.com \
    --cc=megoo.tang@gmail.com \
    --cc=michael@allwinnertech.com \
    --cc=orsonzhai@gmail.com \
    --cc=s.shtylyov@omp.ru \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.whitchurch@axis.com \
    --cc=zhang.lyra@gmail.com \
    /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

all inboxes | Powered by JetHome®