From: sashiko-bot@kernel.org
To: "Benoît Monin" <benoit.monin@bootlin.com>
Cc: devicetree@vger.kernel.org, linux-phy@lists.infradead.org,
linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH 20/25] mmc: sdhci-of-dwcmshc: add MT2824 support
Date: Fri, 06 Nov 2026 10:04:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-201169@kernel.org> (raw)
In-Reply-To: <20261106-mt2824-v1-20-86087eaf5af4@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mmc: sdhci-of-dwcmshc: missed reset in
mt2824_set_uhs_signaling()
--
commit f6f9a7802c2857e3d3e847c6a2b7339cbc357a08
Author: Benoît Monin <benoit.monin@bootlin.com>
mmc: sdhci-of-dwcmshc: add MT2824 support
This commit adds support for the Synopsys DWC MSHC controller and PHY on
the Metanoia MT2824 SoC, including card type probing, voltage switching,
and workarounds for HOST_CONTROL2 writes and clock stabilization.
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index 09702022e7087..cb248fc572e21 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
[ ... ]
> @@ -2108,6 +2122,470 @@ static const struct sdhci_ops sdhci_dwcmshc_k230_ops = {
[ ... ]
> +/*
> + * A timing change must write the new bus speed mode to HOST_CONTROL2.
> + * Reset the CMD and DATA lines after the write, while the card clock is
> + * off, so that the next command gets a good response.
> + */
> +static void mt2824_set_uhs_signaling(struct sdhci_host *host,
> + unsigned int timing)
> +{
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
> + u32 reg = dwc_priv->vendor_specific_area1 + DWCMSHC_HOST_CTRL3;
> + u16 ctrl2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
> + u8 ctrl;
> +
> + ctrl = sdhci_readb(host, reg);
> + ctrl &= ~MT2824_HOST_CTRL3_NEGEDGE_DATAOUT;
> + if (timing == MMC_TIMING_MMC_DDR52 ||
> + timing == MMC_TIMING_UHS_DDR50)
> + ctrl |= MT2824_HOST_CTRL3_NEGEDGE_DATAOUT;
> + sdhci_writeb(host, ctrl, reg);
> +
> + dwcmshc_set_uhs_signaling(host, timing);
> + if (sdhci_readw(host, SDHCI_HOST_CONTROL2) != ctrl2)
> + dwcmshc_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
> +}
[Severity: Medium]
Can a driver strength change write to the low byte of SDHCI_HOST_CONTROL2
without triggering the CMD and DATA line reset here?
In sdhci_set_ios(), the updated driver type bits (SDHCI_CTRL_DRV_TYPE_MASK,
in the low byte of SDHCI_HOST_CONTROL2) are written before
set_uhs_signaling() is called:
drivers/mmc/host/sdhci.c:sdhci_set_ios() {
...
sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
host->drv_type = ios->drv_type;
}
host->ops->set_uhs_signaling(host, ios->timing);
...
}
Because mt2824_set_uhs_signaling() samples ctrl2 after that write has
already happened, changing ios->drv_type via mmc_set_driver_type() while
ios->timing is unchanged leaves SDHCI_HOST_CONTROL2 equal to ctrl2 across
dwcmshc_set_uhs_signaling(). The reset is then skipped and the next
command (such as CMD6 during HS200 or UHS-I initialization) gets a broken
response.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-mt2824-v1-0-86087eaf5af4@bootlin.com?part=20
next prev parent reply other threads:[~2026-11-06 10:04 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 9:29 [PATCH 00/25] riscv: add support for the Metanoia MT2824 SoC and MT5824 EVB Benoît Monin
2026-11-06 9:29 ` [PATCH 01/25] dt-bindings: vendor-prefixes: add Metanoia Communications Benoît Monin
2026-11-06 9:35 ` sashiko-bot
2026-11-06 11:17 ` Krzysztof Kozlowski
2026-11-06 11:39 ` Mark Brown
2026-11-06 11:50 ` Krzysztof Kozlowski
2026-11-06 9:29 ` [PATCH 02/25] dt-bindings: riscv: add Metanoia SoC-based boards Benoît Monin
2026-11-06 9:35 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 03/25] dt-bindings: reset: add Metanoia MT2824 Benoît Monin
2026-11-06 9:41 ` sashiko-bot
2026-11-06 11:19 ` Krzysztof Kozlowski
2026-11-06 9:30 ` [PATCH 04/25] dt-bindings: power: reset: add Metanoia MT2824 reboot Benoît Monin
2026-11-06 9:44 ` sashiko-bot
2026-11-06 11:23 ` Krzysztof Kozlowski
2026-11-06 9:30 ` [PATCH 05/25] dt-bindings: phy: add Metanoia USB2 PHY Benoît Monin
2026-11-06 9:42 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 06/25] dt-bindings: cache: andestech,ax45mp-cache: add MT2824 compatible Benoît Monin
2026-11-06 9:35 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 07/25] dt-bindings: interrupt-controller: sifive,plic-1.0.0: add Metanoia MT2824 Benoît Monin
2026-11-06 9:35 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 08/25] dt-bindings: interrupt-controller: andestech,plicsw: " Benoît Monin
2026-11-06 9:35 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 09/25] dt-bindings: timer: andestech,plmt0: " Benoît Monin
2026-11-06 9:36 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 10/25] dt-bindings: mmc: snps,dwcmshc-sdhci: " Benoît Monin
2026-11-06 9:37 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 11/25] dt-bindings: spi: andestech,ae350-spi: make DMA and interrupts optional Benoît Monin
2026-11-06 9:37 ` sashiko-bot
2026-11-06 11:11 ` Mark Brown
2026-11-06 11:49 ` Krzysztof Kozlowski
2026-11-06 9:30 ` [PATCH 12/25] dt-bindings: spi: andestech,ae350-spi: add Metanoia MT2824 Benoît Monin
2026-11-06 9:36 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 13/25] dt-bindings: usb: dwc2: " Benoît Monin
2026-11-06 9:36 ` sashiko-bot
2026-11-06 11:54 ` Krzysztof Kozlowski
2026-11-06 9:30 ` [PATCH 14/25] dt-bindings: watchdog: andestech,ae350-wdt: " Benoît Monin
2026-11-06 9:36 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 15/25] riscv: add ARCH_METANOIA Kconfig entry Benoît Monin
2026-11-06 9:38 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 16/25] reset: simple: add Metanoia MT2824 support Benoît Monin
2026-11-06 9:38 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 17/25] spi: atcspi200: add optional interrupt support Benoît Monin
2026-11-06 9:49 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 18/25] spi: atcspi200: allow building for Metanoia SoCs Benoît Monin
2026-11-06 9:38 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 19/25] watchdog: atcwdt200: " Benoît Monin
2026-11-06 9:43 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 20/25] mmc: sdhci-of-dwcmshc: add MT2824 support Benoît Monin
2026-11-06 10:04 ` sashiko-bot [this message]
2026-11-06 9:30 ` [PATCH 21/25] mmc: sdhci-of-dwcmshc: add MT2824 tuning and HS400 support Benoît Monin
2026-11-06 9:59 ` sashiko-bot
2026-11-06 9:30 ` [PATCH 22/25] phy: metanoia: add USB2 PHY driver Benoît Monin
2026-11-06 9:41 ` sashiko-bot
2026-11-06 9:56 ` Philipp Zabel
2026-11-06 9:30 ` [PATCH 23/25] usb: dwc2: add support for Metanoia MT2824 Benoît Monin
2026-11-06 9:43 ` sashiko-bot
2026-11-06 11:52 ` Krzysztof Kozlowski
2026-11-06 11:52 ` Krzysztof Kozlowski
2026-11-06 9:30 ` [PATCH 24/25] riscv: add Metanoia MT2824 SoC and MT5824 EVB support Benoît Monin
2026-11-06 9:50 ` sashiko-bot
2026-11-06 10:04 ` Philipp Zabel
2026-11-06 11:21 ` Krzysztof Kozlowski
2026-11-06 18:30 ` Conor Dooley
2026-11-06 9:30 ` [PATCH 25/25] MAINTAINERS: add RISC-V Metanoia SoC support Benoît Monin
2026-11-06 11:22 ` Krzysztof Kozlowski
2026-11-06 18:19 ` Conor Dooley
2026-11-06 11:15 ` [PATCH 00/25] riscv: add support for the Metanoia MT2824 SoC and MT5824 EVB Mark Brown
2026-11-06 18:46 ` Conor Dooley
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=sashiko-outbox-201169@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=benoit.monin@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.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