Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp898061rdg; Fri, 13 Oct 2023 04:49:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEFslsgSsFU1QlCbS5EaRV1WxKt5+oeEY1VqjQO+uP01me2ICT+bejxANnSXoQ/yW5SL7a X-Received: by 2002:a05:6808:343:b0:3af:6595:e53 with SMTP id j3-20020a056808034300b003af65950e53mr28903152oie.13.1697197791637; Fri, 13 Oct 2023 04:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697197791; cv=none; d=google.com; s=arc-20160816; b=OGJpecSqIFPlbAOJP4jjTnncl9I0of+pjEdXVSaoUo4KHBYFUB/QeSbFQPcpqoYMer rqrLuRVGPyh0NLikrJa/g+huWtx7xaTLyzSTFX1ozH2AzGyd8zOiKUMNDWVHYglaC/uH P1YLIM7+rqTWxrOB4+i3L62521RMr0iuO5oH0oJGxClwGW9uIQuzlO8Bwh1aQlpjgQLK y2iOTeY4slld9v/81OR9d60a8ljcgzsGUBHj8i0DSDZesDV0dBo1Zf0Cum9d5ECSWKBq CD/Liaiqy70fQuRL+EtDyNxoXzXG6/TNlseNetwSvuZRK/VeRardk1wU7L3OIsu8LJKp 53FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p/0qKoBBzx1o8heobCmZaZFWvw6elFeS/Pei4C+kHSs=; fh=lirm1ccAeXZZB1cIo+N1DqklpgcFmD/vJ7PCWNIL0HU=; b=LLtX1kBNKnsS/WwPIM8w4zDaVXw6u7oqhID3PFSsv4+7cjyFHgOTad6NDhyjd+wTKp aZWhVDVg365Q8/miu3Xv6ZkieWRtDKdTpECf4uIkUFuTJhF/QayYzXzPtHFJW0DeyMcB lREHTUiTFQPBSTAcID1QgQNjYyAZqPOFWpQa7zTNTq6xjxiU6zyfUuUMS3EpNaRdGNHN cgCgTA19XWPuzEcUOZWNcPMHYCTvKZiSlwtxlByUj6Cu2GUVCD2LNHOq58zhQ6KKS/Tx U0tJHvPTXq0zgNqLnx+Lro/NO233H0Jhl78W1ktAx2S+1FPsn/HSdggc8eFqxEZt3KK3 A1NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="s/g0csrc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l13-20020a635b4d000000b00589336ba9f7si4251113pgm.822.2023.10.13.04.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:49:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="s/g0csrc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 01E6E842C6A0; Fri, 13 Oct 2023 04:49:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231656AbjJMLti (ORCPT + 99 others); Fri, 13 Oct 2023 07:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjJMLtL (ORCPT ); Fri, 13 Oct 2023 07:49:11 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 536DADC for ; Fri, 13 Oct 2023 04:49:03 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4066241289bso21022385e9.0 for ; Fri, 13 Oct 2023 04:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697197742; x=1697802542; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p/0qKoBBzx1o8heobCmZaZFWvw6elFeS/Pei4C+kHSs=; b=s/g0csrclmz3GozRG0l5wyE/Lttb9W3OTncNXhgdsDZ1NlYbdblXzvxmstNm1KXlf3 VyGmLNQRy9a5I3oEP9dkkom19lij7iEWQzEDpUt4byNMFMSGKmyLVeUZmviPFNSnlDtO bVIP+GWJEX2EGjzpvFaDYnZfZgSFpN91why1wiVmRvfOqhy0wLFlIaq8K+hdKViJvkYV xQtIoNKh/uWpzwNGZBXxfhh9WgXFDxH+mRKVPfoGzBPi2PgCQfYwH8XM0j2kwgNwarFb Ba2RRX7nleM7XZg+g3nN7vnRELqNQlKf8TXHREE9x8FSBAk4C3zPzy2ahV9Wq9eSY9cR bOEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697197742; x=1697802542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p/0qKoBBzx1o8heobCmZaZFWvw6elFeS/Pei4C+kHSs=; b=ZfQx7rKWEcC64yj2qi9JQccQ6Ex8hZWHPK0OH2jTcnowbWoz07KS4ODbmiY+nyqMDR wxbT8CPb8PFMBSARVHezemvuoz5bwcIchYn/0KkrVixB3YJz0OC9f0xAwXCHNELrACVb 1zWbZnaRffTzTsFI8uAhuKS9c2ye4CcvvlsoVAL/XZeqvgUTj1iDcTsiaiVc8EZZTGMd 8apuwIhEO+WDHN8R0dgssbqqtTFhRddgm3DanKPFi33m1yXyd2zNqm7rhpEJwNaw/2+a RbMvkIblijiTkCa7jTotHLefhVh+gIxOmwcq7/32LJn2dXXqZW/73eI5/+Ym8w3jF4WQ 0pMw== X-Gm-Message-State: AOJu0YyMgzc7tHgu862ocM+4bXuWdhRqMeXz3d2EN5MqOdBsFSHHkXhA P4MFc7vOEJ6mpNTmEzJchKKbRw== X-Received: by 2002:a1c:f718:0:b0:405:3a63:6d12 with SMTP id v24-20020a1cf718000000b004053a636d12mr23826471wmh.17.1697197741772; Fri, 13 Oct 2023 04:49:01 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:4209:13a:988d:80be]) by smtp.gmail.com with ESMTPSA id j23-20020a05600c1c1700b00407754b998dsm974509wms.27.2023.10.13.04.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:49:01 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Elliot Berman , Krzysztof Kozlowski , Guru Das Srinagesh , Andrew Halaney , Maximilian Luz , Alex Elder , Srini Kandagatla Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@quicinc.com, Bartosz Golaszewski Subject: [PATCH v4 09/15] firmware: qcom: scm: make qcom_scm_lmh_dcvsh() use the TZ allocator Date: Fri, 13 Oct 2023 13:48:37 +0200 Message-Id: <20231013114843.63205-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231013114843.63205-1-brgl@bgdev.pl> References: <20231013114843.63205-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:49:48 -0700 (PDT) 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