public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jangsub Yi <jangsub.yi@samsung.com>
To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: junwoo80.lee@samsung.com, sh8267.baek@samsung.com,
	wkon.kim@samsung.com, "jangsub.yi" <jangsub.yi@samsung.com>
Subject: [PATCH] mmc: Add config_host callback to set a mmc queue
Date: Wed,  6 Nov 2024 14:13:47 +0900	[thread overview]
Message-ID: <20241106051347.969-1-jangsub.yi@samsung.com> (raw)
In-Reply-To: CGME20241106051403epcas1p29e983006930bd7b8364b1a1f858ad21c@epcas1p2.samsung.com

From: "jangsub.yi" <jangsub.yi@samsung.com>

Currently, there is no way to set up a host-dependent MMC queue.
In UFS driver, it is possible to configure the request queue in
ufshcd_slave_configure.

There are cases where we need to configure and check the current
state of the request queue on the host operation. For example,
mmc_queue->in_recovery, in_flight, mmc_queue->queue->queue_flag, etc.

Additionally, since the timeout setting may be longer depending
on the device, block layer settings such as timeout are also required.

To add the configuration for the MMC queue, I will add the corresponding
code and initially try to add it during initialization in block.c.
The detailed implementation will be done on the host side.

Signed-off-by: jangsub.yi <jangsub.yi@samsung.com>
---
 drivers/mmc/core/block.c | 3 +++
 include/linux/mmc/host.h | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index ef06a4d5d65b..d292f93ca732 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -3261,6 +3261,9 @@ static int mmc_blk_probe(struct mmc_card *card)
 		goto out_free;
 	}
 
+	if (card->host->ops->config_host)
+		card->host->ops->config_host(card, &md->queue);
+
 	ret = mmc_blk_alloc_parts(card, md);
 	if (ret)
 		goto out;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8fc2b328ec4d..81e21553030b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -113,6 +113,8 @@ enum mmc_err_stat {
 	MMC_ERR_MAX,
 };
 
+struct mmc_queue;
+
 struct mmc_host_ops {
 	/*
 	 * It is optional for the host to implement pre_req and post_req in
@@ -219,6 +221,9 @@ struct mmc_host_ops {
 
 	/* Initialize an SD express card, mandatory for MMC_CAP2_SD_EXP. */
 	int	(*init_sd_express)(struct mmc_host *host, struct mmc_ios *ios);
+
+	/* Configure block layer setting related on MMC queue */
+	void	(*config_host)(struct mmc_card *card, struct mmc_queue *mq);
 };
 
 struct mmc_cqe_ops {
-- 
2.17.1


       reply	other threads:[~2024-11-06  5:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20241106051403epcas1p29e983006930bd7b8364b1a1f858ad21c@epcas1p2.samsung.com>
2024-11-06  5:13 ` Jangsub Yi [this message]
2024-11-07  6:30   ` [PATCH] mmc: Add config_host callback to set a mmc queue Christoph Hellwig
2024-11-07  9:06     ` ???
2024-11-07 15:11       ` 'Christoph Hellwig'
2024-11-11  8:06         ` Jangsub Yi
2024-12-10  5:23           ` Jangsub Yi
2024-12-10  5:28             ` 'Christoph Hellwig'
2024-12-10  6:20               ` Jangsub Yi

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=20241106051347.969-1-jangsub.yi@samsung.com \
    --to=jangsub.yi@samsung.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sh8267.baek@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wkon.kim@samsung.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