[PATCH v4] GPIO PL061: Adding Clk framework support
From: Linus Walleij <hidden>
Date: 2010-08-03 13:00:15
2010/8/3 Kevin Wells [off-list ref]:
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@PL011 and perhaps MMCI as well. Yours, Linus Walleij