From: sashiko-bot@kernel.org
To: ziniu.wang_1@oss.nxp.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v5 2/8] mmc: sdhci-esdhc-imx: restore DLL override for DDR modes on resume
Date: Tue, 07 Jul 2026 11:15:50 +0000 [thread overview]
Message-ID: <20260707111551.2B7F11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707110303.3779799-3-ziniu.wang_1@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Unbalanced `disable_irq()` on system resume if `sdhci_enable_irq_wakeups()` fails or returns false.
--
--- Patch [2]: [PATCH v5 2/8] mmc: sdhci-esdhc-imx: restore DLL override for DDR modes on resume ---
commit 61cde7a0a044133654432ad08827554658f6a4b1
Author: Luke Wang <ziniu.wang_1@nxp.com>
mmc: sdhci-esdhc-imx: restore DLL override for DDR modes on resume
This commit extracts the DLL override setup into a helper function and
calls it during the resume path for SDIO devices operating in DDR timing
modes that keep power.
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 6526d65538de5..7230d70e02ae1 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
[ ... ]
> @@ -2123,9 +2131,18 @@ static int sdhci_esdhc_resume(struct device *dev)
[Severity: High]
This is a pre-existing issue, but could this code lead to an unbalanced
disable_irq() on system resume?
Looking at sdhci_esdhc_suspend(), the IRQ is unconditionally disabled
if device_may_wakeup(dev) is true:
disable_irq(host->irq);
ret = sdhci_enable_irq_wakeups(host);
However, if sdhci_enable_irq_wakeups() fails or returns false (for example,
if no wake-capable SDIO card is present and CD IRQ wakeup is disabled),
host->irq_wake_enabled remains false.
During sdhci_esdhc_resume(), enable_irq() appears to be executed conditionally
based on host->irq_wake_enabled:
if (host->irq_wake_enabled) {
sdhci_disable_irq_wakeups(host);
enable_irq(host->irq);
}
If host->irq_wake_enabled is false, would the re-enablement be skipped?
Could this permanently disable the SDHCI controller's main interrupt after a
system suspend/resume cycle, rendering the MMC controller unusable and
potentially leading to a system crash if it is the rootfs device?
> * restore the saved tuning delay value for the device which keep
> * power during system PM.
> */
> - if (mmc_card_keep_power(host->mmc) && esdhc_is_usdhc(imx_data))
> + if (mmc_card_keep_power(host->mmc) && esdhc_is_usdhc(imx_data)) {
> sdhc_esdhc_tuning_restore(host);
>
> + /*
> + * Restore DLL override for DDR modes. hwinit unconditionally
> + * clears ESDHC_DLL_CTRL, but the card is still in DDR mode.
> + */
> + if (host->timing == MMC_TIMING_UHS_DDR50 ||
> + host->timing == MMC_TIMING_MMC_DDR52)
> + esdhc_set_dll_override(host);
> + }
> +
> pm_runtime_put_autosuspend(dev);
>
> return ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707110303.3779799-1-ziniu.wang_1@oss.nxp.com?part=2
next prev parent reply other threads:[~2026-07-07 11:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 11:02 [PATCH v5 0/8] mmc: sdhci-esdhc-imx: fix SDIO suspend/resume issues ziniu.wang_1
2026-07-07 11:02 ` [PATCH v5 1/8] mmc: sdhci-esdhc-imx: remove unnecessary mmc_card_wake_sdio_irq check for tuning save/restore ziniu.wang_1
2026-07-07 11:02 ` [PATCH v5 2/8] mmc: sdhci-esdhc-imx: restore DLL override for DDR modes on resume ziniu.wang_1
2026-07-07 11:15 ` sashiko-bot [this message]
2026-07-07 11:02 ` [PATCH v5 3/8] mmc: sdhci-esdhc-imx: fix esdhc_change_pinstate() to allow default state restore ziniu.wang_1
2026-07-07 11:17 ` sashiko-bot
2026-07-07 19:02 ` Frank Li
2026-07-07 11:02 ` [PATCH v5 4/8] mmc: sdhci-esdhc-imx: restore pinctrl before restoring ios timing on resume ziniu.wang_1
2026-07-07 11:16 ` sashiko-bot
2026-07-07 11:03 ` [PATCH v5 5/8] mmc: sdhci-esdhc-imx: disable irq during suspend to fix unhandled interrupt ziniu.wang_1
2026-07-07 11:03 ` [PATCH v5 6/8] mmc: sdhci-esdhc-imx: use pm_runtime_resume_and_get() in suspend ziniu.wang_1
2026-07-07 11:12 ` sashiko-bot
2026-07-07 11:03 ` [PATCH v5 7/8] mmc: sdhci-esdhc-imx: make non-fatal errors non-blocking " ziniu.wang_1
2026-07-07 11:14 ` sashiko-bot
2026-07-07 11:03 ` [PATCH v5 8/8] mmc: sdhci-esdhc-imx: fix resume error handling ziniu.wang_1
2026-07-07 11:16 ` sashiko-bot
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=20260707111551.2B7F11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=ziniu.wang_1@oss.nxp.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