2011/1/26 Linus Walleij <linus.walleij@xxxxxxxxxx>: > 2011/1/25 Tardy, Pierre <pierre.tardy@xxxxxxxxx>: >> @@ -1231,6 +1233,27 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) >> goto out; >> >> /* >> + * get/put runtime_pm usage counter at ios->clock transitions >> + * We need to do it before any other chip access, as sdhci could >> + * be power gated >> + */ >> + lastclock = host->iosclock; >> + host->iosclock = ios->clock; >> + if (lastclock == 0 && ios->clock != 0) { >> + spin_unlock_irqrestore(&host->lock, flags); >> + pm_runtime_get_sync(host->mmc->parent); >> + spin_lock_irqsave(&host->lock, flags); >> + } else if (lastclock != 0 && ios->clock == 0) { >> + spin_unlock_irqrestore(&host->lock, flags); >> + pm_runtime_mark_last_busy(host->mmc->parent); >> + pm_runtime_put_autosuspend(host->mmc->parent); >> + spin_lock_irqsave(&host->lock, flags); >> + } >> + /* no need to configure the rest.. */ >> + if (host->iosclock == 0) >> + goto out; >> + >> + /* >> * Reset the chip on each power off. >> * Should clear out any weird states. >> */ > > Aha I get it. So it uses the freq shift from the existing clock gate > code to hint rpm, that's actually how I envisioned that this would > work for this case. > > Now I really started liking this patch. > Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> Which shall be interpreted as for the patch with the above code, not the one which is subject for this post I believe. Pierre, I can't locate your patches for some reason, care to repost them? Yours, Linus Walleij -- 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