mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "ping.gao" <ping.gao@samsung.com>
To: jh80.chung@samsung.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "ping.gao" <ping.gao@samsung.com>
Subject: [PATCH] mmc: dw_mmc: Use pre_request & post_request_end helper
Date: Wed, 10 Dec 2025 10:30:08 +0800	[thread overview]
Message-ID: <20251210023008.1198860-1-ping.gao@samsung.com> (raw)
In-Reply-To: <CGME20251210022622epcas5p3faca823fc4bf50267e4b660d4776cb1d@epcas5p3.samsung.com>

Use vendor drv function to let other vendor can add some vendor function
before and after request

Signed-off-by: ping.gao <ping.gao@samsung.com>
---
 drivers/mmc/host/dw_mmc.c | 7 ++++++-
 drivers/mmc/host/dw_mmc.h | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index c5db92bbb094..04fb92579509 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1416,6 +1416,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 {
 	struct dw_mci_slot *slot = mmc_priv(mmc);
 	struct dw_mci *host = slot->host;
+	const struct dw_mci_drv_data *drv_data = host->drv_data;
 
 	WARN_ON(slot->mrq);
 
@@ -1430,7 +1431,8 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		mmc_request_done(mmc, mrq);
 		return;
 	}
-
+	if (drv_data && drv_data->pre_request)
+		drv_data->pre_request(host);
 	spin_lock_bh(&host->lock);
 
 	dw_mci_queue_request(host, slot, mrq);
@@ -1897,6 +1899,7 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
 {
 	struct dw_mci_slot *slot;
 	struct mmc_host	*prev_mmc = host->slot->mmc;
+	const struct dw_mci_drv_data *drv_data = host->drv_data;
 
 	WARN_ON(host->cmd || host->data);
 
@@ -1921,6 +1924,8 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
 
 	spin_unlock(&host->lock);
 	mmc_request_done(prev_mmc, mrq);
+	if (drv_data && drv_data->post_request_end)
+		drv_data->post_request_end(host);
 	spin_lock(&host->lock);
 }
 
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 648b4a5641bf..6c258e0865e7 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -618,5 +618,7 @@ struct dw_mci_drv_data {
 					  unsigned int timeout_ns);
 	u32		(*get_drto_clks)(struct dw_mci *host);
 	void		(*hw_reset)(struct dw_mci *host);
+	void		(*pre_request)(struct dw_mci *host);
+	void		(*post_request_end)(struct dw_mci *host);
 };
 #endif /* _DW_MMC_H_ */
-- 
2.50.1


       reply	other threads:[~2025-12-10  2:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251210022622epcas5p3faca823fc4bf50267e4b660d4776cb1d@epcas5p3.samsung.com>
2025-12-10  2:30 ` ping.gao [this message]
2025-12-10 10:45   ` Ulf Hansson
     [not found] <CGME20251209064525epcas5p4904259a2a7fb971c077bfa03acce8c79@epcas5p4.samsung.com>
2025-12-09  6:49 ` ping.gao
2025-12-09  7:03   ` Shawn Lin
2025-12-09  9:46   ` Christoph Hellwig
2025-12-09 18:05   ` kernel test robot
2025-12-09 18:57   ` kernel test robot

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=20251210023008.1198860-1-ping.gao@samsung.com \
    --to=ping.gao@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@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

all inboxes | Powered by JetHome®