From: Sergey Khimich <serghox@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mmc@vger.kernel.org,
Adrian Hunter <adrian.hunter@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Shawn Lin <shawn.lin@rock-chips.com>,
Jyan Chou <jyanchou@realtek.com>
Subject: [PATCH v2 1/2] mmc: cqhci: Add cqhci_set_tran_desc() callback
Date: Tue, 26 Sep 2023 12:02:41 +0300 [thread overview]
Message-ID: <20230926090242.105020-2-serghox@gmail.com> (raw)
In-Reply-To: <20230926090242.105020-1-serghox@gmail.com>
From: Sergey Khimich <serghox@gmail.com>
There are could be specific limitations for some mmc
controllers for preparing and setting cqhci transfer
descriptors. So add callback to allow implement
driver specific function.
Signed-off-by: Sergey Khimich <serghox@gmail.com>
---
drivers/mmc/host/cqhci-core.c | 5 +++++
drivers/mmc/host/cqhci.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
index b3d7d6d8d654..22be6b0b32ca 100644
--- a/drivers/mmc/host/cqhci-core.c
+++ b/drivers/mmc/host/cqhci-core.c
@@ -516,6 +516,11 @@ static int cqhci_prep_tran_desc(struct mmc_request *mrq,
desc = get_trans_desc(cq_host, tag);
+ if (cq_host->ops->prep_tran_desc) {
+ cq_host->ops->prep_tran_desc(data, cq_host, desc, sg_count);
+ return 0;
+ }
+
for_each_sg(data->sg, sg, sg_count, i) {
addr = sg_dma_address(sg);
len = sg_dma_len(sg);
diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
index 1a12e40a02e6..c473d8994ca4 100644
--- a/drivers/mmc/host/cqhci.h
+++ b/drivers/mmc/host/cqhci.h
@@ -293,6 +293,9 @@ struct cqhci_host_ops {
int (*program_key)(struct cqhci_host *cq_host,
const union cqhci_crypto_cfg_entry *cfg, int slot);
#endif
+ void (*prep_tran_desc)(struct mmc_data *data, struct cqhci_host *cq_host,
+ u8 *desc, int sg_count);
+
};
static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg)
--
2.30.2
next prev parent reply other threads:[~2023-09-26 9:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 9:02 [PATCH v2 0/2] mmc: sdhci-of-dwcmshc: Add CQE support Sergey Khimich
2023-09-26 9:02 ` Sergey Khimich [this message]
2023-09-27 0:42 ` [PATCH v2 1/2] mmc: cqhci: Add cqhci_set_tran_desc() callback kernel test robot
2023-09-30 0:15 ` kernel test robot
2023-09-26 9:02 ` [PATCH v2 2/2] Implement SDHCI CQE support for DesignWare SDHCI Sergey Khimich
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=20230926090242.105020-2-serghox@gmail.com \
--to=serghox@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=jyanchou@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=shawn.lin@rock-chips.com \
--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