Re: [PATCH 2/3] mmc: add MMC_QUIRK_BROKEN_CLK_GATING

Pierre Tardy
2011-01-10T16:57:12Z

>
>
> Since the code is not called that often could you change the above code to:
>
>>       if (mmc_card_sdio(card))
>>               return !(card->quirks & MMC_QUIRK_BROKEN_CLK_GATING);
Well, The comment in the
>        return true;
>
> more obvious that quirk only applies to sdio.

Disagree.Actually, before this code, there is a pretty long comment,
that explain that this quirk only apply to sdio.

If we figure out later that some sdcard does not like clock gating
either, we could add this quirk to those bad sdcard as well.

Here is the whole resulting function. I think this is clear enough:

static bool mmc_host_may_gate_card(struct mmc_card *card)
{

/* If there is no card we may gate it */
if (!card)
return true;
/*
* Don't gate SDIO cards! These need to be clocked at all times
* since they may be independent systems generating interrupts
* and other events. The clock requests counter from the core will
* go down to zero since the core does not need it, but we will not
* gate the clock, because there is somebody out there that may still
* be using it.
*/
return !(card->quirks & MMC_QUIRK_BROKEN_CLK_GATING);

}
Pierre