]> git.baikalelectronics.ru Git - uboot.git/commit
ti: clocks: Fix do_enable_clocks() to accept NULL pointers as input parameters
authorLukasz Majewski <lukma@denx.de>
Mon, 27 Mar 2017 08:15:27 +0000 (10:15 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 9 Apr 2017 01:32:49 +0000 (21:32 -0400)
commit2e9d32dcc2e1532944ec620a1faed40f2fc232d7
tree6140b1c2558d9ded11ac49251810296c6505bd41
parent845f57438905f69245a2fe267b8a951b1daec43b
ti: clocks: Fix do_enable_clocks() to accept NULL pointers as input parameters

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: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-omap2/clocks-common.c