From: sashiko-bot@kernel.org
To: ziniu.wang_1@oss.nxp.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v3 1/7] mmc: sdhci-esdhc-imx: remove unnecessary mmc_card_wake_sdio_irq check for tuning save/restore
Date: Mon, 29 Jun 2026 09:29:44 +0000 [thread overview]
Message-ID: <20260629092945.C64A31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629091954.3227151-2-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] This problem wasn't introduced by this patch, but the return value of `pm_runtime_get_sync()` is not checked in `sdhci_esdhc_imx_remove()`, which can lead to a system crash.
--
commit 0d93ff3a6d9920d33acfc34fc6f5408ba83a9030
Author: Luke Wang <ziniu.wang_1@nxp.com>
mmc: sdhci-esdhc-imx: remove unnecessary mmc_card_wake_sdio_irq check for tuning save/restore
The tuning save/restore during system PM is conditioned on
mmc_card_wake_sdio_irq(), but this check is unrelated to whether
tuning values need to be preserved. The actual requirement is that
the card keeps power during suspend and the controller is a uSDHC.
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 18ecddd6df6f2..6526d65538de5 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -2064,8 +2064,7 @@ static int sdhci_esdhc_suspend(struct device *dev)
> * to save the tuning delay value just in case the usdhc
> * lost power during system PM.
> */
> - if (mmc_card_keep_power(host->mmc) && mmc_card_wake_sdio_irq(host->mmc) &&
> - esdhc_is_usdhc(imx_data))
> + if (mmc_card_keep_power(host->mmc) && esdhc_is_usdhc(imx_data))
> sdhc_esdhc_tuning_save(host);
[ ... ]
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing this file I
noticed a potential issue in the nearby sdhci_esdhc_imx_remove() function:
drivers/mmc/host/sdhci-esdhc-imx.c:sdhci_esdhc_imx_remove() {
...
pm_runtime_get_sync(&pdev->dev);
dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
...
}
Should the return value of pm_runtime_get_sync() be checked here?
If pm_runtime_get_sync() fails and the device remains unclocked, could the
subsequent readl() on SDHCI_INT_STATUS trigger a synchronous external abort
or system crash due to accessing unclocked memory-mapped registers?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260629091954.3227151-1-ziniu.wang_1@oss.nxp.com?part=1
next prev parent reply other threads:[~2026-06-29 9:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 9:19 [PATCH v3 0/7] mmc: sdhci-esdhc-imx: fix SDIO suspend/resume issues ziniu.wang_1
2026-06-29 9:19 ` [PATCH v3 1/7] mmc: sdhci-esdhc-imx: remove unnecessary mmc_card_wake_sdio_irq check for tuning save/restore ziniu.wang_1
2026-06-29 9:29 ` sashiko-bot [this message]
2026-06-29 9:35 ` Bough Chen
2026-06-29 9:19 ` [PATCH v3 2/7] mmc: sdhci-esdhc-imx: restore DLL override for DDR modes on resume ziniu.wang_1
2026-06-29 9:30 ` sashiko-bot
2026-06-29 9:39 ` Bough Chen
2026-06-29 9:19 ` [PATCH v3 3/7] mmc: sdhci-esdhc-imx: restore pinctrl before restoring ios timing " ziniu.wang_1
2026-06-29 9:46 ` sashiko-bot
2026-06-29 9:48 ` Bough Chen
2026-06-29 9:19 ` [PATCH v3 4/7] mmc: sdhci-esdhc-imx: disable irq during suspend to fix unhandled interrupt ziniu.wang_1
2026-06-29 9:51 ` Bough Chen
2026-06-29 9:19 ` [PATCH v3 5/7] mmc: sdhci-esdhc-imx: use pm_runtime_resume_and_get() in suspend ziniu.wang_1
2026-06-29 9:46 ` sashiko-bot
2026-06-29 9:19 ` [PATCH v3 6/7] mmc: sdhci-esdhc-imx: make non-fatal errors non-blocking " ziniu.wang_1
2026-06-29 9:57 ` sashiko-bot
2026-06-29 9:19 ` [PATCH v3 7/7] mmc: sdhci-esdhc-imx: fix resume error handling ziniu.wang_1
2026-06-29 9:54 ` sashiko-bot
2026-06-29 10:10 ` Luke Wang (OSS)
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=20260629092945.C64A31F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.