Skip to content

Commit

Permalink
Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturqu…
Browse files Browse the repository at this point in the history
…ette/linux

Pull clock framework fixes from Mike Turquette:
 "Half of the fixes here are for Exynos5, fixing regressions in CPUfreq
  due to the common clock framework conversion as well as one fix which
  allows the platform to properly reboot again.

  One core framework fix patches up a memory leak, another fixes a build
  error for the SPEAr platform and finally a Tegra-specific fix allows
  PCIe to initialize properly on that platform again"

* tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturquette/linux:
  ARM: tegra30: clocks: Fix pciex clock registration
  clk: exynos5250: Add CLK_IGNORE_UNUSED flag for pmu clock
  clk: spear: fix build error for spear3xx
  clk: samsung: Fix pll36xx_recalc_rate to handle kdiv properly
  clk: exynos5250: Add sclk_mpll to the parent list of mout_cpu clock
  clk: exynos5250: Update cpufreq related clocks for EXYNOS5250
  clk: remove notifier from list before freeing it
  • Loading branch information
Linus Torvalds committed Jun 18, 2013
2 parents 8177a9d + ff49fad commit f93f0b9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
/* XXX the notifier code should handle this better */
if (!cn->notifier_head.head) {
srcu_cleanup_notifier_head(&cn->notifier_head);
list_del(&cn->node);
kfree(cn);
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/clk/samsung/clk-exynos5250.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static __initdata unsigned long exynos5250_clk_regs[] = {

/* list of all parent clock list */
PNAME(mout_apll_p) = { "fin_pll", "fout_apll", };
PNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", };
PNAME(mout_cpu_p) = { "mout_apll", "sclk_mpll", };
PNAME(mout_mpll_fout_p) = { "fout_mplldiv2", "fout_mpll" };
PNAME(mout_mpll_p) = { "fin_pll", "mout_mpll_fout" };
PNAME(mout_bpll_fout_p) = { "fout_bplldiv2", "fout_bpll" };
Expand Down Expand Up @@ -208,10 +208,10 @@ struct samsung_fixed_factor_clock exynos5250_fixed_factor_clks[] __initdata = {
};

struct samsung_mux_clock exynos5250_mux_clks[] __initdata = {
MUX(none, "mout_apll", mout_apll_p, SRC_CPU, 0, 1),
MUX(none, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1),
MUX_A(none, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, "mout_apll"),
MUX_A(none, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1, "mout_cpu"),
MUX(none, "mout_mpll_fout", mout_mpll_fout_p, PLL_DIV2_SEL, 4, 1),
MUX(none, "sclk_mpll", mout_mpll_p, SRC_CORE1, 8, 1),
MUX_A(none, "sclk_mpll", mout_mpll_p, SRC_CORE1, 8, 1, "mout_mpll"),
MUX(none, "mout_bpll_fout", mout_bpll_fout_p, PLL_DIV2_SEL, 0, 1),
MUX(none, "sclk_bpll", mout_bpll_p, SRC_CDREX, 0, 1),
MUX(none, "mout_vpllsrc", mout_vpllsrc_p, SRC_TOP2, 0, 1),
Expand Down Expand Up @@ -378,7 +378,7 @@ struct samsung_gate_clock exynos5250_gate_clks[] __initdata = {
GATE(hsi2c3, "hsi2c3", "aclk66", GATE_IP_PERIC, 31, 0, 0),
GATE(chipid, "chipid", "aclk66", GATE_IP_PERIS, 0, 0, 0),
GATE(sysreg, "sysreg", "aclk66", GATE_IP_PERIS, 1, 0, 0),
GATE(pmu, "pmu", "aclk66", GATE_IP_PERIS, 2, 0, 0),
GATE(pmu, "pmu", "aclk66", GATE_IP_PERIS, 2, CLK_IGNORE_UNUSED, 0),
GATE(tzpc0, "tzpc0", "aclk66", GATE_IP_PERIS, 6, 0, 0),
GATE(tzpc1, "tzpc1", "aclk66", GATE_IP_PERIS, 7, 0, 0),
GATE(tzpc2, "tzpc2", "aclk66", GATE_IP_PERIS, 8, 0, 0),
Expand Down
5 changes: 3 additions & 2 deletions drivers/clk/samsung/clk-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ static unsigned long samsung_pll36xx_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct samsung_clk_pll36xx *pll = to_clk_pll36xx(hw);
u32 mdiv, pdiv, sdiv, kdiv, pll_con0, pll_con1;
u32 mdiv, pdiv, sdiv, pll_con0, pll_con1;
s16 kdiv;
u64 fvco = parent_rate;

pll_con0 = __raw_readl(pll->con_reg);
pll_con1 = __raw_readl(pll->con_reg + 4);
mdiv = (pll_con0 >> PLL36XX_MDIV_SHIFT) & PLL36XX_MDIV_MASK;
pdiv = (pll_con0 >> PLL36XX_PDIV_SHIFT) & PLL36XX_PDIV_MASK;
sdiv = (pll_con0 >> PLL36XX_SDIV_SHIFT) & PLL36XX_SDIV_MASK;
kdiv = pll_con1 & PLL36XX_KDIV_MASK;
kdiv = (s16)(pll_con1 & PLL36XX_KDIV_MASK);

fvco *= (mdiv << 16) + kdiv;
do_div(fvco, (pdiv << sdiv));
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/spear/spear3xx_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
clk_register_clkdev(clk, NULL, "60100000.serial");
}
#else
static inline void spear320_clk_init(void) { }
static inline void spear320_clk_init(void __iomem *soc_config_base) { }
#endif

void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base)
Expand Down
11 changes: 6 additions & 5 deletions drivers/clk/tegra/clk-tegra30.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,12 @@ static void __init tegra30_periph_clk_init(void)
clk_register_clkdev(clk, "afi", "tegra-pcie");
clks[afi] = clk;

/* pciex */
clk = tegra_clk_register_periph_gate("pciex", "pll_e", 0, clk_base, 0,
74, &periph_u_regs, periph_clk_enb_refcnt);
clk_register_clkdev(clk, "pciex", "tegra-pcie");
clks[pciex] = clk;

/* kfuse */
clk = tegra_clk_register_periph_gate("kfuse", "clk_m",
TEGRA_PERIPH_ON_APB,
Expand Down Expand Up @@ -1716,11 +1722,6 @@ static void __init tegra30_fixed_clk_init(void)
1, 0, &cml_lock);
clk_register_clkdev(clk, "cml1", NULL);
clks[cml1] = clk;

/* pciex */
clk = clk_register_fixed_rate(NULL, "pciex", "pll_e", 0, 100000000);
clk_register_clkdev(clk, "pciex", NULL);
clks[pciex] = clk;
}

static void __init tegra30_osc_clk_init(void)
Expand Down

0 comments on commit f93f0b9

Please sign in to comment.