fix(rk3588): pmu: fix assembly symbol redefinition
Somehow cpus_pd_req_enter_wfi() gets called multiple times and clang
isn't happy about redefining the same label multiple times (it is an
inline function).
An option could be to force the code to not be inlined (with
__attribute__((noinline))) as removing the explicit inline still made
the compiler inline the code.
This is not an issue on GCC because the compiler doesn't respect the
inline request[1]. If the function is forced inlined with
inline __attribute__((__always_inline__)), the same build issue as found
on clang happens for GCC.
Use a local label[2] instead and make the branch instruction use the
latest previously defined local label instead, so that clang is happy
and the code is consistent with other assembly instructions in this file
which all use local labels.
This gets rid of the following build error on clang:
plat/rockchip/rk3588/drivers/pmu/pmu.c:763:7: error: symbol 'wfi_loop' is already defined
763 | "wfi_loop:\n"
| ^
<inline asm>:5:1: note: instantiated into assembly here
5 | wfi_loop:
| ^
[1] https://www.kernel.org/doc/local/inline.html
[2] https://sourceware.org/binutils/docs/as/Symbol-Names.html Local Labels section
Suggested-by: Boyan Karatotev <boyan.karatotev@arm.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Change-Id: Ie9f55135b2f95a78deb7cbb94f9a62d3ba61e808
1 file changed