[PATCH v4] GPIO PL061: Adding Clk framework support

Linus Walleij linus.ml.walleij at gmail.com
Tue Aug 3 09:00:15 EDT 2010


2010/8/3 Kevin Wells <kevin.wells at nxp.com>:

> Wouldn't drivers that use clk_disable in their xxx_suspend functions
> have some problems with this as multiple clk_enables have been called?

Russell already answered that, all drivers have to be augmented
in the following way (this is for PL011, the same will be valid for
any other PrimeCell with aggressive clocking):

[Russell King]
> 1. add an amba_bus_clk_disable() at the end of the successful probe
>  function
> 2. add amba_bus_clk_enable() at the beginning of the remove function.
> 3. add amba_bus_clk_enable()/amba_bus_clk_disable() around each of the
> suspend(), resume(), pl011_console_write(), and
>  pl011_console_get_options() functions.
> 4. amba_bus_clk_enable() at the start of the startup method.
> 5. amba_bus_clk_disable() at the end of the shutdown method.

> AMBA enables clock in amba_probe() <<< clock use count = 1
> pl022 driver enables clock in mmci_probe <<< clock use count = 2
> ...SPI stuff happens...
> ...Linux enters suspend mode...
> pl022 driver enters suspend mode, disables clock <<< clock use count = 1

OK I feel some responsibility for that driver so I will try to fix it,
maybe I can take a round at PL011 and perhaps MMCI as well.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list