Skip to content
Snippets Groups Projects
  • Lukasz Majewski's avatar
    b8c90876
    ti: clocks: Fix do_enable_clocks() to accept NULL pointers as input parameters · b8c90876
    Lukasz Majewski authored
    
    Up till this commit passing NULL as input parameter was allowed, but not
    handled properly.
    
    When one passed NULL to one of this function parameters, the code was
    executed causing data abort.
    
    However, what is more interesting, the abort was not caught because of code
    execution in HYP mode with masked CPSR A bit ("Imprecise Data Abort mask bit).
    The TI's AM57xx SoC switch to HYP mode with A bit masked in lowlevel_init.S
    due to SMC call. Such operation (by default) is performed in SoC ROM code.
    
    The problem would pop up when one:
    - Switch back to SVC mode after disabling LPAE support
    - Somebody enables A bit (by executing cpsie a asm instruction)
    
    and then the previously described exception would be caught.
    
    Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
    Reviewed-by: default avatarTom Rini <trini@konsulko.com>
    b8c90876
    History
    ti: clocks: Fix do_enable_clocks() to accept NULL pointers as input parameters
    Lukasz Majewski authored
    
    Up till this commit passing NULL as input parameter was allowed, but not
    handled properly.
    
    When one passed NULL to one of this function parameters, the code was
    executed causing data abort.
    
    However, what is more interesting, the abort was not caught because of code
    execution in HYP mode with masked CPSR A bit ("Imprecise Data Abort mask bit).
    The TI's AM57xx SoC switch to HYP mode with A bit masked in lowlevel_init.S
    due to SMC call. Such operation (by default) is performed in SoC ROM code.
    
    The problem would pop up when one:
    - Switch back to SVC mode after disabling LPAE support
    - Somebody enables A bit (by executing cpsie a asm instruction)
    
    and then the previously described exception would be caught.
    
    Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
    Reviewed-by: default avatarTom Rini <trini@konsulko.com>