Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1300771lqg; Sun, 3 Mar 2024 04:14:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXdQWWl61RO2EvSYDGyARSzvT4EZo4RnUx4N3yHZ3pdUPs6NMMygxdVpDnxJbSOrOkjyy+oZq9gRqGX6oaqfEXRx5TpGE7TtmoTb6XwJA== X-Google-Smtp-Source: AGHT+IFjcrEvWG7WzMZBx7z4JBG/36qaCDRNC7PwBk445LF3fE7YMCZF8kapKvS+VjlMzgTebwZd X-Received: by 2002:a17:902:ce87:b0:1dc:ca74:79a7 with SMTP id f7-20020a170902ce8700b001dcca7479a7mr8354164plg.52.1709468072181; Sun, 03 Mar 2024 04:14:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709468072; cv=pass; d=google.com; s=arc-20160816; b=tQP8oBoKaE8DlDBWOlo8VECMKUCOsFdhH9OFRyRIlKUbbkvr+jqLr7j2F2tumW9BBK MKCHJK4PY+s5ZavFP3XPGaAeCFwsE/5HB+dbDrkFkU/zst44dfXDyFyVwCWJv4+utTox TXx1gDkcgAhh88o1cyx71R4fD6N2PCFyOEGlEsbxiuFi/k5I2dE4WNus0Gsp70yJaviY XyTow5DH7BK+0UwovtqSWsgg+7lozxFM0OOyu3gxN9PZlyrJlt4EuXjCI7KJxWyssfN1 HtFnRI+oqKcqz9KaNRdEjGQ5EnlvJE9gLspZ2gfAsv1rO0C5dNpQg6NuNd/MiM0fWZOs 9FeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=iuK3rlSfZhRXze9fbpP0aqR2Nr+15hZKoKVHoaymDRI=; fh=DiWJ2Ei+eUfMkVzVDL+xanQS47f3sSzhdKG9PRe6XgU=; b=HsM8tAzqu/5nDV34OImHfvcz91AvgPRi/Xs1/zud0NP0olxrFSAKZDXT3Ytd4sYT65 PGNnKo+RKcYguYUb0hG8p83iqpgnYG1H+dhbHfOfnDEXiE51GdabrFqQVVO5H/cmy/PZ wSXwhJepevez9n32NXGHITdU2t1RuXulGNidZ/4eeLkd3RMEYPofwSciqphjmulQeKic rTgXUbhdJe1ndi93hVYkRg8b1xyLdHFtJ9YHVT4yq+bxSdGW3zorbhcJBmLZxWdNOjpi KJ+fzfSVQbUw6jxT+PQ2/UU8YL2defopIUl7d9iXQtr3yIkRkFWMv5U6tVCp5+3aFRjE rsRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-89725-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y8-20020a17090264c800b001dc6233d864si6575261pli.564.2024.03.03.04.14.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 04:14:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89725-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-89725-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 71559B2227D for ; Sun, 3 Mar 2024 12:14:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACA6DBE7D; Sun, 3 Mar 2024 12:14:21 +0000 (UTC) Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A499BE4A for ; Sun, 3 Mar 2024 12:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709468061; cv=none; b=hhVkT/2ZDrPIvK1uPG3Re8mqS5s8fda3IF2GkhDrDPDPLlrV17e6fHywFoj1+Yhni4xLb8Iaj0RbyfoCLE1eDL/FDqWqPOBhBxz92E5pbyxPD+2B7c0Pp769cXzHYQT9wlB16vizSOLUxfy857LMkuXNElYLVMFmKavl6uLFMiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709468061; c=relaxed/simple; bh=ueeAezcywm5cI/6F2f6lA2+yuhtrVFvftQ3aZWTbDfo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ud1YxLb0PQUe8SDZZqnCIxvC+n8JHM4CnwZUEkm/CxYINNYxjLd52UWWFUHzz0jFbdGc/Grw3bk2P7JfEsjzN4sazgH8icg6LzL0OoG1sXU6Y3JL+23dY5YOOS5ludQHLv8KiLFsL/OXrLK1H1E9pAFM6PdQ28PBvhPOsLe5pYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 8b2a64d2-d957-11ee-b972-005056bdfda7; Sun, 03 Mar 2024 14:14:11 +0200 (EET) From: Andy Shevchenko To: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Turquette , Stephen Boyd , Christophe JAILLET , Heiko Stuebner , Andy Shevchenko Subject: [PATCH v1 1/1] clk: fractional-divider: Move mask calculations out of lock Date: Sun, 3 Mar 2024 14:14:10 +0200 Message-ID: <20240303121410.240761-1-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There is no need to calculate masks under the lock taken. Move them out of it. Signed-off-by: Andy Shevchenko --- drivers/clk/clk-fractional-divider.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index a0178182fc72..da057172cc90 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -195,14 +195,14 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate, n--; } + mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift; + nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift; + if (fd->lock) spin_lock_irqsave(fd->lock, flags); else __acquire(fd->lock); - mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift; - nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift; - val = clk_fd_readl(fd); val &= ~(mmask | nmask); val |= (m << fd->mshift) | (n << fd->nshift); -- 2.44.0