Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp68218lqi; Wed, 6 Mar 2024 10:12:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyVC4ZRGHSiuuer0D3ELzPcaQSIzulaXnFCD+M+iE1NtNdoj/A7JcsEfLN4MUUKn7DZH02t1hIflKtW7vxyZpMfqGC0Uo9Wk9+1s3Unw== X-Google-Smtp-Source: AGHT+IG4W+fzR8LeP20EuIPQZfDhyBI/iJracvsl6MiDuTAzZ6Jd3st2wtZ23iGhMIRW1zeH2JoT X-Received: by 2002:a50:d506:0:b0:567:6e9:80a3 with SMTP id u6-20020a50d506000000b0056706e980a3mr8845136edi.25.1709748767755; Wed, 06 Mar 2024 10:12:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709748767; cv=pass; d=google.com; s=arc-20160816; b=fiN+TzumU25sRDdg9QIdcKT2xMEoUCButnk3vYdeVpkWdcDItoAwjKA5kveunAbNUu mAb4sRTtrScPYIS46VclRFUyO0a+NO9I7YAT1Xz4mikQbTH69rDRZgE6DhDGPxwriQbH rwCsPSevdWLjpgcxbVzsIyL9iRTCe3LFjrnAs88oOZ/PWNqFl4u6C+MfxbcBXoy12Y3d DwgT6FB5rlYMtFuVDMLI0Udn+KaMymteKgxuJerD3ujY5Pg5zmQNu8sZWbvcHDqEzN5R 00LrtwjsR6ibVO3yHU6ysA+k4BL6EVPARzLAOD9+HDUpMWRFJze12HXlwBjx4fmp0YNF 7/vA== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=WEAfSEkkHQ3/425640Pby4gzYSJi7TXLgGMkYugkpt4=; fh=ZyMahBoewXwx5K5iLCzdI1LbdXmcQS+qLouDLVGgxIE=; b=ASVeu0R1Pqr2ETt9f5rcfVbvdzm54e1/cKaMpVnHyoc1mbKJ1w9mxbcxDKDAdlPk/B TTLKSlN30Hmxe1hyiqPGIUIhoPyPRFcLrf+UMdYpwomHtFRDTvVSpPUSmTqnl27HpkE3 hB41vCfn9Wh7Wg9Tv8t0YOauUWXK+fc96fyZS8mCHDP71W7t5ZXbbU667N4iEbxV+VSO w1M29XpiXsFIyC4dAXYO8Lj4OXQUhIRsrHc7twFMAzvEtQRDPwHH+we2EB/ZQgL6KnOU ApkAxkkubGKhfvH5aarlNup7zL4qVzT0dEaOBofhPXRxTHYPbxhj/XfLiZKoDB5BhQO5 n0qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WNkgUXTS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-94370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y7-20020a056402134700b005673842220asi3312070edw.680.2024.03.06.10.12.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 10:12:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WNkgUXTS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-94370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9F6F01F21A37 for ; Wed, 6 Mar 2024 18:11:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 568BF13F011; Wed, 6 Mar 2024 18:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="WNkgUXTS" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 E4AC313BAE9; Wed, 6 Mar 2024 18:01:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709748115; cv=none; b=UkCTUWBvdM7sdWNZ8kVNswf1p9/V0xWJZ8n6EUuHkpJhrasFGlpgHamgx5lvm+3jlDcOySQLpyhiM2FRPedxg9rkxGN7LGv+uBv0sYR2JtPiUioq1+l5ewoOMQvPMGkDumoDitFl21SJFVCRQWao2mq382eLmHbtVYNsRmTpDzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709748115; c=relaxed/simple; bh=WUJzhGYyB2Ri6kPDJweaS0R/kNRbw+oc+bRFKM4vtKM=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OCQVK0r8PmQc+1h9Ilcjijxu40dx5o3/aUHPHEd2+k2Gt5qemrCO9e1oOlmwl0q82TrEcv15pHBM6VcMP3EdpyOAqSQOxvidSufh3pfp3VoEKY/yfjUNR6iQzjVQGydQftbCl3nFC5qoaJhRKgB7Fumz5OVJPsDluF5kUw2bxgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=WNkgUXTS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426Ae3dM004280; Wed, 6 Mar 2024 18:01:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=qcppdkim1; bh=WEAfSEkkHQ3/425640Pby 4gzYSJi7TXLgGMkYugkpt4=; b=WNkgUXTSnNljmIxyZcBG8bny1QsGt8jkTCdIu n4tMmjlRlN9DObX4WDXPMLzydCXG5QUIOdjSs9a+RPpTGac3QLfgcuBR3UZRb+ll FssjSi4hFQM2S4alN92PXCpdoqwdX3zOLXBUf87DoKbP6JnzUXqLzMbI3BrcZ4E2 WhlMpmhd2SlQkKg4EpQCBLHWnSxZlAogea+eP3vq9f9JBBhhLvtI1TgMMgQROevh rdPluureRrQOEQ1BPmvV/6nDEN83UJUG1nSTWIb6AhcJylo74EdCIassQoMPUDvj zIL6i7D1DKbj8xCG5L96sJHEXHRvYaz3pf7lX7xjh7N03BteA== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpepca2km-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Mar 2024 18:01:35 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426I1ZPI016198 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Mar 2024 18:01:35 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 10:01:34 -0800 Date: Wed, 6 Mar 2024 10:01:34 -0800 From: Elliot Berman To: Konrad Dybcio CC: Gabor Juhos , Bjorn Andersson , Sibi Sankar , , , Subject: Re: Re: [PATCH] firmware: qcom_scm: disable clocks if qcom_scm_bw_enable() fails Message-ID: <20240306095357736-0800.eberman@hu-eberman-lv.qualcomm.com> Mail-Followup-To: Konrad Dybcio , Gabor Juhos , Bjorn Andersson , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org 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> X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 5DJeZAb2NtAabu9ImMNMEGT8SNvW_AF2 X-Proofpoint-ORIG-GUID: 5DJeZAb2NtAabu9ImMNMEGT8SNvW_AF2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 bulkscore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxlogscore=732 adultscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060146 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 If we want to go that route, I'd vote to add it to qcom_scm_desc in a new field.