• Suman Anna's avatar
    ARM: OMAP2+: hwmod: check for module address space during init · 6423d6df
    Suman Anna authored
    The hwmod init sequence involves initializing and idling all the
    hwmods during bootup. If a module class has sysconfig, the init
    sequence utilizes the module register base for performing any
    sysc configuration.
    
    The module address space is being removed from hwmod database and
    retrieved from the <reg> property of the corresponding DT node.
    If a hwmod does not have its corresponding DT node defined and the
    memory address space is not defined in the corresponding
    omap_hwmod_ocp_if, then the module register target address space
    would be NULL and any sysc programming would result in a NULL
    pointer dereference and a kernel boot hang.
    
    Handle this scenario by checking for a valid module address space
    during the _init of each hwmod, and leaving it in the registered
    state if no module register address base is defined in either of
    the hwmod data or the DT data.
    Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
    Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
    Tested-by: default avatarNishanth Menon <nm@ti.com>
    Acked-by: default avatarTony Lindgren <tony@atomide.com>
    [paul@pwsan.com: use -ENXIO rather than -ENOMEM to indicate a missing address
     space error; fixed checkpatch.pl problem]
    Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
    6423d6df
omap_hwmod.c 118 KB