Re: [PATCH v2 2/5] mmc: core: Further avoid re-storing power to the eMMC before a shutdown

From: Wolfram Sang
Date: Tue Apr 08 2025 - 04:09:56 EST



> @@ -2187,11 +2198,12 @@ static int mmc_shutdown(struct mmc_host *host)
> int err = 0;
>
> /*
> - * In a specific case for poweroff notify, we need to resume the card
> - * before we can shutdown it properly.
> + * If the card remains suspended at this point and it was done by using
> + * the sleep-cmd (CMD5), we may need to re-initialize it first, to allow
> + * us to send the preferred poweroff-notification cmd at shutdown.
> */
> if (mmc_can_poweroff_notify(host->card) &&
> - !(host->caps2 & MMC_CAP2_FULL_PWR_CYCLE))
> + !mmc_host_can_poweroff_notify(host, true))

Ooookay, I think I got this logic now. I think it makes sense to make it
more explicit in the comment, though:

"This is then the case when the card is able to handle poweroff
notifications in general but the host could not initiate those for
suspend."

Something like this?

Attachment: signature.asc
Description: PGP signature