• Nishanth Menon's avatar
    clk: ti: divider: Provide error check for incoming parameters in set_rate · 2f103251
    Nishanth Menon authored
    Check for valid parameters in check rate. Else, we end up getting errors
    like:
    [    0.000000] Division by zero in kernel.
    [    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.17.0-rc1 #1
    [    0.000000] [<c0015160>] (unwind_backtrace) from [<c0011978>] (show_stack+0x10/0x14)
    [    0.000000] [<c0011978>] (show_stack) from [<c055f5f4>] (dump_stack+0x78/0x94)
    [    0.000000] [<c055f5f4>] (dump_stack) from [<c02e17cc>] (Ldiv0+0x8/0x10)
    [    0.000000] [<c02e17cc>] (Ldiv0) from [<c047d228>] (ti_clk_divider_set_rate+0x14/0x14c)
    [    0.000000] [<c047d228>] (ti_clk_divider_set_rate) from [<c047a938>] (clk_change_rate+0x138/0x180)
    [    0.000000] [<c047a938>] (clk_change_rate) from [<c047a908>] (clk_change_rate+0x108/0x180)
    
    This occurs as part of the inital clock tree update of child clock nodes
    where new_rate could be 0 for non functional clocks.
    
    Fixes: b4761198 ("CLK: ti: add support for ti divider-clock")
    Signed-off-by: default avatarNishanth Menon <nm@ti.com>
    Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
    2f103251
divider.c 11.3 KB