Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp404964rdb; Thu, 5 Oct 2023 09:09:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRbVSSewmirhmgR8Oy7wcugeuv+r//Ca1uYtRr6nABYck+iAEsgLnUJ/9chqGawis3YFYH X-Received: by 2002:aa7:88ca:0:b0:690:ca4e:661e with SMTP id k10-20020aa788ca000000b00690ca4e661emr6210308pff.19.1696522177015; Thu, 05 Oct 2023 09:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696522176; cv=none; d=google.com; s=arc-20160816; b=Kyz0MdyE3RDL1JI1AqDq8Ji+uXyxsK8PcnQGj3klPrrMtIROcn2yuRVnfdtKE/LCvl pYAPfpqthiGXIHhvpMVzvTiTZnGBCuMgm/lMGhUZWndwux/cDnEZQ2gYTC/aLT0uT3yj cZFNCdT8I/x9gvz55czypuXYQno5yIPJuEuxd2Mrhj7KRPQ8SmOa/RHYPZqgv+SI9p2y Mi07fqZLIv1Q4KF/I9HQ6xywho2cVsjdCS08EPkDbXaWJEBH8e7sCvHj18o7+rOe+YZM MAMdbCPkgOLAOtoE91vpwXPl6rdeCuYFyxfL1ixi/dk2W3evM63JE46vr+qrsssCuRst lpcQ== 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=zvStKXJS3oNBObli2Nkwr92msYaicUUncl/aRBkQ0iY=; fh=iZJRvoZuVJp3Jcg3UWu0imuTLbH0nKChof8pDyzNHj4=; b=h8WnW8ZkELHsvG+MDChtPJoKV635x69x/SY5HbaOISjIz72jlj08iqHstGuKe+qT+I Dr7JgBgndfMRPnW5NO9gUs3TA6P/oeSC1OHKoJ50huhjppb/mQOqm5AXLumdVGt3W4yt jHMZzBWS4OCpAmdn3vG257hFffKvnX+QDUMaeWFxwxzQEEdqr6LVI9k3pj1RYWGX+joZ bfcIFa0OKj94+GR/CnMFnUQopeTx/L9HEBcytoMY3Pt32Y3tjezFvqqouP0Zm2uBLavK Stk9AF0gVuSkabz9/s1aCybIe2bVxJj99WW3Mt2hAcazSRsVwDWfbua9xAGPa7PbKur0 OUNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s135-20020a63778d000000b0057888936295si1640054pgc.767.2023.10.05.09.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:09:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 D936482D9803; Thu, 5 Oct 2023 09:09:10 -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 S238920AbjJEQGG (ORCPT + 99 others); Thu, 5 Oct 2023 12:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237608AbjJEQEI (ORCPT ); Thu, 5 Oct 2023 12:04:08 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2265BD4B6 for ; Thu, 5 Oct 2023 07:45:58 -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 08C691655; Thu, 5 Oct 2023 07:46:06 -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 50A843F641; Thu, 5 Oct 2023 07:45:26 -0700 (PDT) From: Sudeep Holla Date: Thu, 05 Oct 2023 15:45:08 +0100 Subject: [PATCH v4 15/17] 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: <20231005-ffa_v1-1_notif-v4-15-cddd3237809c@arm.com> References: <20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com> In-Reply-To: <20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Marc Bonnici , Jens Wiklander , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1380; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=dftsGeY1DJoCwWfBKEb8lal/PjiIATpRlO3OUrofRCc=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlHsvyU+xRMy3zAAPz5EmrKB/zbOi8MBAJRtWAu gSJrAtP0TqJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZR7L8gAKCRAAQbq8MX7i mMzlEADC7lH5pUpEzXnZb9aFQtnhTnJ0WRHy3P6aG27izufZJSrmsAlykpGuUcdyhfN6mWSDcTK I/CeMK17mZBbJw2pnGfJp2WHYOfcbY3nPP5xcoi1Arem8t8y7YfgceVxaATJpaiBF7mOfZHuOPL bvonNJg5hali/lX5uyKbGTqmO12QjHHCtmCFtS/+79nTqpILkF9QcnLbEU7tUukbplE7YH4o4KS UxllLl9c3KNRsENtPP3cNt1swBdF2CLRwNmgHVW+fBEJ6mvmoIYJhSJEWx0zQHKULWYIavUqaNT Inh4L3sY/6YmhRaIrY7goieuI1zdz4ZYsDxTI0r076/fWqb6Lj+sB/SVr1ia/+wsYpg/PtHTzXh tOaBu0oyRh6BqHXFM49GlQKozWKV/advFhy25KTuryCQcbSR2skEJe/b/EhuxHx8/LJGCtLOeFX PQ05NvrMMXQLkApitInDB1kKifye9pwk2XkfsyLkZMsKIY45qD8Lkmy/17JWvgx2+VeAwD+eR2V WL6+M8fUOUJe0mXNmR2KibP46sIizy/1a9luMSMC1s1IdPZpWjSTk2e0WBthrco8Uw5JIqZRroC 7fTMxSBJ4YwKDAB5wTK2dv1jJ1MN5Z7hdpHVranN7qMUpaAWVBDUaok7CFxyEfqKv87OsKNttSt l2IZL/v5JzMvXpg== 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]); Thu, 05 Oct 2023 09:09:11 -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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 45ad704734a2..4de08ffce599 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -454,8 +454,10 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, 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, drv_info->version); + composite_offset = ffa_mem_desc_offset(buffer, args->nattrs, + drv_info->version); for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) { ep_mem_access->receiver = args->attrs[idx].receiver; -- 2.42.0