Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1974012rdb; Mon, 9 Oct 2023 08:36:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGppkb9gB8q08XNf9MmHUtm/lEM6t+rPqA3HzlpjAdeO9+rjPZK4CnsXCHCUj/aqc7hKsaW X-Received: by 2002:a05:6808:1786:b0:3a6:f622:70f1 with SMTP id bg6-20020a056808178600b003a6f62270f1mr18392921oib.57.1696865795957; Mon, 09 Oct 2023 08:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696865795; cv=none; d=google.com; s=arc-20160816; b=kO3+/4LXLV2OLcj3N6OTKgm01UqYTzP8mwD2yNS/stRNny5lEHmTmC8o2ao+GAQAGv laZD0hLslwhpA0F1zKwwt846AaVzcTrP1oQnT6zwguNtDg52C9IAUhUOCy3m4ZgrNmNC g8tEthJniXpqGHU5OWr67nakQVYY/HAZFfwTnnB7AvKjynFBUw+l49vOcQbo+s8vsOV6 xW+r0BT2cn1WNmrpooJUy+twgBaQVlgq+CILtkvcSFj1s75XtWw+5/VQOuHB2fFKZoRR VlRh13syLl1Rm0bGNlhUOsMM7r2JueXfBcdpbfM7HWyzsL58gHEpfzylsFZ9CpWjcixd rb1g== 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=VbTZKQqdpJrILRniIPDrMxLXgf0p/DyB9D6pPMY/qic=; fh=lirm1ccAeXZZB1cIo+N1DqklpgcFmD/vJ7PCWNIL0HU=; b=KYPB4h8lyLN4joZ5jbpD5uK9u/0RaVPSc6kTHKAVOBDLoqJwz6TrGX7g1KIY/th064 7Www9nsV/v8/QcKX8nS9YI+H98yjXXBd5cOAX5Uh0zjwNBOB0qtmE6mWHUG+fpQz8Ais UjwXmMTT4QxSqaQTzqrOuh9ZiZ2I3M+vsrhBvbqlegryyT+tzPIH0BlSgYKB3iyzs5GS riEVEas7W7j+jVXnvV7I4W82Sn1o8y7Jos/Gll5hLcaNHqvO38n9IF28jDd/xlXfIgHz 0AvBnrbDROYO7TlDe6bXZKzhaKfwd78hhXFEiSe+5QG8sWx6tyHG1qCoh83FC+UjNt21 RJ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KJ3dKPSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f19-20020a635553000000b00563f8ccc097si7260093pgm.780.2023.10.09.08.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:36:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KJ3dKPSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 8075C810837E; Mon, 9 Oct 2023 08:36:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376524AbjJIPfd (ORCPT + 99 others); Mon, 9 Oct 2023 11:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377672AbjJIPfE (ORCPT ); Mon, 9 Oct 2023 11:35:04 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0D35100 for ; Mon, 9 Oct 2023 08:34:52 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3231df68584so4355849f8f.1 for ; Mon, 09 Oct 2023 08:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696865691; x=1697470491; 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=VbTZKQqdpJrILRniIPDrMxLXgf0p/DyB9D6pPMY/qic=; b=KJ3dKPSYGlF5YXQvSCsKFnLtazljwjTv4z3Im9+iMKPq4tMMALPgm+N03DzJan/xLI ARUXXAynf2XM1E04MGNYUPEMoZoksuEhholJZFK/OPv4g09wOVIAkzZOkybSOyZlMbKg Y/jQ0cDGvIiykedS4H7iG0Z/0KjW1tSH4JbgPjkGKplULmQ2c7DRkNqxCPfbPbAL2Esm WxIUZn5dEMrtA7H3snvyUIvaLbwmjK6Ub7/sWljlP3zbFbmHA6phESKaowpMzHUSl7oz 3wwbYFvaeJlA32SIKH/RqieGBNgLxydzkgAAp6FTmq/U1i8/1icF9AWmWHjvBUJzWUYv CE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696865691; x=1697470491; 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=VbTZKQqdpJrILRniIPDrMxLXgf0p/DyB9D6pPMY/qic=; b=KSmZjbT1i5f9/hKnNP/EXbjlB+GziTVxvxRBqEWEWHohhrGlC6BaEMJpBpcIqz0+s0 CAjaX1jv0pGPrHvFMnK1CsisYwS2hm6Pc0y/cAObykZvBegDnrBs9IB0RpVba7V+nZGB 5KpCKTShirhg2D5hJaEIvPY5q1ssscyzVtwOxqttJmAtB/ds590GCQjX3ZMFvRmT0mBp SwelHapCJWFBHxbtDoLyZX+A82pcu6JRxqPZbjRMOWcd9DpmpXV9VqD9KfoEka+I2J+J LSB6w80n3xOxkNu7BRQesdAHlL+VLv9LAhxEztw7RbpOwqpG5zzP88fMxVsPpo/OSikz lwWQ== X-Gm-Message-State: AOJu0YywASLwTGeLEegecQ+8r7cJgLHbRZPpbhC9e2wgqJlCw8D4uVF7 DV1QdWvLvNJj5mYXAYEQkfifOQ== X-Received: by 2002:a5d:54cf:0:b0:31f:9838:dfc4 with SMTP id x15-20020a5d54cf000000b0031f9838dfc4mr13054433wrv.33.1696865690821; Mon, 09 Oct 2023 08:34:50 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:f20d:2959:7545:e99f]) by smtp.gmail.com with ESMTPSA id b3-20020adff243000000b0031431fb40fasm10016521wrp.89.2023.10.09.08.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:34:50 -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 v3 09/15] firmware: qcom: scm: make qcom_scm_lmh_dcvsh() use the TZ allocator Date: Mon, 9 Oct 2023 17:34:21 +0200 Message-Id: <20231009153427.20951-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009153427.20951-1-brgl@bgdev.pl> References: <20231009153427.20951-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:36:24 -0700 (PDT) X-Spam-Level: ** 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 --- 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