Re: [PATCH] mmc: mmci: stm32: handle mmc power up
From: Marek Vasut
Date: Thu Nov 12 2026 - 01:29:46 EST
On 11/11/26 12:45 PM, Ulf Hansson wrote:
Hello Ulf,
The controller.- if (ios.power_mode == MMC_POWER_OFF) {
+ if (ios.power_mode == MMC_POWER_OFF ||
+ ios.power_mode == MMC_POWER_UP) {
/* Only a reset could power-off sdmmc */
reset_control_assert(host->rst);
udelay(2);
What exactly will this reset?
Okay, I see.
In that case, this reset also makes us reset preceding updates to any
other registers, for example the clock register. I would not recommend
doing that here, but perhaps there is no better option.
Does that pose a problem in the MMC_POWER_OFF/UP state ? I agree this would pose a problem in the MMC_POWER_ON state, but here the card is not ON.
If I may I suggest an alternative solution, perhaps we can manage thisI _think_ so, this seems to be used to power cycle the card.
in the ->runtime_resume() callback instead. If the power_mode ==
MMC_POWER_OFF, perhaps do this reset there instead? Would that work?
Anothing thing that caught my eyes was the MCI_STM32_PWR_CYC bit that
gets written at MMC_POWER_OFF. This bit becomes cached in
host->pwr_reg, hence it's also rewritten at MMC_POWER_ON. Is that
intentional?