Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1539146rdh; Fri, 27 Oct 2023 19:13:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExzY9TCorIqHLynp0//3Qw+VjHAoLEMeZKPMIOVGrN2uoecZ2Qv011ugBgieJM1+ltg+4N X-Received: by 2002:aa7:8890:0:b0:6ba:4f2e:33ca with SMTP id z16-20020aa78890000000b006ba4f2e33camr5000025pfe.2.1698459224801; Fri, 27 Oct 2023 19:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698459224; cv=none; d=google.com; s=arc-20160816; b=SMQ0g0R6gNjX9IZZwBss6jMkNnvX+gdjUj9BWvHceNmFqM2/NMxIgNdlIHLxtKrNzf 4zCuFakWiA+7dYQljiE3/c5HF/k7TMxffJx6mU92GR8SALBO54wzfwLuXV+5ZOjNYJ71 cY3hDZuURzyfPc8iEiJECE7aVX/DZ36DQCu1m92RWsPaDUXZwTn78hQacDEu9UuVUrWE Yghyu1+RXVF4e9tjs5rsqKYu881AmCAQNH4DEnilJ9w6JlNcEkfDGy58z05v1BNpBRQn zbPDQl5TgRu74Uh4DBnXfxiGZX8mFs9bl9A0HNqK9AftAhbjUCHnATA1Lxpt2w+Cw/MH 2aLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=SP4XRBefB7saZs3AVFDrH14uJmpfek50CqylL2w0XhY=; fh=7frkHggPVOvHwHmxFToX+ZBuKuEYz4wFMgXBA/KS/4s=; b=tV8jKcxD1PLf8wsPpCVi7osiTWC3RgV/rnCp2m57EKDLMv7M2mdmxnK0Jlu5ubAukA xe0oYRZMNZ+IqXH9mrxu5N6WKl5cTuR4gNaB8pwMvh9+R3ITt031CAB7r5lAY3CbbdLs W3+6tQQCqF4Ce5EUr28vVzz4Ikr1etIXaO9LIKtYY4NKaObYRZy3P7SwISssFvy+KYJ1 huYQT719n0p5cBnQLfuFduxl0Ts1sT2L6/eHURhzByLlqHqybNK3xJh7CiphUsS/117C MVFIYZmr/CzLbAX7/HZw8MBHzja6NqEkJQVX64+CXxadpFxNGRHx3plHOoUskChBOOnB MMcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Go6m+efw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id o10-20020a656a4a000000b005b8f24e6526si1938490pgu.234.2023.10.27.19.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 19:13:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Go6m+efw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3A38982972F2; Fri, 27 Oct 2023 19:13:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232983AbjJ1CNV (ORCPT + 99 others); Fri, 27 Oct 2023 22:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ1CNV (ORCPT ); Fri, 27 Oct 2023 22:13:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D32FB; Fri, 27 Oct 2023 19:13:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 921F2C433C7; Sat, 28 Oct 2023 02:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698459198; bh=SP4XRBefB7saZs3AVFDrH14uJmpfek50CqylL2w0XhY=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Go6m+efwnkyKZFLqYKfiPTqolZBTW4oKJxglZCgGOd83fwNMCycMVbrNzkRohpSbb Zxvsyh2QH13GMtOIGytzbZYYZC7p1ITl6HdPXP7DmDfASeXg+vw4PLTcY5Z82TrpP+ p4CzGmEJXzVDseM7eT67xJ1z+VmWaFRv4NVAuEZuQBg6mSX+KFIL2AUnnelWy8hRk+ KGHICGCz9uxdYiRitzLVRr6lGmkTvHV80BhsCoI4YwzrXoJ9Cogh0/oM5IwMdAEB+/ NUFvewg8QVvJprFtspdqRiuNrRQPMhKd4+1+SOUmmqJB1NmH0AtMqPN5peKTTwZn64 MmRW+4gj8PM/g== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231027225821.95833-1-sboyd@kernel.org> References: <20231027225821.95833-1-sboyd@kernel.org> Subject: Re: [PATCH] clk: Fix clk gate kunit test on big-endian CPUs From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, patches@lists.linux.dev, Boqun Feng To: Michael Turquette , Stephen Boyd Date: Fri, 27 Oct 2023 19:13:16 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 19:13:42 -0700 (PDT) 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. >=20 > 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. >=20 > Reported-by: Boqun Feng > Closes: https://lore.kernel.org/r/ZTLH5o0GlFBYsAHq@boqun-archlinux > Tested-by: Boqun Feng > Signed-off-by: Stephen Boyd > --- Applied to clk-next