From: Kamal Dasu <kamal.dasu@broadcom.com>
To: ulf.hansson@linaro.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, adrian.hunter@intel.com,
linux-mmc@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, wsa+renesas@sang-engineering.com
Cc: f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com,
Kamal Dasu <kdasu@broadcom.com>
Subject: [PATCH RFC 1/3] mmc: add request_start() and request_done() mmc ops
Date: Thu, 6 Feb 2025 17:09:38 -0500 [thread overview]
Message-ID: <20250206220940.10553-2-kamal.dasu@broadcom.com> (raw)
In-Reply-To: <20250206220940.10553-1-kamal.dasu@broadcom.com>
From: Kamal Dasu <kdasu@broadcom.com>
These ops enable host vendor driver to take action on request
start and request done both in case of sdhci and cqe requests.
Signed-off-by: Kamal Dasu <kdasu@broadcom.com>
---
drivers/mmc/core/core.c | 14 +++++++++++++-
include/linux/mmc/host.h | 4 ++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5241528f8b90..a835ebc6282c 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -206,8 +206,11 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
* Request starter must handle retries - see
* mmc_wait_for_req_done().
*/
- if (mrq->done)
+ if (mrq->done) {
mrq->done(mrq);
+ if (host->ops->request_done)
+ host->ops->request_done(host, mrq);
+ }
}
EXPORT_SYMBOL(mmc_request_done);
@@ -340,6 +343,9 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
init_completion(&mrq->cmd_completion);
+ if (host->ops->request_start)
+ host->ops->request_start(host, mrq);
+
mmc_retune_hold(host);
if (mmc_card_removed(host->card))
@@ -437,6 +443,9 @@ int mmc_cqe_start_req(struct mmc_host *host, struct mmc_request *mrq)
{
int err;
+ if (host->ops->request_start)
+ host->ops->request_start(host, mrq);
+
/*
* CQE cannot process re-tuning commands. Caller must hold retuning
* while CQE is in use. Re-tuning can happen here only when CQE has no
@@ -512,6 +521,9 @@ void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq)
}
mrq->done(mrq);
+
+ if (host->ops->request_done)
+ host->ops->request_done(host, mrq);
}
EXPORT_SYMBOL(mmc_cqe_request_done);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 68f09a955a90..739b14117c26 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -171,6 +171,10 @@ 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);
+ void (*request_start)(struct mmc_host *host,
+ struct mmc_request *req);
+ void (*request_done)(struct mmc_host *host,
+ struct mmc_request *req);
/* Submit one request to host in atomic context. */
int (*request_atomic)(struct mmc_host *host,
struct mmc_request *req);
--
2.17.1
next prev parent reply other threads:[~2025-02-06 22:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 22:09 [PATCH RFC 0/3] mmc: sdhci-brcmstb: Add rpmb sharing support Kamal Dasu
2025-02-06 22:09 ` Kamal Dasu [this message]
2025-02-06 22:09 ` [PATCH RFC 2/3] dt-bindings: mmc: brcm,sdhci-brcmstb: Add sdio " Kamal Dasu
2025-02-09 16:30 ` Krzysztof Kozlowski
2025-02-06 22:09 ` [PATCH RFC 3/3] mmc: sdhci-brcmstb: Add rpmb sharing support in host driver Kamal Dasu
2025-02-10 13:21 ` [PATCH RFC 0/3] mmc: sdhci-brcmstb: Add rpmb sharing support Ulf Hansson
2025-02-10 17:09 ` Florian Fainelli
2025-02-11 8:13 ` Avri Altman
2025-02-11 17:01 ` Florian Fainelli
2025-02-11 18:39 ` Avri Altman
2025-03-12 13:17 ` Ulf Hansson
2025-03-12 17:51 ` Florian Fainelli
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=20250206220940.10553-2-kamal.dasu@broadcom.com \
--to=kamal.dasu@broadcom.com \
--cc=adrian.hunter@intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=kdasu@broadcom.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.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