ENGR00123283 MX23: clock driver causes ssp_clk change timeout out of suspend

If you boot up and then go into suspend mode, the clk_busy_wait()
 function causes a timeout in the ssp_set_rate function because
 the rate is being set while the clock is disable
 resulting in the busy bit staying false.

Signed-off-by: Robert Lee <robert.lee@freescale.com>
This commit is contained in:
Robert Lee
2010-05-07 15:26:59 -05:00
committed by Matt Sealey
parent e849bc9877
commit 96783bb56e

View File

@@ -1123,13 +1123,7 @@ static int ssp_set_rate(struct clk *clk, unsigned long rate)
int ret = -EINVAL;
u32 reg, div;
/* because SSP_CLK is used by more than one SSP peripheral,
* we only allow the clock to be changed if no driver is currently
* using the clock.
*/
if (clk->ref & CLK_EN_MASK)
return -EBUSY;
local_clk_enable(clk);
/* if the desired clock can be sourced from ref_xtal,
* use ref_xtal to save power
@@ -1155,6 +1149,8 @@ static int ssp_set_rate(struct clk *clk, unsigned long rate)
ret = clk_busy_wait(clk);
out:
local_clk_disable(clk);
if (ret != 0)
printk(KERN_ERR "%s: error %d\n", __func__, ret);
return ret;