public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	patches@lists.linux.dev, Boqun Feng <boqun.feng@gmail.com>
Subject: Re: [PATCH] clk: Fix clk gate kunit test on big-endian CPUs
Date: Fri, 27 Oct 2023 19:13:16 -0700	[thread overview]
Message-ID: <c0bc8db56b0ddad197b4e5ee7cd720be.sboyd@kernel.org> (raw)
In-Reply-To: <20231027225821.95833-1-sboyd@kernel.org>

Quoting Stephen Boyd (2023-10-27 15:58:21)
> 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>
> ---

Applied to clk-next

      reply	other threads:[~2023-10-28  2:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27 22:58 [PATCH] clk: Fix clk gate kunit test on big-endian CPUs Stephen Boyd
2023-10-28  2:13 ` Stephen Boyd [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0bc8db56b0ddad197b4e5ee7cd720be.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=patches@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox