From patchwork Thu Oct 5 14:45:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13410170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15626E92708 for ; Thu, 5 Oct 2023 14:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References:Message-Id: MIME-Version:Subject:Date:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fgn9a7wAv026ucUy0iSUNpNqKUnw3MVKs6/DuvzcQD4=; b=N9tjghCTFVxE7O KCkvw04gBxOyjpJEFzaHEYR8PFlAW1a1m1WH6xxt4SN/4xvebCS1lqnuclc4ZmcE5djtIFqNLrpGz 2c7Kip7aQ7i+VF1NNkiXrqVs57HHsrMGo3JA/5tL2TA0/HbjZoK6PdnltE2KJr7cy4Mz9DGmbfd0d 4Jcp/DR6WvafHpd9IJx3bO/L0A7ifA2w7ZiubWRK2yMtIwMMawO2b/OLZs0dHpeT/CMRoHIldIuyx +B+XxwzG/9Dz1TjiYSsb6CcicxnV3eTdA/jmhtf/92cZfhRwd7+tI1DBq9jjL2Jifnzc6JknN1blo siCznw40/DKMzlFbMYGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoPbj-003lyT-0Q; Thu, 05 Oct 2023 14:45:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qoPbU-003liI-0l for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2023 14:45:32 +0000 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231005_074528_378387_51DF8FC1 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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;