Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp810500rdb; Tue, 19 Sep 2023 10:45:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGj/kp9/Ycw8o4TO4akbohgfChfztvBeb9FruJj12Jgrc09L+q8vEHD9RCwUSsIB9e7e27l X-Received: by 2002:a17:902:d509:b0:1c3:6e38:3943 with SMTP id b9-20020a170902d50900b001c36e383943mr99969plg.56.1695145515669; Tue, 19 Sep 2023 10:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695145515; cv=none; d=google.com; s=arc-20160816; b=l8YTAXOMkKFRUQt9bG2fYX9xXCHFucRceVyInmu4+YdZX0smIDuikRnURCEZ5t7KwQ BLHATvbbQK8JC7drFUW1xeSK3srRheyEnX8m9C+n45VwKCYPy+cBjJScSI26vK4fcL9K glGZ8v8yI5F4L4sYGpVXFlr3z53ahvOocFN0Bt5MeFu3d7XOxADDhTDmp6zvXjSEfop2 VfJH8OesYF/2RMOc3p7nMwXCAFrK6t91fwk2CEYn3lHbDQU9O6EyQrPYsOP0nCkSNXRt Wrs18pQe/R4hREzShIyqVOiyEPf7FI1d/QbCRPquaYih6OjiKX+397IM9l5cwjjtNSfb zO/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=RaeFzA7IbfiXai8FHhJkBHCZrD7OHW1ueHIUbsAdKUU=; fh=vcyxKNiHD7TmKqmM0/rwqxGOTauIz60tMzPVV7I2N7Q=; b=u2bsKiRTvZfVya5KBs1M6ISSuRE56RdTaIl12Yl90doLjWNYS50ujxuCezcVMM8ERq V1YxVBd2Y1e6T5HIMz8AyC2HHA2yt4YxRb4blqrwamdVnp2//suqWs1iqZJP9kZnEdf0 XXp9v8fyhn/PlUTnzk1IeOLTXXrxH4wg6AF9lMfRkXGb0dded6PG6qfQwQhvucCDe2yX 8TDKtfOVWHL+M9myI0oIG2Cb6VAOPhqRQAKrB1k9Yx7wSUwlZ0Y9m7n2zLL3I4P10Rok osyE/5qqP9mdcGwJd/yu0u1F5XxFlBsctfJwuYVF4+D2/H8eE9XlWGVHYYfc0dreoqKg bcQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h3-20020a170902680300b001c448d89b6asi6512076plk.104.2023.09.19.10.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9970B80B31C7; Tue, 19 Sep 2023 10:43:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbjISRma (ORCPT + 99 others); Tue, 19 Sep 2023 13:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbjISRl5 (ORCPT ); Tue, 19 Sep 2023 13:41:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3CCA61B4 for ; Tue, 19 Sep 2023 10:41:38 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C695FEC; Tue, 19 Sep 2023 10:42:15 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 211EE3F5A1; Tue, 19 Sep 2023 10:41:37 -0700 (PDT) From: Sudeep Holla Date: Tue, 19 Sep 2023 18:41:04 +0100 Subject: [PATCH RFT v2 16/18] firmware: arm_ffa: Switch to using ffa_mem_desc_offset() accessor MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230919-ffa_v1-1_notif-v2-16-6f3a3ca3923c@arm.com> References: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> In-Reply-To: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Jens Wiklander , Marc Bonnici , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1661; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=/nzYxWrUxzHK+XjBQnZCak5Tu7ZPAtOKWE4ng7bZFvM=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlCd08+RU27qx9u4qlmHu5SskWVsSlzbICaDn0o 3rd3FniYD2JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZQndPAAKCRAAQbq8MX7i mA4yD/9hjEpdMqMosmD8LUJdH4SJxBtddl7+/7uL6RU2cGhDKblyXWch/1gW2B0EKSDdU7FjHTb PmKWu8dIhpdbB4nToZJCsHkiaqblO8MmKaP4ICLvRqPSbii3UVjZf+780Zb6/UAmEtYk3PqFzcF XTL4wKwnqtCfuixxzssUi2SujyWB2Nril8gwOp4HRaI6n/nPpBgbb5Ve5JTmyA2otiFLMyOM3E7 nBnfiuGQ92dAhfbpR/B77g2K8s9A/gNm9xaLKday0PFR1bJagGj3k3Apn8TkQ8Q41ei+eHs9QpZ MsvHi2mCLdI+LVxrHF6zj/2pwoc6aaxiKYLizCT+rP3CevVB2k9Einpw+g1tEdUxRchHnAunYeI rk1H9h+TsYWphTZdOy11JIn3HEwq/qDrUgaoBtwr+G5KoBWMxeVjmRyFQ3a0kIfUfUMoSqLfM8H bxAAK2yRt15MNn9fTRdtjcqPysD/c5Umyt2x6SP3zSg1Y+wHdwWWAi6yXzfan7t/+quoOQ4+UpL zFhOwZ5TyzEOSwrymIt6bkIKuIwtxQNJpkez/Yo0OIJ42v9m5KhlJ1dLnC6nxc0L8E9XD9XYgnU QMpmPqZeJ5KMcWJMMTmcO/L1k6cdVwOZtnv8rlHRyaI/Q++AGFnlLga9Te4/IzBfIBV5uywmXpf tTJNV2Ndw0vnNKg== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-Spam-Status: No, score=-0.8 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 10:43:04 -0700 (PDT) In preparation to add support to the new memory transaction descriptor, the ep_mem_access member needs to be removed and hence even the macro COMPOSITE_OFFSET(). Let us switch to using the new ffa_mem_desc_offset() accessor in ffa_setup_and_transmit(). This will enable adding the support for new format transparently without any changes here again. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index dadd56d17c20..e0a0c7cedd90 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -449,14 +449,15 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, struct ffa_composite_mem_region *composite; struct ffa_mem_region_addr_range *constituents; struct ffa_mem_region_attributes *ep_mem_access; + bool mdesc_v1 = drv_info->version <= FFA_VERSION_1_0; u32 idx, frag_len, length, buf_sz = 0, num_entries = sg_nents(args->sg); mem_region->tag = args->tag; mem_region->flags = args->flags; mem_region->sender_id = drv_info->vm_id; mem_region->attributes = ffa_memory_attributes_get(func_id); - ep_mem_access = buffer + COMPOSITE_OFFSET(0); - composite_offset = COMPOSITE_OFFSET(args->nattrs); + ep_mem_access = buffer + ffa_mem_desc_offset(buffer, 0, mdesc_v1); + composite_offset = ffa_mem_desc_offset(buffer, args->nattrs, mdesc_v1); for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) { ep_mem_access->receiver = args->attrs[idx].receiver; -- 2.42.0