From nobody Fri Dec 19 09:45:02 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C112DE9270E for ; Thu, 5 Oct 2023 15:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231597AbjJEPZi (ORCPT ); Thu, 5 Oct 2023 11:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbjJEPZA (ORCPT ); Thu, 5 Oct 2023 11:25:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC1773852 for ; Thu, 5 Oct 2023 07:45:41 -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 BD3F515A1; Thu, 5 Oct 2023 07:46:00 -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 131023F641; Thu, 5 Oct 2023 07:45:20 -0700 (PDT) From: Sudeep Holla Date: Thu, 05 Oct 2023 15:45:04 +0100 Subject: [PATCH v4 11/17] firmware: arm_ffa: Add interface to send a notification to a given partition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231005-ffa_v1-1_notif-v4-11-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=2181; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=iR7xv4zWGKiCOfOTUrWKzr2y6gNM1XQTF7Jjqnppvvw=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlHsvyUa0kf0qaS0e9Fg2dVQkQFVfR5hK3IAhDQ 3s8+Y7UIlyJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZR7L8gAKCRAAQbq8MX7i mCgED/91RGR3wwqUHgbGtWvWw4cfovaRPFwuGja8Cj4hR3egB3+yLDr+TPgjf+wHVIK/ZEs5HFw 0R+5bItjUQwwU7Y80SQYiSM9FkybAD3kZB1FBRsTl6beRCGLrJ0CklF1pPVOdF5XsSnbRLWhKx0 jBnxfrKRfPVqjsfN5Yi5f6ULO440sAzg8cg7JtIJWr90zNlP73H+zJ6vXquz6TmeCyi77JF+FST yzN+4c8CE8gJf4IhWYCbkNp/nNnNCPjGngtU1+u5h7KLbgThhnTJ8FILeuE+4wIvQo5ZsJCgG63 bhvLgyIXKeDemXY8cE7Nyjkz2P+sx+1aE5WPUTY+mFTn/3ghi1A1bQj0Ve+k2H/QCzFFNHzxtya SLhDDj8FntmyY0B4LG3jPV2AXUXUduTzRZPXHGrylpLBphhEyfFDfzFZ+zvJNGsQdSOOPGEnZqH FaAjTBLfPr5z430rzOETAznr6tmCsDwG9i+19z9Tar98vh0XO4SwrMAxqy8VffZtydzvMIsVqPK 4gVugFVckzfTH7qK/TMMsOI3slkz/eVg/3pDovmx90tjBpkDd5E5nSHTQlD5oQ3GjGEcnDWYbCV W2Q6S68e32v6eQhNtRb7Ee5LN6Q4hANzyQg8lkVcWi+i0burck21d8HG7I7T+XIFwSDbCqD4QeZ EMS66X/ci5BMM5g== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The framework provides an interface to the sender endpoint to specify the notification to signal to the receiver endpoint. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver. Expose the ability to send a notification to another partition. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 13 +++++++++++++ include/linux/arm_ffa.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/d= river.c index fc8b29648fb2..2a46052a280a 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1038,6 +1038,18 @@ static int ffa_notify_request(struct ffa_device *dev= , bool is_per_vcpu, return rc; } =20 +static int ffa_notify_send(struct ffa_device *dev, int notify_id, + bool is_per_vcpu, u16 vcpu) +{ + u32 flags =3D 0; + + if (is_per_vcpu) + flags |=3D (PER_VCPU_NOTIFICATION_FLAG | vcpu << 16); + + return ffa_notification_set(dev->vm_id, drv_info->vm_id, flags, + BIT(notify_id)); +} + static const struct ffa_info_ops ffa_drv_info_ops =3D { .api_version_get =3D ffa_api_version_get, .partition_info_get =3D ffa_partition_info_get, @@ -1063,6 +1075,7 @@ static const struct ffa_notifier_ops ffa_drv_notifier= _ops =3D { .sched_recv_cb_unregister =3D ffa_sched_recv_cb_unregister, .notify_request =3D ffa_notify_request, .notify_relinquish =3D ffa_notify_relinquish, + .notify_send =3D ffa_notify_send, }; =20 static const struct ffa_ops ffa_drv_ops =3D { diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index fb6f388a3737..f6df81f14b6d 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -401,6 +401,8 @@ struct ffa_notifier_ops { int (*notify_request)(struct ffa_device *dev, bool per_vcpu, ffa_notifier_cb cb, void *cb_data, int notify_id); int (*notify_relinquish)(struct ffa_device *dev, int notify_id); + int (*notify_send)(struct ffa_device *dev, int notify_id, bool per_vcpu, + u16 vcpu); }; =20 struct ffa_ops { --=20 2.42.0