Hi Mark, 2009/2/26 Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>: > Add support for reconfiguring the clock for the ARM core, enabling > CPUfreq support. Currently only the divider for ARMCLK may be changed, > ARMPLL is left static. > > Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> > --- > arch/arm/plat-s3c64xx/s3c6400-clock.c | 76 +++++++++++++++++++++++++++++++++ > 1 files changed, 76 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c > index 8d9a0ca..31c1636 100644 > --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c > +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c <...> > +static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate) > +{ > + unsigned int div; > + u32 val; > + unsigned long flags; > + > + rate = clk_round_rate(clk, rate); > + div = (clk_get_rate(clk->parent) / rate) - 1; > + > + if (div > clk_arm_div_mask()) > + return -EINVAL; > + > + val = __raw_readl(S3C_CLK_DIV0); > + val &= ~clk_arm_div_mask(); > + val |= div; > + > + local_irq_save(flags); > + __raw_writel(val, S3C_CLK_DIV0); > + local_irq_restore(flags); Shouldn't you move local_irq_save(flags) to before the "val = __raw_readl(S3C_CLK_DIV0);" line? Just in case the function gets interrupted by some other entity doing a read-modify-write of S3C_CLK_DIV0? Regards, Magnus Lilja -- To unsubscribe from this list: send the line "unsubscribe cpufreq" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html