• Paul Walmsley's avatar
    OMAP clock: track child clocks · c4cd1332
    Paul Walmsley authored
    Track child clocks for each struct clk.  This optimizes traversals of the
    clock tree from parent to child, which happens during rate propagation, and
    in the future, clock notifiers.
    
    Previously, parent-to-child traversals sequentially scanned the entire
    clock list at each step to determine the children of a particular
    clock node.  Now each struct clk maintains a clock list of its
    children.  For a DPLL3_M2_CK rate change, this converts what were
    about O(6*180*2) operations into O(6*6*2) operations.  The savings
    will be even more significant after the future notifier patches:
    something like O(6*180*6) to O(6*6*6).
    
    The price paid is additional runtime memory consumption - 8 bytes per
    clock and 16 bytes per child clock - roughly 4.5KiB on OMAP3.  The
    memory comes mostly from bootmem, since initial clock registration
    takes place before slab is ready.  Several other operations will take
    slightly more time due the extra bookkeeping: clk_register(),
    clk_unregister(), clk_set_parent(), and omap2_init_clksel_parent().
    Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    c4cd1332
clock.c 29.2 KB