From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB7D1C433F5 for ; Wed, 27 Apr 2022 00:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356399AbiD0A27 (ORCPT ); Tue, 26 Apr 2022 20:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244133AbiD0A25 (ORCPT ); Tue, 26 Apr 2022 20:28:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAA8E13F259 for ; Tue, 26 Apr 2022 17:25:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6F07D23A; Tue, 26 Apr 2022 17:25:48 -0700 (PDT) Received: from [10.57.80.98] (unknown [10.57.80.98]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E0443F73B; Tue, 26 Apr 2022 17:25:46 -0700 (PDT) Message-ID: Date: Wed, 27 Apr 2022 01:25:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3 2/3] soc: rockchip: power-domain: Replace dsb() with smb() Content-Language: en-GB To: Peter Geis , Brian Norris Cc: Heiko Stuebner , Arnd Bergmann , "open list:ARM/Rockchip SoC..." , Linux Kernel Mailing List , Guenter Roeck References: <20220426014545.628100-1-briannorris@chromium.org> <20220426014545.628100-2-briannorris@chromium.org> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-04-27 00:55, Peter Geis wrote: > On Mon, Apr 25, 2022 at 9:46 PM Brian Norris wrote: >> >> It's unclear if these are really needed at all, but seemingly their >> purpose is only as a write barrier. Use the general macro instead of the >> ARM-specific one. >> >> This driver is partially marked for COMPILE_TEST'ing, but it doesn't >> build under non-ARM architectures. Fix this up before *really* enabling >> it for COMPILE_TEST. >> >> Signed-off-by: Brian Norris >> --- >> >> Changes in v3: >> * New in v3 >> >> drivers/soc/rockchip/pm_domains.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c >> index 1b029e494274..cf16ff9b73b3 100644 >> --- a/drivers/soc/rockchip/pm_domains.c >> +++ b/drivers/soc/rockchip/pm_domains.c >> @@ -178,7 +178,7 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd, >> regmap_update_bits(pmu->regmap, pmu->info->req_offset, >> pd_info->req_mask, idle ? -1U : 0); >> >> - dsb(sy); >> + wmb(); > > Just curious, shouldn't this be mb() instead of wmb()? > From the arm64 barrier.h: > > #define mb() dsb(sy) > #define wmb() dsb(st) As I mentioned on v2, that would be the literal translation, however there's no concurrency since this is happening under a mutex, so there's no other agent against whose accesses loads would need to be synchronised, therefore the only logical reason those DSBs were ever there at all must be to ensure that the prior store(s) have been issued to their destination before proceeding. The history implies that this dates all the way back to RK3288, where Armv7's argument-less DSB lacked that distinction anyway. Robin. >> >> /* Wait util idle_ack = 1 */ >> target_ack = idle ? pd_info->ack_mask : 0; >> @@ -285,7 +285,7 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd, >> regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, >> pd->info->pwr_mask, on ? 0 : -1U); >> >> - dsb(sy); >> + wmb(); >> >> if (readx_poll_timeout_atomic(rockchip_pmu_domain_is_on, pd, is_on, >> is_on == on, 0, 10000)) { >> -- >> 2.36.0.rc2.479.g8af0fa9b8e-goog >> >> >> _______________________________________________ >> Linux-rockchip mailing list >> Linux-rockchip@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-rockchip