Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1016603lqg; Sat, 2 Mar 2024 11:11:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQmHSPTWyG2DZ0v1r2VvTPjA+yE/LtLV54QQOdur3co768F880MlKXYm/Oduc7HWSieZ3Jk5C9F8iMiE/IGT7X98jUFD6UKovbUHF7fw== X-Google-Smtp-Source: AGHT+IGdZljNiyJznUanhW75a+RlXn715RjA26LXdFJn3Kh5ey0IevFOj9gSLdbszDgue9/Ckd9/ X-Received: by 2002:a05:620a:170d:b0:785:9c70:c7fa with SMTP id az13-20020a05620a170d00b007859c70c7famr6175983qkb.1.1709406668655; Sat, 02 Mar 2024 11:11:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709406668; cv=pass; d=google.com; s=arc-20160816; b=z15pxiNl1ZXqaKhTNupQTdi/ISm/+8382TvKoihta1YgtSU2buacivX2ruKyesaXEy ymqAzGgL9pP4ABBmco7LGK39kVKFxCXw+6XujtgCAs7gVzx48Rt1K3XaDUbwQt1NwPGR eV1TpR3OpmtAXBflDbLHhdSnDhM3RjdOPOZ+kRL/LfNcRTEncnMZfC6MKZaI6d8Cx8vI 0q5Ihn4c30xcI8U1e1dqI2Yo00d9Vvfcle0m5LCZCQ0loOLjHSWIK+hULC4Rz1OO8Css L8PJ4riTPssAifIB2OGdTJR8L6pD1FxWnauTEiAs6/+w11rfnLixLb4+lOhV7KejQb4C sf4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6eeDvy5EKuHBMmfjOolh0wb5PaP9gbRNG2QkH4/qgvM=; fh=PEkH9v0Zmj/RlPLDCbcKTtjdUyBUqfhfh12IfknXudU=; b=hh2pbYRuTZkl9k/6rPkfDDlAv+ZOXfY9sVR8Dg9TCxKUYsXy6rCiNmUT1OkaccNqq6 h88IICmiYIdQQI6oJqTJYhXDdZzv5URU6PwIerklrYEQK0LkNqL3cvCLzT8KnDG/0wrg 9dx2r8s1Zw5tR91M9kJQ1s0KZiCUIPRagPdSPKb0ESHb9R9rDY4cuzGkOcLcrAQZvInM amTsjP93+zIeBvjSXev1Vzxq73oWsvB+lTurNDeMAja7pYFk2s1nrbmP7jsS/MYcNv/1 MR6k5u/lXkLZZDJF0C+1LYB+PSjm/yvsA6EKCfriTfZ3Uz6sJByMeolDHx90yFtUnHQT eT+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxHfguVd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ow38-20020a05620a822600b007880fc3d0e2si3041500qkn.349.2024.03.02.11.11.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 11:11:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxHfguVd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3110F1C20A8C for ; Sat, 2 Mar 2024 19:11:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 054CA3FE35; Sat, 2 Mar 2024 19:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YxHfguVd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 20C321DA22; Sat, 2 Mar 2024 19:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709406659; cv=none; b=gdlAFGT2Qum23DSKSU0JbxmEAi2SsywhkjfJ1R9ft2QfisPrMR//o7S7R7TPuQSoTPDauj1Eht9G/YYLXkfweTY3nXovK5dtNfUYqDYjOM7lQhL7IDQEJ3fLRbVGrGK5kUq5/dedo40kHxwXpOyqjLJSAg8XaT+ufPgtS72fL0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709406659; c=relaxed/simple; bh=5ef50iIgk9tBLjreqhP8f+o4CxPURqkjvCpllkGLct8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XyzYSO3dnUJu0+HAb+zrgbvsa9Zr1e3xzaLhRfglRo0kxqbf1wW40AsshYhZGfxlRyjg66Cg7aNeRXnBUaOXjJEXOfh5diDcFFoMKVYYmLUNeVMU6TP5fl0pB2HkhoTp3jfBuEVuZmylT/qXGQC1umQ+LI1Cu3Q3laZ4zAL7XMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YxHfguVd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B505C433C7; Sat, 2 Mar 2024 19:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709406658; bh=5ef50iIgk9tBLjreqhP8f+o4CxPURqkjvCpllkGLct8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YxHfguVdRGS71akDiuqYM5VYZCsbaQanbYlCN3NHWxtjL01QenLHeBRaOG5vuqi00 ycP2feXim6UPZpq6bC2ivTioHHnrvYCHB4SIbhkjBhDiw4kW2oiJkGUX6q0UNMKV8g 4DGG3rp0tHFihsdxSEoeqZ0v+nE8BrzN8o9b7v3CkbM57ZjVKAV1F00vnq9FEYQDEo FzbRH6Syl59LZypeWCRCI8xChKZOesifZbrBzyOKQp9KJNIjG7NpjJ937dHEZpyMeV IhwboaZxBbNqcnCv3FJbKANpeWyc7erk5bqTZ7rx6Sz4PFpeBmfQsdSex7zWP36TJ3 rTzPnmIYlwdjg== Date: Sat, 2 Mar 2024 13:10:56 -0600 From: Bjorn Andersson To: Mukesh Ojha Cc: konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH v12 1/9] firmware: qcom: scm: Rename scm_query_lock to scm_lock Message-ID: References: <20240227155308.18395-1-quic_mojha@quicinc.com> <20240227155308.18395-2-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240227155308.18395-2-quic_mojha@quicinc.com> On Tue, Feb 27, 2024 at 09:23:00PM +0530, Mukesh Ojha wrote: > scm_query_lock is global spin lock and only used for query > purpose with trustzone and that too for one time to get the > convention of scm communication. It is possible that, it > can reused for other purpose. > This is not a good principle to follow for something as complex as locking... Regards, Bjorn > Rename scm_query_lock to scm_lock. > > Signed-off-by: Mukesh Ojha > --- > drivers/firmware/qcom/qcom_scm.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c > index 520de9b5633a..2d0ba529cf56 100644 > --- a/drivers/firmware/qcom/qcom_scm.c > +++ b/drivers/firmware/qcom/qcom_scm.c > @@ -193,7 +193,7 @@ static void qcom_scm_bw_disable(void) > } > > enum qcom_scm_convention qcom_scm_convention = SMC_CONVENTION_UNKNOWN; > -static DEFINE_SPINLOCK(scm_query_lock); > +static DEFINE_SPINLOCK(scm_lock); > > static enum qcom_scm_convention __get_convention(void) > { > @@ -250,14 +250,14 @@ static enum qcom_scm_convention __get_convention(void) > > probed_convention = SMC_CONVENTION_LEGACY; > found: > - spin_lock_irqsave(&scm_query_lock, flags); > + spin_lock_irqsave(&scm_lock, flags); > if (probed_convention != qcom_scm_convention) { > qcom_scm_convention = probed_convention; > pr_info("qcom_scm: convention: %s%s\n", > qcom_scm_convention_names[qcom_scm_convention], > forced ? " (forced)" : ""); > } > - spin_unlock_irqrestore(&scm_query_lock, flags); > + spin_unlock_irqrestore(&scm_lock, flags); > > return qcom_scm_convention; > } > -- > 2.43.0.254.ga26002b62827 >