Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
"The typical collection of minor bug fixes in clk drivers. We don't
have anything in the core framework here, just driver fixes.

There's a boot fix for Samsung devices and a safety measure for qoriq
to prevent CPUs from running too fast. There's also a fix for i.MX6Q
to properly handle audio clock rates. We also have some "that's
obviously wrong" fixes like bad NULL pointer checks in the MPP driver
and a poor usage of __pa in the xgene clk driver that are fixed here"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
clk: mmp: pxa910: fix return value check in pxa910_clk_init()
clk: mmp: pxa168: fix return value check in pxa168_clk_init()
clk: mmp: mmp2: fix return value check in mmp2_clk_init()
clk: qoriq: Don't allow CPU clocks higher than starting value
clk: imx: fix integer overflow in AV PLL round rate
clk: xgene: Don't call __pa on ioremaped address
clk/samsung: Use CLK_OF_DECLARE_DRIVER initialization method for CLKOUT
clk: rockchip: don't return NULL when failing to register ddrclk branch

+37 -29
+8 -5
drivers/clk/clk-qoriq.c
··· 700 700 struct mux_hwclock *hwc, 701 701 const struct clk_ops *ops, 702 702 unsigned long min_rate, 703 + unsigned long max_rate, 703 704 unsigned long pct80_rate, 704 705 const char *fmt, int idx) 705 706 { ··· 728 727 rate > pct80_rate) 729 728 continue; 730 729 if (rate < min_rate) 730 + continue; 731 + if (rate > max_rate) 731 732 continue; 732 733 733 734 parent_names[j] = div->name; ··· 762 759 struct mux_hwclock *hwc; 763 760 const struct clockgen_pll_div *div; 764 761 unsigned long plat_rate, min_rate; 765 - u64 pct80_rate; 762 + u64 max_rate, pct80_rate; 766 763 u32 clksel; 767 764 768 765 hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); ··· 790 787 return NULL; 791 788 } 792 789 793 - pct80_rate = clk_get_rate(div->clk); 794 - pct80_rate *= 8; 790 + max_rate = clk_get_rate(div->clk); 791 + pct80_rate = max_rate * 8; 795 792 do_div(pct80_rate, 10); 796 793 797 794 plat_rate = clk_get_rate(cg->pll[PLATFORM_PLL].div[PLL_DIV1].clk); ··· 801 798 else 802 799 min_rate = plat_rate / 2; 803 800 804 - return create_mux_common(cg, hwc, &cmux_ops, min_rate, 801 + return create_mux_common(cg, hwc, &cmux_ops, min_rate, max_rate, 805 802 pct80_rate, "cg-cmux%d", idx); 806 803 } 807 804 ··· 816 813 hwc->reg = cg->regs + 0x20 * idx + 0x10; 817 814 hwc->info = cg->info.hwaccel[idx]; 818 815 819 - return create_mux_common(cg, hwc, &hwaccel_ops, 0, 0, 816 + return create_mux_common(cg, hwc, &hwaccel_ops, 0, ULONG_MAX, 0, 820 817 "cg-hwaccel%d", idx); 821 818 } 822 819
+4 -6
drivers/clk/clk-xgene.c
··· 463 463 struct xgene_clk *pclk = to_xgene_clk(hw); 464 464 unsigned long flags = 0; 465 465 u32 data; 466 - phys_addr_t reg; 467 466 468 467 if (pclk->lock) 469 468 spin_lock_irqsave(pclk->lock, flags); 470 469 471 470 if (pclk->param.csr_reg != NULL) { 472 471 pr_debug("%s clock enabled\n", clk_hw_get_name(hw)); 473 - reg = __pa(pclk->param.csr_reg); 474 472 /* First enable the clock */ 475 473 data = xgene_clk_read(pclk->param.csr_reg + 476 474 pclk->param.reg_clk_offset); 477 475 data |= pclk->param.reg_clk_mask; 478 476 xgene_clk_write(data, pclk->param.csr_reg + 479 477 pclk->param.reg_clk_offset); 480 - pr_debug("%s clock PADDR base %pa clk offset 0x%08X mask 0x%08X value 0x%08X\n", 481 - clk_hw_get_name(hw), &reg, 478 + pr_debug("%s clk offset 0x%08X mask 0x%08X value 0x%08X\n", 479 + clk_hw_get_name(hw), 482 480 pclk->param.reg_clk_offset, pclk->param.reg_clk_mask, 483 481 data); 484 482 ··· 486 488 data &= ~pclk->param.reg_csr_mask; 487 489 xgene_clk_write(data, pclk->param.csr_reg + 488 490 pclk->param.reg_csr_offset); 489 - pr_debug("%s CSR RESET PADDR base %pa csr offset 0x%08X mask 0x%08X value 0x%08X\n", 490 - clk_hw_get_name(hw), &reg, 491 + pr_debug("%s csr offset 0x%08X mask 0x%08X value 0x%08X\n", 492 + clk_hw_get_name(hw), 491 493 pclk->param.reg_csr_offset, pclk->param.reg_csr_mask, 492 494 data); 493 495 }
+6 -2
drivers/clk/imx/clk-pllv3.c
··· 223 223 temp64 *= mfn; 224 224 do_div(temp64, mfd); 225 225 226 - return (parent_rate * div) + (u32)temp64; 226 + return parent_rate * div + (unsigned long)temp64; 227 227 } 228 228 229 229 static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate, ··· 247 247 do_div(temp64, parent_rate); 248 248 mfn = temp64; 249 249 250 - return parent_rate * div + parent_rate * mfn / mfd; 250 + temp64 = (u64)parent_rate; 251 + temp64 *= mfn; 252 + do_div(temp64, mfd); 253 + 254 + return parent_rate * div + (unsigned long)temp64; 251 255 } 252 256 253 257 static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
+1 -1
drivers/clk/mmp/clk-of-mmp2.c
··· 313 313 } 314 314 315 315 pxa_unit->apmu_base = of_iomap(np, 1); 316 - if (!pxa_unit->mpmu_base) { 316 + if (!pxa_unit->apmu_base) { 317 317 pr_err("failed to map apmu registers\n"); 318 318 return; 319 319 }
+1 -1
drivers/clk/mmp/clk-of-pxa168.c
··· 262 262 } 263 263 264 264 pxa_unit->apmu_base = of_iomap(np, 1); 265 - if (!pxa_unit->mpmu_base) { 265 + if (!pxa_unit->apmu_base) { 266 266 pr_err("failed to map apmu registers\n"); 267 267 return; 268 268 }
+2 -2
drivers/clk/mmp/clk-of-pxa910.c
··· 282 282 } 283 283 284 284 pxa_unit->apmu_base = of_iomap(np, 1); 285 - if (!pxa_unit->mpmu_base) { 285 + if (!pxa_unit->apmu_base) { 286 286 pr_err("failed to map apmu registers\n"); 287 287 return; 288 288 } ··· 294 294 } 295 295 296 296 pxa_unit->apbcp_base = of_iomap(np, 3); 297 - if (!pxa_unit->mpmu_base) { 297 + if (!pxa_unit->apbcp_base) { 298 298 pr_err("failed to map apbcp registers\n"); 299 299 return; 300 300 }
+1 -4
drivers/clk/rockchip/clk-ddr.c
··· 144 144 ddrclk->ddr_flag = ddr_flag; 145 145 146 146 clk = clk_register(NULL, &ddrclk->hw); 147 - if (IS_ERR(clk)) { 148 - pr_err("%s: could not register ddrclk %s\n", __func__, name); 147 + if (IS_ERR(clk)) 149 148 kfree(ddrclk); 150 - return NULL; 151 - } 152 149 153 150 return clk; 154 151 }
+14 -8
drivers/clk/samsung/clk-exynos-clkout.c
··· 132 132 pr_err("%s: failed to register clkout clock\n", __func__); 133 133 } 134 134 135 + /* 136 + * We use CLK_OF_DECLARE_DRIVER initialization method to avoid setting 137 + * the OF_POPULATED flag on the pmu device tree node, so later the 138 + * Exynos PMU platform device can be properly probed with PMU driver. 139 + */ 140 + 135 141 static void __init exynos4_clkout_init(struct device_node *node) 136 142 { 137 143 exynos_clkout_init(node, EXYNOS4_CLKOUT_MUX_MASK); 138 144 } 139 - CLK_OF_DECLARE(exynos4210_clkout, "samsung,exynos4210-pmu", 145 + CLK_OF_DECLARE_DRIVER(exynos4210_clkout, "samsung,exynos4210-pmu", 140 146 exynos4_clkout_init); 141 - CLK_OF_DECLARE(exynos4212_clkout, "samsung,exynos4212-pmu", 147 + CLK_OF_DECLARE_DRIVER(exynos4212_clkout, "samsung,exynos4212-pmu", 142 148 exynos4_clkout_init); 143 - CLK_OF_DECLARE(exynos4412_clkout, "samsung,exynos4412-pmu", 149 + CLK_OF_DECLARE_DRIVER(exynos4412_clkout, "samsung,exynos4412-pmu", 144 150 exynos4_clkout_init); 145 - CLK_OF_DECLARE(exynos3250_clkout, "samsung,exynos3250-pmu", 151 + CLK_OF_DECLARE_DRIVER(exynos3250_clkout, "samsung,exynos3250-pmu", 146 152 exynos4_clkout_init); 147 153 148 154 static void __init exynos5_clkout_init(struct device_node *node) 149 155 { 150 156 exynos_clkout_init(node, EXYNOS5_CLKOUT_MUX_MASK); 151 157 } 152 - CLK_OF_DECLARE(exynos5250_clkout, "samsung,exynos5250-pmu", 158 + CLK_OF_DECLARE_DRIVER(exynos5250_clkout, "samsung,exynos5250-pmu", 153 159 exynos5_clkout_init); 154 - CLK_OF_DECLARE(exynos5410_clkout, "samsung,exynos5410-pmu", 160 + CLK_OF_DECLARE_DRIVER(exynos5410_clkout, "samsung,exynos5410-pmu", 155 161 exynos5_clkout_init); 156 - CLK_OF_DECLARE(exynos5420_clkout, "samsung,exynos5420-pmu", 162 + CLK_OF_DECLARE_DRIVER(exynos5420_clkout, "samsung,exynos5420-pmu", 157 163 exynos5_clkout_init); 158 - CLK_OF_DECLARE(exynos5433_clkout, "samsung,exynos5433-pmu", 164 + CLK_OF_DECLARE_DRIVER(exynos5433_clkout, "samsung,exynos5433-pmu", 159 165 exynos5_clkout_init);