Re: MMC: Make the configuration memory resource optional

Ian Molton
2009-08-05T14:10:24Z

Guennadi Liakhovetski wrote:
> Hi Ian

Hi,

> With my patches the tmio_mmc_clk_stop() function looked like this
> (pseudocode):
>
> tmio_mmc_clk_stop()
> {
> CTL_CLK_AND_WAIT_CTL = 0x0000;
> msleep(10);
> CTL_SD_CARD_CLK_CTL &= ~0x0100;
> msleep(10);
> clk_disable(clk);
> }
>
> I splitted the clk_disable() call out in a separate function and moved
> _only_ it after the reset() call - it worked too. Does this answer your
> question?

What is clk? HCLK?

If so, then I'm not surprised it didn't work. tmio_mmc_clk_stop/start()
are for controlling the card clock.

What you have done is too disable the host clock when you disable the
card clock. Frankly, I'm amazed it worked at all.

The correct fix would be to remove the clk_disable(clk) from your
function. The host clock should be running constantly (unless
suspended). The card clock is gated.

You should probably also check the placement of wherever your
clk_enable() is too.

-Ian