From: sashiko-bot@kernel.org
To: ziniu.wang_1@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v5 7/8] mmc: sdhci-esdhc-imx: make non-fatal errors non-blocking in suspend
Date: Tue, 07 Jul 2026 11:14:31 +0000 [thread overview]
Message-ID: <20260707111431.8A66A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707110303.3779799-8-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] Ignoring `pm_runtime_force_suspend()` failure leads to an unbalanced PM state and potential system crash during resume.
--
--- Patch [7]: [PATCH v5 7/8] mmc: sdhci-esdhc-imx: make non-fatal errors non-blocking in suspend ---
commit 4c281f4618f6273e8644ab8fb66535c0ebe7c6e2
Author: Luke Wang <ziniu.wang_1@nxp.com>
mmc: sdhci-esdhc-imx: make non-fatal errors non-blocking in suspend
This commit modifies the suspend path of the sdhci-esdhc-imx driver to
make failures in pinctrl_pm_select_sleep_state() and mmc_gpio_set_cd_wake()
non-fatal. It logs warnings instead of returning an error for these cases
and changes sdhci_esdhc_suspend() to always return 0 on completion.
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 7818f351a58ae..6cb84690fde4e 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
[ ... ]
> @@ -2108,7 +2110,7 @@ static int sdhci_esdhc_suspend(struct device *dev)
> */
> pm_runtime_force_suspend(dev);
>
> - return ret;
> + return 0;
> }
[Severity: High]
This is a pre-existing issue, but does ignoring the return value of
pm_runtime_force_suspend() lead to an unbalanced PM state?
If pm_runtime_force_suspend() fails (for example, if cqhci_suspend() times
out and returns -ETIMEDOUT), the device's runtime PM status will remain
RPM_ACTIVE, but the suspend process continues.
Upon system resume, sdhci_esdhc_resume() calls pm_runtime_force_resume().
Because pm_runtime_force_resume() checks pm_runtime_status_suspended(), it
will see RPM_ACTIVE and assume the device is already active, skipping the
driver's runtime_resume callback.
Since the runtime_resume callback is skipped, cqhci_resume() is never called
to reinitialize the Command Queuing Engine (CQE), and clock enablement might
also be skipped. Subsequent accesses to the hardware in
sdhci_esdhc_imx_hwinit() or later MMC operations could then trigger a
synchronous external abort (if clocks are off) or lead to I/O errors
(due to an uninitialized CQE).
If the error from pm_runtime_force_suspend() is propagated instead, shouldn't
the driver also roll back the operations performed earlier in
sdhci_esdhc_suspend(), specifically disable_irq() and
pm_runtime_resume_and_get(), since the PM core will abort the suspend and
will not call sdhci_esdhc_resume() for this device?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707110303.3779799-1-ziniu.wang_1@oss.nxp.com?part=7
next prev parent reply other threads:[~2026-07-07 11:14 UTC|newest]
Thread overview: 20+ 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
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-08 6:38 ` Luke Wang (OSS)
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 [this message]
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
2026-07-08 5:58 ` Luke Wang (OSS)
2026-07-10 13:19 ` [PATCH v5 0/8] mmc: sdhci-esdhc-imx: fix SDIO suspend/resume issues Ulf Hansson
2026-07-13 4:40 ` 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=20260707111431.8A66A1F000E9@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.