[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f4ffe80d664a970bb33ab94791bf67f9545e3e29.1584428736.git.baolin.wang7@gmail.com>
Date: Tue, 17 Mar 2020 18:14:09 +0800
From: Baolin Wang <baolin.wang7@...il.com>
To: adrian.hunter@...el.com, ulf.hansson@...aro.org
Cc: orsonzhai@...il.com, zhang.lyra@...il.com, baolin.wang7@...il.com,
arnd@...db.de, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/3] mmc: host: Introduce the request_atomic() for the host
The SD host controller can process one request in the atomic context if
the card is nonremovable, which means we can submit next request in the
irq hard handler when using the MMC host software queue to reduce the
latency. Thus this patch adds a new API request_atomic() for the host
controller, as well as adding support for host software queue to submit
a request by the new request_atomic() API.
Suggested-by: Adrian Hunter <adrian.hunter@...el.com>
Signed-off-by: Baolin Wang <baolin.wang7@...il.com>
---
drivers/mmc/host/mmc_hsq.c | 5 ++++-
include/linux/mmc/host.h | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/mmc_hsq.c b/drivers/mmc/host/mmc_hsq.c
index 59d2776..fdbaa98 100644
--- a/drivers/mmc/host/mmc_hsq.c
+++ b/drivers/mmc/host/mmc_hsq.c
@@ -41,7 +41,10 @@ static void mmc_hsq_pump_requests(struct mmc_hsq *hsq)
spin_unlock_irqrestore(&hsq->lock, flags);
- mmc->ops->request(mmc, hsq->mrq);
+ if (mmc->ops->request_atomic)
+ mmc->ops->request_atomic(mmc, hsq->mrq);
+ else
+ mmc->ops->request(mmc, hsq->mrq);
}
static void mmc_hsq_update_next_tag(struct mmc_hsq *hsq, int remains)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 562ed06..db5e59c 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -92,6 +92,9 @@ struct mmc_host_ops {
int err);
void (*pre_req)(struct mmc_host *host, struct mmc_request *req);
void (*request)(struct mmc_host *host, struct mmc_request *req);
+ /* Submit one request to host in atomic context. */
+ void (*request_atomic)(struct mmc_host *host,
+ struct mmc_request *req);
/*
* Avoid calling the next three functions too often or in a "fast
--
1.9.1
Powered by blists - more mailing lists