From: sashiko-bot@kernel.org
To: "Anjana Hari" <anjana.hari@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/2] mmc: sdhci-msm: Add support for firmware-managed resource platforms
Date: Sat, 05 Dec 2026 02:59:15 +0000 [thread overview]
Message-ID: <sashiko-outbox-250959@kernel.org> (raw)
In-Reply-To: <20261205023648.2984145-3-anjana.hari@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mmc: sdhci-msm: sdhci_msm_execute_tuning() leaks
SDHCI_HS400_TUNING on error
--
commit ddd289740c8f9ecd498891abbc15a5d7a0b900b0
Author: Anjana Hari <anjana.hari@oss.qualcomm.com>
mmc: sdhci-msm: Add support for firmware-managed resource platforms
This commit adds support for firmware-managed Qualcomm platforms such as
Nord, where power and clock resources are controlled via SCMI power and
perf domains instead of direct GCC clock and regulator programming.
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index aecd425bf0951..121f7e2fa0ee6 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
[ ... ]
> @@ -1253,7 +1302,13 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
> */
> if (host->flags & SDHCI_HS400_TUNING) {
> sdhci_msm_hc_select_mode(host);
> - msm_set_clock_rate_for_bus_mode(host, ios.clock, ios.timing);
> + if (msm_host->fw_managed) {
> + rc = msm_fw_set_clock_rate_for_bus_mode(host, ios.clock);
> + if (rc)
> + return rc;
> + } else {
> + msm_set_clock_rate_for_bus_mode(host, ios.clock, ios.timing);
> + }
> host->flags &= ~SDHCI_HS400_TUNING;
> }
[Severity: Medium]
Does returning rc here leak SDHCI_HS400_TUNING in host->flags and leave
CORE_VENDOR_SPEC configured for HS400 MCLK/2 mode?
Because sdhci_msm_execute_tuning() is the only place that clears
SDHCI_HS400_TUNING, an error from msm_fw_set_clock_rate_for_bus_mode() leaves
it latched. Later clock updates then keep forcing msm_hc_select_hs400() and
a 2x multiplier in msm_get_clock_mult_for_bus_mode() for non-HS400 timings.
Clearing SDHCI_HS400_TUNING before returning (and deferring or reverting
sdhci_msm_hc_select_mode() on error) would avoid the leaked state.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205023648.2984145-1-anjana.hari@oss.qualcomm.com?part=2
prev parent reply other threads:[~2026-12-05 2:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 2:36 [PATCH v3 0/2] mmc: sdhci-msm: Add firmware-managed resource support for Nord SDCC Anjana Hari
2026-12-05 2:36 ` [PATCH v3 1/2] dt-bindings: mmc: sdhci-msm: Document " Anjana Hari
2026-12-05 2:52 ` sashiko-bot
2026-12-05 2:36 ` [PATCH v3 2/2] mmc: sdhci-msm: Add support for firmware-managed resource platforms Anjana Hari
2026-12-05 2:59 ` sashiko-bot [this message]
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-250959@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=anjana.hari@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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