Hi Guennadi, On Thu, May 26, 2011 at 10:33 PM, Guennadi Liakhovetski <g.liakhovetski@xxxxxx> wrote: > This patch uses runtime PM to allow the system to power down the MMC > controller, when the MMC closk is switched off. > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx> > --- > > Patches have been submitted earlier for SDHCI to accomplish something > similar, but they have complicated dependencies upon other different > subsystems, especially on PCI. MMCIF is easier - it only exists in > different SoCs, so, this change should also be easier to review, verify > and test. Nice to see improved Power Management for the MMCIF driver! > @@ -901,8 +902,16 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > return; > } > > - if (ios->clock) > + if (ios->clock) { > + if (!host->power) { > + if (p->set_pwr) > + p->set_pwr(host->pd, ios->power_mode); > + pm_runtime_get_sync(&host->pd->dev); > + host->power = true; > + sh_mmcif_sync_reset(host); > + } > sh_mmcif_clock_control(host, ios->clock); You seem to be resetting the MMCIF block regardless if the power has been cut or not. This may work well, but perhaps your code can be improved to not reset when only clocks have been stopped? Resetting when not needed will only result in unnecessary overhead. I believe the Runtime PM suspend/resume callbacks can be used for determining if the power has been cut or not. Please make a V2 on top of Rafael's power domain control code later when 2.6.40-rc has been released. Thanks! / magnus -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html