Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2504285rdb; Tue, 12 Sep 2023 04:11:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHe8WETKlml6cL5CDoU4E9XKRrHuQaGPZMDMc/F35Z443dzG3djvQFa71hIyysQCKS7d6vf X-Received: by 2002:a05:6808:1153:b0:3aa:86e:2c95 with SMTP id u19-20020a056808115300b003aa086e2c95mr17929990oiu.6.1694517100002; Tue, 12 Sep 2023 04:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694517099; cv=none; d=google.com; s=arc-20160816; b=XEQw12fvolq/mwSEKlFCxEF+YIcROlhckIhW0JaIsdqxUVOOMh0IdLh1S/R1YhMCyc 0vHZHwxJ7jl0UHn5YLyVt+gi8SQk/LacXcZNI4MboJGlmjc6NEOdb4ZI/RlYHFpakKEV CbNWSRtiJXd7RSbTHqRlr+R4za5O3/HUeeiAujkkq9mYIilNHsVx3Qk+hBVs1EU9ojSj SIGma5xm7xWNaW9F1W0PD2VO8I78lMISHiG3k9sACTImWnA3bs/Ug13RymcoY7LWl908 kMzUgaFBivGCemzqQwO2gVk6s+pnB6dWia3/wWIT8fT00GU95rYO03QKt0SdCZ4X2JkC TzVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SoBHke4urpozyZDHr5ucE6zOtD1XFhakU9jA2sy8fAs=; fh=7xbNZwTym+CKkW9darKiAIrlxwrHvdD9/+5rIv88u2Q=; b=dAanCfDx6B4tKllTSjvScd5fsKndLdMdf+a0274QY/LgsDAUs55iPqUCAbnY4QH4m5 REWifxA52X0Xa5DkdhfJTTkojpX6aq40cTdjX14zh8An1Y7TF7CIHrUUDX9ahl0LYP4z RVV/6XXcE8qpU9hPisSUNxKiV4lrrhcRYZjqzlFXndIxosZ0cfH5A4Xh/cTPDlEe6naG 6CyqUR1QwL6MwXjwedT+PuXvVyeq7JjZEbyPtXR7+h1XUKgjK3uqCMMXiGecNXot0MOX rbvUtRdZW6YrmHp+qtJ4XzB3HjJ7keuq3OfffmlIJf9GbcSJy9/Pr6mHOzHvcK82Wua4 6Ufg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=LcRpHldF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i63-20020a638742000000b005774978dd75si5283604pge.175.2023.09.12.04.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 04:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=LcRpHldF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 91F1B8026E2F; Mon, 11 Sep 2023 21:54:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbjILEy1 (ORCPT + 99 others); Tue, 12 Sep 2023 00:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbjILExa (ORCPT ); Tue, 12 Sep 2023 00:53:30 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F95710C3 for ; Mon, 11 Sep 2023 21:52:43 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50078eba7afso8945101e87.0 for ; Mon, 11 Sep 2023 21:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1694494361; x=1695099161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SoBHke4urpozyZDHr5ucE6zOtD1XFhakU9jA2sy8fAs=; b=LcRpHldFUeTT2alLv3t90dqC+PKSe8sWlaiN3S68IMeQCDAB9fp/5GfpH9Xi6BUX+M e/i51vklWFGYGZ/zrkS0PKGKgokt2hu8PGyiaIE5r16VUV3EwQ6vq2kDSimiOzeBGgTb t4tGGZZBdmvxw38zDYPuyrf9/ttIO/e7tWhgzw2TVIxTSn2gA8kt1wwolodAq7K2Vo4g PO18+jfk6Cyh5luemVwy3qBQTVw6BxPvKYLEma8aSBVyXJ5ZE5V5PzsNtPfeqMAbp5Y/ sFBOmB6Ag8VSpkHxtU4DcumtxVH28YGpAafc05Cpl1OOM1xG8Pv++ViD9YFJjPftWIYO wnkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694494361; x=1695099161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SoBHke4urpozyZDHr5ucE6zOtD1XFhakU9jA2sy8fAs=; b=IDIDJGwNoGp6DLb+9y5FtfCMU7tSGPAsdpRtiC5rFNMrEAM4FegaN9YaJC/Qa5h4Yh f7GN3rdxGwABpZtwNdGcRpULlx9ecwicwzQrL+sYAUd0HAQXkkN1RlplC8LObJ9PLtLi MFNTksefoBRLTglfprXyfxgDjuzJm6DstEFCuU9QmobYSnomSyoUNur3g6nVxhdBGqhW /gYPe4SbMfJkAjLylrjLkdcvGrZPOlxtBsaOR0HknHejIio/bTU4PdQ6WzpG28aL2v+r g24VCYJPokcCN54LOyleqJ56ElHrz69azkqJ5up0nEDVQZMt3Z2xR1CdwSRmpKqx9o4U tJ/g== X-Gm-Message-State: AOJu0YyXQ+R070JA46AJdHT2VGOp7yK5mZZTVTGoGJwdtsBdIASrhTWl NimPoAkWHYTqGXzFU6H+mEyL/w== X-Received: by 2002:a19:4f02:0:b0:500:bbd4:970f with SMTP id d2-20020a194f02000000b00500bbd4970fmr8992708lfb.5.1694494361475; Mon, 11 Sep 2023 21:52:41 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.145]) by smtp.gmail.com with ESMTPSA id f21-20020a05640214d500b0051e22660835sm5422415edx.46.2023.09.11.21.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 21:52:41 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, magnus.damm@gmail.com, catalin.marinas@arm.com, will@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com, quic_bjorande@quicinc.com, arnd@arndb.de, konrad.dybcio@linaro.org, neil.armstrong@linaro.org, nfraprado@collabora.com, rafal@milecki.pl, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea Subject: [PATCH 12/37] clk: renesas: rzg2l: reduce the critical area Date: Tue, 12 Sep 2023 07:51:32 +0300 Message-Id: <20230912045157.177966-13-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> References: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (pete.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:54:34 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.vger.email From: Claudiu Beznea spinlock in rzg2l_mod_clock_endisable() is intended to protect the accesses to hardware register. There is no need to protect the instructions that set temporary variable which will be then written to register. Thus limit the spinlock only to the hardware register access. Signed-off-by: Claudiu Beznea --- drivers/clk/renesas/rzg2l-cpg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index 6c289223a4e2..d8801f88df8e 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -912,13 +912,13 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable) dev_dbg(dev, "CLK_ON %u/%pC %s\n", CLK_ON_R(reg), hw->clk, enable ? "ON" : "OFF"); - spin_lock_irqsave(&priv->rmw_lock, flags); value = bitmask << 16; if (enable) value |= bitmask; - writel(value, priv->base + CLK_ON_R(reg)); + spin_lock_irqsave(&priv->rmw_lock, flags); + writel(value, priv->base + CLK_ON_R(reg)); spin_unlock_irqrestore(&priv->rmw_lock, flags); if (!enable) -- 2.39.2