From: Jisheng Zhang <jszhang@kernel.org>
To: Drew Fustini <dfustini@baylibre.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Guo Ren <guoren@kernel.org>, Fu Wei <wefu@redhat.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Conor Dooley <conor@kernel.org>,
Robert Nelson <robertcnelson@beagleboard.org>,
Jason Kridner <jkridner@beagleboard.org>,
Xi Ruoyao <xry111@xry111.site>, Han Gao <gaohan@iscas.ac.cn>,
Icenowy Zheng <uwu@icenowy.me>,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3 2/7] mmc: sdhci: add __sdhci_execute_tuning() to header
Date: Wed, 25 Oct 2023 23:29:25 +0800 [thread overview]
Message-ID: <ZTk0VcFd3FcXIABW@xhacker> (raw)
In-Reply-To: <20231023-th1520-mmc-v3-2-abc5e7491166@baylibre.com>
On Mon, Oct 23, 2023 at 02:07:03PM -0700, Drew Fustini wrote:
> Expose __sdhci_execute_tuning() so that it can be called from the
> mmc host controller drivers.
>
> In the sdhci-of-dwcmshc driver, sdhci_dwcmshc_th1520_ops sets
> platform_execute_tuning to th1520_execute_tuning(). That function has
Hi Drew,
Just FYI, my th1520 version patch in my local repo overrides the
mmc_host_ops.execute_tuning as the following:
host->mmc_host_ops.execute_tuning = dwcmshc_execute_tuning;
In dwcmshc_execute_tuning(), I will do some necessary setting then
call sdhci_execute_tuning();
So I don't need to export __sdhci_execute_tuning(). The main reason
is that the __abc symbol is expected to be used internally. However,
I have no big preference. I would leave the decision be made by
mmc maintainers @Ulf @Adrian, can you please comment?
Thanks
> to manipulate phy registers before tuning can be performed. To avoid
> copying the code verbatim from __sdhci_execute_tuning() into
> th1520_execute_tuning(), make it possible for __sdhci_execute_tuning()
> to be called from sdhci-of-dwcmshc.
>
> Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> ---
> drivers/mmc/host/sdhci.c | 3 ++-
> drivers/mmc/host/sdhci.h | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index ff41aa56564e..c79f73459915 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2841,7 +2841,7 @@ void sdhci_send_tuning(struct sdhci_host *host, u32 opcode)
> }
> EXPORT_SYMBOL_GPL(sdhci_send_tuning);
>
> -static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
> +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
> {
> int i;
>
> @@ -2879,6 +2879,7 @@ static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
> sdhci_reset_tuning(host);
> return -EAGAIN;
> }
> +EXPORT_SYMBOL_GPL(__sdhci_execute_tuning);
>
> int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
> {
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index f219bdea8f28..a20864fc0641 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -793,6 +793,7 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width);
> void sdhci_reset(struct sdhci_host *host, u8 mask);
> void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing);
> int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode);
> +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode);
> void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
> int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
> struct mmc_ios *ios);
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-10-25 15:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 21:07 [PATCH v3 0/7] RISC-V: Add MMC support for TH1520 boards Drew Fustini
2023-10-23 21:07 ` [PATCH v3 1/7] dt-bindings: mmc: sdhci-of-dwcmhsc: Add T-Head TH1520 support Drew Fustini
2023-10-24 7:39 ` Krzysztof Kozlowski
2023-10-23 21:07 ` [PATCH v3 2/7] mmc: sdhci: add __sdhci_execute_tuning() to header Drew Fustini
2023-10-25 15:29 ` Jisheng Zhang [this message]
2023-10-25 18:16 ` Adrian Hunter
2023-10-23 21:07 ` [PATCH v3 3/7] mmc: sdhci-of-dwcmshc: Add support for T-Head TH1520 Drew Fustini
2023-10-25 15:33 ` Jisheng Zhang
2023-10-23 21:07 ` [PATCH v3 4/7] riscv: defconfig: Enable mmc and dma drivers " Drew Fustini
2023-10-23 21:07 ` [PATCH v3 5/7] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock Drew Fustini
2023-10-23 21:07 ` [PATCH v3 6/7] riscv: dts: thead: Enable BeagleV Ahead eMMC and microSD Drew Fustini
2023-10-24 12:16 ` Emil Renner Berthing
2023-10-23 21:07 ` [PATCH v3 7/7] riscv: dts: thead: Enable LicheePi 4A " Drew Fustini
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=ZTk0VcFd3FcXIABW@xhacker \
--to=jszhang@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dfustini@baylibre.com \
--cc=gaohan@iscas.ac.cn \
--cc=guoren@kernel.org \
--cc=jkridner@beagleboard.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robertcnelson@beagleboard.org \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=uwu@icenowy.me \
--cc=wefu@redhat.com \
--cc=xry111@xry111.site \
/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;
as well as URLs for NNTP newsgroup(s).