Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp454636lqb; Sat, 16 Mar 2024 10:58:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxfEOe8gQ1R8Ktv9JrLF8ftgJxICP9TRMjM4+6HMuQSnWJpDbtXeK8lmRRDobKyAVep7Et2G5d1oJd5JKlPWAkAak+wdMZR4WyrntOhg== X-Google-Smtp-Source: AGHT+IFKgD5l1YZYo3Pdwog0m8S9OolcrK0hDVsNjR9F2Rptr4j3ZgSme5e/IepRStUNBpBtbAx9 X-Received: by 2002:a17:906:719a:b0:a44:8f3a:794f with SMTP id h26-20020a170906719a00b00a448f3a794fmr3709531ejk.42.1710611894186; Sat, 16 Mar 2024 10:58:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710611894; cv=pass; d=google.com; s=arc-20160816; b=w992It+qvRiSdAIm/tfV0bhd8Ljqt0Us5Gy20ulgFCALo42O15EymIexj8gc2/yGmH Yvuz/7gcSy57aZY30vnvsz2B0l7Q8CSJFApQiEDiuZY3VpT8r5d4xAYRDZjikAT+gw9I M1jBs7FGIZDlAnJqdkKYsG+tu8avSZgHzdlotMjaqpeFexJGKDY7jkUYhcj7xyC1POUr NiC/xwdFK12TQc7VZP5OZC4Y/3/HG4qYEKtNLbZFoE4g/9glpAafl//aKwyoLeUC9BXe AhdsXoJ2kDM4wMA5HHcHEmopEUyYcmynPzPfmxbrY18+MGSXe3oZMIWuFagisdm40vRl sPHw== 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=mL/iOEtF1AOGdJSw7Grb7dbzPuPdrr2lz6pihEF0t2g=; fh=xDhDEEOsADsOinmauZMAfZUSZfMsBJqPziEq2XTZJmw=; b=FVkeSdqPkkeI5zSv0Y/ht1MD8rsHWTxUx2VjHw/ObvEs48vxXJ6ftakaxqAtw4tpfN yUsrarolfmeQetRWa6bKQHGvZnXpJBnbNHOiAJzB/9x4xiwvm2Zeg7spUB3A7a/RGHvv hy42abx0jkxOwJxrkZgszir//i+GnZ7DANQ+rH3I3Qbhl4Cgvb3NK8FdmI9PopQahVpL aG9KzONyTxlnZ05raJupej399ZDWJgeDznLFl/fHm6i1Y7mJ+7KQuc9f5LntAXbVH2O0 +7DN91xUcWAe5cwHAfzAWbMf1cewX46O9cte2wsndn19Vd959iaTdrzjI4/zOpJR5TZG vAQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RXcYuBuh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-105262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fx24-20020a170906b75800b00a44415df763si2762765ejb.893.2024.03.16.10.58.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 10:58:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RXcYuBuh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-105262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105262-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E644A1F21531 for ; Sat, 16 Mar 2024 17:58:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E6AD1BF3B; Sat, 16 Mar 2024 17:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RXcYuBuh" 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 BBD401C680; Sat, 16 Mar 2024 17:58:03 +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=1710611883; cv=none; b=apcB+4MciRKmDjgHt5mDdO07XwxH5ytnoiAl+IGNa0JaKA+NXBz0WJVp3uVllGI5srU6ihnn3dhNVXbsrRiWgP2A8sp7E20A4+5BwtgZ45C8RRcF6owuvnDOo1lFm9kxKIKC5225BlO5qKst/xjAIN9zYH9N2Bz8xlMMftgaBEI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710611883; c=relaxed/simple; bh=LLxDN7DJwsrWN3R0UF5L0gaj2YrCdYe/2m3/JYHm58I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O+YG4u9VUpjF6a81tPcnkgOwkqGhjisgDslheIodOGjfv/7hl8tAE24OADdUkW02Y3RlEI5YA+wc+eiyP1dP/X7hTjcFqFTyaLeRISnt7Z9i/3t+sQ6bOx+gUDFSgkkHh8wRAA4cePLtGxhyHVOl8Qcz2kHR1rCsaAmnBDkHTKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RXcYuBuh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4F88C433C7; Sat, 16 Mar 2024 17:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710611883; bh=LLxDN7DJwsrWN3R0UF5L0gaj2YrCdYe/2m3/JYHm58I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RXcYuBuhrvYt6pjLrkaJsyFmEHzw+gWtEIb3d04M/HZbByHSkhaQf0DGYR1DUsZDG L2/wbW4XsS3AdvhNSWsM/02xOcEjNW9hbl5NibcyQt3oEbqQNFiUp4L0m5xGSEOYDu 687QwOmu+X2EJntLsZd0nNbHhlWN1y0/k15GkB2GFc2JS+LFt9rfdqZ85ywPXm59wt aWuEbe+Gcxm4k+n2wjvcJ7E1AaLiJvKN5AP7+S9f4BV6RmEEwz6e+JkbkKNGsFvFnr CWOvlQPWNPD0E0WndHRJYZsxL3XrOPTvHObyu2X36ws5yAN/0QZ0K0j11gAOQ7sdSt Dk8gpLYDWZUrw== Date: Sat, 16 Mar 2024 12:58:01 -0500 From: Bjorn Andersson To: Konrad Dybcio Cc: Gabor Juhos , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] firmware: qcom_scm: disable clocks if qcom_scm_bw_enable() fails Message-ID: References: <20240304-qcom-scm-disable-clk-v1-1-b36e51577ca1@gmail.com> <20240305200306921-0800.eberman@hu-eberman-lv.qualcomm.com> <2fdb87f5-3702-44d9-9ebe-974c4a53a77d@linaro.org> 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: <2fdb87f5-3702-44d9-9ebe-974c4a53a77d@linaro.org> On Wed, Mar 06, 2024 at 05:02:37PM +0100, Konrad Dybcio wrote: > > > On 3/6/24 05:10, Elliot Berman wrote: > > On Tue, Mar 05, 2024 at 10:15:19PM +0100, Konrad Dybcio wrote: > > > > > > > > > On 3/4/24 14:14, Gabor Juhos wrote: > > > > There are several functions which are calling qcom_scm_bw_enable() > > > > then returns immediately if the call fails and leaves the clocks > > > > enabled. > > > > > > > > Change the code of these functions to disable clocks when the > > > > qcom_scm_bw_enable() call fails. This also fixes a possible dma > > > > buffer leak in the qcom_scm_pas_init_image() function. > > > > > > > > Compile tested only due to lack of hardware with interconnect > > > > support. > > > > > > > > Cc: stable@vger.kernel.org > > > > Fixes: 65b7ebda5028 ("firmware: qcom_scm: Add bw voting support to the SCM interface") > > > > Signed-off-by: Gabor Juhos > > > > --- > > > > > > Taking a closer look, is there any argument against simply > > > putting the clk/bw en/dis calls in qcom_scm_call()? > > > > We shouldn't do this because the clk/bw en/dis calls are only needed in > > few SCM calls. > > Then the argument list could be expanded with `bool require_resources`, > or so still saving us a lot of boilerplate > I don't think there's reason for making this more general, because I think this is a problem specific to PAS - much related to Bartosz special handling of shmbridge for these calls. It would be very nice if someone could help document why this is. Regards, Bjorn