Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp444391rdg; Tue, 10 Oct 2023 15:28:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4qPr+lx9ECxL569Qchv6P+ceKnZPPAlVlyC4wBrOpsZa0G0C/DDn/uuMxM9p0Vlv7Lgh3 X-Received: by 2002:a05:6358:7e9a:b0:134:fdfc:4319 with SMTP id o26-20020a0563587e9a00b00134fdfc4319mr20468158rwn.20.1696976897781; Tue, 10 Oct 2023 15:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696976897; cv=none; d=google.com; s=arc-20160816; b=mxfXbS1tIAveM4eqITUfuyZg1KmQsG1HmaJ3Ox6Gg2uqGoKVqhPzuHBzh8HVL55LOm PVfLVJ1SiKtrb7ZqcW0W2D1h3UZrsy0b+OyGcwYp/xEFrhBm1nPXsUo62cUDXHF2/QVz qlyfZEbTV/u9ExKzWq9cK5zmkXk9cWm5wO+HWEQOmX+lhiSe6EX7XKblS7xwcFdQZ21w oDYTRqdSlP5uKvGqJ+6A3XQaS3xGjt0Hoz/C9MSmiiNNaG8fA53ZkG++v9/rpSlPmJ0V bmkKhPxVYf07m9nMDdlWH/tToDUHRLy+Zemlsityqe65E5SbKQp+H9igkUnsyL2Txjlr UDFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tdmK2PJpm7tFVM+sD/0UEMZcITp4E1l/E4NAmoPnMSg=; fh=4jyF2ZUBQ/SiJHAfGoV+niA288FYUMeb6Ahk+NIw7Pw=; b=P5355je56FbSAmN8oxrOZAtKfx8DbZFSJA/CG/3mLure8Wg1mgTUMKW12WrkURCZqU WvPBEGAXpelg7eWC4G6rVcHyz7h1f+s7IF4LbFoDPsXLwwiji4jTb8DV9c/dcqgIAG1H nafrxsIziIMVm0GisWpzatCwZfmCMv7xa0Ib4vedplOgU51PkH8obSkYqgENb+ie0tqC txEFJAycsAWV1UpT+r9wMaob/EhiKJ+kYDeL4J6k0gFcKWb0dErmrCxKCI1hxQM4+Za3 hsKemJrlcHEmp8Ry3cxI5+BC74TSh+QLoLy1KtFjR5lVrHq4pPwucwg/Mls5SJw5qkbk yWTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=haNpw279; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id f20-20020a63f114000000b005644a9be955si12722825pgi.179.2023.10.10.15.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:28:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=haNpw279; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1E2D7802933D; Tue, 10 Oct 2023 15:28:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234760AbjJJW2A (ORCPT + 99 others); Tue, 10 Oct 2023 18:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234747AbjJJW1n (ORCPT ); Tue, 10 Oct 2023 18:27:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E6AC4 for ; Tue, 10 Oct 2023 15:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696976809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tdmK2PJpm7tFVM+sD/0UEMZcITp4E1l/E4NAmoPnMSg=; b=haNpw279RRLuu4dASACeEYg8/ZPrHUYNVGopx1EOeCVnzUHZ70aWhIcCp/tcCyhpEVK5kC 0nsrcLgsAjv2glcu17G4VVJf6aqxVsaT+aSaiOhTaGa322xKSOpymRdMCHboIcvN3OSApK 6a0tbB9CHWeAuzcyRwTJQS+9DiqTFB4= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-sywiTnumO2u6Fixpokl6HQ-1; Tue, 10 Oct 2023 18:26:48 -0400 X-MC-Unique: sywiTnumO2u6Fixpokl6HQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-66d03dcdc6bso2637296d6.1 for ; Tue, 10 Oct 2023 15:26:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696976808; x=1697581608; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tdmK2PJpm7tFVM+sD/0UEMZcITp4E1l/E4NAmoPnMSg=; b=hOjHkyS9vD9VVGvszXG7FQhyeiry5p3Hau5+ZmH1wmC6Ir6Qbuh0zbJrqirib6F2YX OoelMpOCcvLAueNGGfSEEYYly6OdNiGSWCAzQcPZQ55Ny5aAYwvS6N5AD34OgVB/4pi1 VfF+BykYpQdDyxk7OGJhbYP0fOhdUmkDwEjxyTeomLCk0wBnK1g89ua3RwleRbguMmGQ Mu+K1Lk2YhA2qHHxyeE4dP08BSYDeh9zFeVU4BoIOk3hpKUOAXoPCuAJW/4FAib4EXgM 8yDFnLPovj9liQVEoqiffkfRF68K4UB2okYBfYOEpNZ7vGMATdJCu8AwEESuOhA+ryT8 93dQ== X-Gm-Message-State: AOJu0YyfzOBl+BlhQQ791yeSgu8ZC6ln/VZXYRKl+qpr4WqcQsmKSUG4 AGpVRLSbfHd5NkyiEIei4tlSiI7TfbmajdK8TX/AjzcXkTB0XfxTPTkTI+sqNhBivkRfvH/EuI5 bUjVRRy4pEx0556cprG6eILwL X-Received: by 2002:a0c:aa9a:0:b0:65b:771:f2ea with SMTP id f26-20020a0caa9a000000b0065b0771f2eamr14687789qvb.53.1696976808077; Tue, 10 Oct 2023 15:26:48 -0700 (PDT) X-Received: by 2002:a0c:aa9a:0:b0:65b:771:f2ea with SMTP id f26-20020a0caa9a000000b0065b0771f2eamr14687781qvb.53.1696976807826; Tue, 10 Oct 2023 15:26:47 -0700 (PDT) Received: from fedora ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id p6-20020a0ce186000000b0065b0e724f83sm5117109qvl.6.2023.10.10.15.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:26:47 -0700 (PDT) Date: Tue, 10 Oct 2023 17:26:45 -0500 From: Andrew Halaney To: Bartosz Golaszewski Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Elliot Berman , Krzysztof Kozlowski , Guru Das Srinagesh , Maximilian Luz , Alex Elder , Srini Kandagatla , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@quicinc.com, Bartosz Golaszewski Subject: Re: [PATCH v3 09/15] firmware: qcom: scm: make qcom_scm_lmh_dcvsh() use the TZ allocator Message-ID: References: <20231009153427.20951-1-brgl@bgdev.pl> <20231009153427.20951-10-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009153427.20951-10-brgl@bgdev.pl> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 15:28:13 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 05:34:21PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Let's use the new TZ memory allocator to obtain a buffer for this call > instead of using dma_alloc_coherent(). > > Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney > --- > drivers/firmware/qcom/qcom_scm.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c > index 31071a714cf1..11638daa2fe5 100644 > --- a/drivers/firmware/qcom/qcom_scm.c > +++ b/drivers/firmware/qcom/qcom_scm.c > @@ -1340,8 +1340,6 @@ EXPORT_SYMBOL_GPL(qcom_scm_lmh_profile_change); > int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, > u64 limit_node, u32 node_id, u64 version) > { > - dma_addr_t payload_phys; > - u32 *payload_buf; > int ret, payload_size = 5 * sizeof(u32); > > struct qcom_scm_desc desc = { > @@ -1356,7 +1354,9 @@ int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, > .owner = ARM_SMCCC_OWNER_SIP, > }; > > - payload_buf = dma_alloc_coherent(__scm->dev, payload_size, &payload_phys, GFP_KERNEL); > + u32 *payload_buf __free(qcom_tzmem) = qcom_tzmem_alloc(__scm->mempool, > + payload_size, > + GFP_KERNEL); > if (!payload_buf) > return -ENOMEM; > > @@ -1366,11 +1366,10 @@ int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, > payload_buf[3] = 1; > payload_buf[4] = payload_val; > > - desc.args[0] = payload_phys; > + desc.args[0] = qcom_tzmem_to_phys(payload_buf); > > ret = qcom_scm_call(__scm->dev, &desc, NULL); > > - dma_free_coherent(__scm->dev, payload_size, payload_buf, payload_phys); > return ret; > } > EXPORT_SYMBOL_GPL(qcom_scm_lmh_dcvsh); > -- > 2.39.2 >