From: Christophe KERELLO <christophe.kerello@foss.st.com>
To: Mateusz Nowicki <mateusz.nowicki@posteo.net>,
Ulf Hansson <ulfh@kernel.org>, <linux-mmc@vger.kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
Linus Walleij <linusw@kernel.org>,
Yann Gautier <yann.gautier@foss.st.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH 2/3] mmc: mmci: stm32: do not use NEGEDGE in HS200 mode
Date: Mon, 2 Nov 2026 17:48:09 +0100 [thread overview]
Message-ID: <a5fff7cd-686a-4fef-b9f7-87e19b870fa9@foss.st.com> (raw)
In-Reply-To: <20261031120700.42576-3-mateusz.nowicki@posteo.net>
Hello Mateusz,
On 10/31/26 13:07, Mateusz Nowicki wrote:
> RM0457 marks NEGEDGE as not applicable in HS200. With a clock divider it
No, it is not what it is written in the RM. If clkdiv is equal to 0,
NEGEDGE has no effect.
NEGEDGE has an effect only when clkdiv > 0, so it can be used with HS200.
On ST downstream Linux Kernel, you can find following patch not already
upstream:
mmc: mmci: stm32: use the delay block above 100 MHz on stm32mp25 SoC
(Commit ca3b1cf)
By applying previous downstream patch + patch 3 of this patchset +
using original slew rate that was upstream on
this board (slew rate set to 2 for the clock IO, 1 for the others IOs),
HS200 should run on a ST MP25 DK board at 100 MHz.
This patch breaks also MP13 SoC that is supporting HS200.
Regards,
Christophe Kerello.
> corrupts multi-block writes: on the STM32MP257F-DK (st,neg-edge, 200 MHz
> kernel clock, HS200 at 100 MHz) written data read back different. The
> same writes are correct without NEGEDGE.
>
> Fixes: 36240ef8665b ("mmc: mmci: add hs200 support for stm32 sdmmc")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mateusz Nowicki <mateusz.nowicki@posteo.net>
> ---
> RM0457 describes HS200 only without a divider. If HS200 through a
> divider should not be used at all, the alternatives for the DK are:
>
> - Drop mmc-hs200-1_8v from the DK device tree. DDR52 is tested and only
> about 5% slower than HS200 at 100 MHz (read/write 78/66 MiB/s against
> 82/68 MiB/s).
> - Drop st,neg-edge from the DK device tree. This also changes DDR52,
> which was not tested without NEGEDGE.
> - Set the SDMMC2 kernel clock to 150 MHz in the firmware (OP-TEE). HS200
> then runs without a divider (tested, 119/86 MiB/s).
>
> Which way is preferred?
>
> drivers/mmc/host/mmci_stm32_sdmmc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c
> index 9dc51859c2e5..d74efdff6ac2 100644
> --- a/drivers/mmc/host/mmci_stm32_sdmmc.c
> +++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
> @@ -342,6 +342,10 @@ static void mmci_sdmmc_set_clkreg(struct mmci_host *host, unsigned int desired)
> clk |= host->clk_reg_add;
> clk |= ddr;
>
> + /* NEGEDGE is not applicable in HS200 (RM0457), with a divider it corrupts writes */
> + if (host->mmc->ios.timing == MMC_TIMING_MMC_HS200)
> + clk &= ~MCI_STM32_CLK_NEGEDGE;
> +
> if (host->mmc->ios.timing >= MMC_TIMING_UHS_SDR50)
> clk |= MCI_STM32_CLK_BUSSPEED;
>
next prev parent reply other threads:[~2026-11-02 16:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 12:07 [PATCH 0/3] mmc: mmci: stm32: silent data corruption and HS200 fixes Mateusz Nowicki
2026-10-31 12:07 ` [PATCH 1/3] mmc: mmci: do not count a data CRC error as a complete transfer Mateusz Nowicki
2026-10-31 12:07 ` [PATCH 2/3] mmc: mmci: stm32: do not use NEGEDGE in HS200 mode Mateusz Nowicki
2026-11-02 16:48 ` Christophe KERELLO [this message]
2026-10-31 12:07 ` [PATCH 3/3] mmc: mmci: stm32: lock the STM32MP25 delay block again before tuning Mateusz Nowicki
2026-11-02 17:13 ` Christophe KERELLO
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=a5fff7cd-686a-4fef-b9f7-87e19b870fa9@foss.st.com \
--to=christophe.kerello@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=mateusz.nowicki@posteo.net \
--cc=mcoquelin.stm32@gmail.com \
--cc=stable@vger.kernel.org \
--cc=ulfh@kernel.org \
--cc=yann.gautier@foss.st.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
all inboxes | Powered by JetHome®