Skip to content

Commit 90bdfa0

Browse files
committed
ARM: OMAP2+: Fix ti_sysc_find_one_clockdomain to check for to_clk_hw_omap
We must bail out early if the clock is not hw_omap. Otherwise we will try to access invalid address with hwclk->clkdm_name: Unable to handle kernel paging request at virtual address ffffffff Internal error: Oops: 27 [#1] ARM ... (strcmp) from [<c011b348>] (clkdm_lookup+0x40/0x60) [<c011b348>] (clkdm_lookup) from [<c011cb84>] (ti_sysc_clkdm_init+0x5c/0x64) [<c011cb84>] (ti_sysc_clkdm_init) from [<c03680a8>] (sysc_probe+0x948/0x117c) [<c03680a8>] (sysc_probe) from [<c03d0af4>] (platform_drv_probe+0x48/0x98) ... Fixes: 2b2f7de ("bus: ti-sysc: Add support for missing clockdomain handling") Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent e709ed7 commit 90bdfa0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

arch/arm/mach-omap2/pdata-quirks.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,14 @@ static void __init dra7x_evm_mmc_quirk(void)
306306

307307
static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)
308308
{
309+
struct clk_hw *hw = __clk_get_hw(clk);
309310
struct clockdomain *clkdm = NULL;
310311
struct clk_hw_omap *hwclk;
311312

312-
hwclk = to_clk_hw_omap(__clk_get_hw(clk));
313+
hwclk = to_clk_hw_omap(hw);
314+
if (!omap2_clk_is_hw_omap(hw))
315+
return NULL;
316+
313317
if (hwclk && hwclk->clkdm_name)
314318
clkdm = clkdm_lookup(hwclk->clkdm_name);
315319

0 commit comments

Comments
 (0)