diff options
author | Stephen Boyd <sboyd@kernel.org> | 2023-10-28 01:58:21 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-10-28 05:12:09 +0300 |
commit | 75357829cc8ef20808f38b6256fa167f36267c9f (patch) | |
tree | 788deee3a7ac8569b91bf9b99088ba3ee1ce62fa /drivers/clk/Makefile | |
parent | 831187c6946f29ba8309d386d5ca466eec8b9f79 (diff) | |
download | linux-75357829cc8ef20808f38b6256fa167f36267c9f.tar.xz |
clk: Fix clk gate kunit test on big-endian CPUs
The clk gate kunit test checks that the implementation of the basic clk
gate reads and writes the proper bits in an MMIO register. The
implementation of the basic clk gate type uses writel() and readl()
which operate on little-endian registers. This test fails on big-endian
CPUs because the clk gate implementation writes to 'fake_reg' with
writel(), which converts the value to be written to little-endian before
storing the value in the fake register. When the test checks the bits in
the fake register on a big-endian machine it falsely assumes the format
of the register is also big-endian, when it is really always
little-endian. Suffice to say things don't work very well.
Mark 'fake_reg' as __le32 and push through endian accessor fixes
wherever the value is inspected to make this test endian agnostic.
There's a CLK_GATE_BIG_ENDIAN flag for big-endian MMIO devices, which
this test isn't using. A follow-up patch will test with and without that
flag.
Reported-by: Boqun Feng <boqun.feng@gmail.com>
Closes: https://lore.kernel.org/r/ZTLH5o0GlFBYsAHq@boqun-archlinux
Tested-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20231027225821.95833-1-sboyd@kernel.org
Diffstat (limited to 'drivers/clk/Makefile')
0 files changed, 0 insertions, 0 deletions