From patchwork Fri Sep 29 15:02:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13404517 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 39533E71D40 for ; Fri, 29 Sep 2023 15:04:25 +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=t6XsNXT3xSbYpcfxl3hbEjyg5qA+7dDeNEk1bQ2SlCk=; b=GJe/Cv5DlBIMqZ OzmPEWvIyBaoZ4cLC4MnTeHqParu2T4Kf8a2uRKSePEQSq2GbKR+c7xJVCn4YvLsQZMZ8XXBLHBeH rrpkqo+Z0eVxsIC5yRxbHojqv8SQ1QbYfgCG2Cn2NUmHFAwgObNGSnQHn8cv/4I9HqLW4G9tec/aY Rs6M1UVF/GppVMOZt1JajrxQZIWto//QoZi1VV9hWYQfqhpTSIqc3MW3wd5UbDQk1O1MfcseYKLvG Ajb6NDK4YhdAtTP5/1lUZ29ej9dhsd3Y/AmAkGv/C47y1nvTBj2xfLJOmuqp3jchP3Yfatx/AKZOW DDjpnQSA1YczZjisrcyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qmF1l-0088Np-36; Fri, 29 Sep 2023 15:03:37 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qmF1V-0088E3-11 for linux-arm-kernel@lists.infradead.org; Fri, 29 Sep 2023 15:03:22 +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 0CAAD1FB; Fri, 29 Sep 2023 08:03:59 -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 A9E713F5A1; Fri, 29 Sep 2023 08:03:19 -0700 (PDT) From: Sudeep Holla Date: Fri, 29 Sep 2023 16:02:54 +0100 Subject: [PATCH v3 05/17] firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface MIME-Version: 1.0 Message-Id: <20230929-ffa_v1-1_notif-v3-5-c8e4f15190c8@arm.com> References: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@arm.com> In-Reply-To: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@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=1504; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=NVitlqlRV6z20CY5oo4iFS9EKuyldYrTV9XNc0cCWyc=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlFucvy4pQu2saUIRdI36LiwoHG6ULgL6RfFRQi fMkLTenBjiJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZRbnLwAKCRAAQbq8MX7i mITrEACmc38jc6FrQ9DZH7qAj0dD8/GukHrMcd5qq5SLIcbmUX61YipNeM7Kd2ppRcbWZ/xGm2Q AulqjS6eYgOY2h27Rp5bcyYpVlxp23XO9No+SELhluA0oG9uwlJXihjfG2/RbtQxbV5d0gQ59d8 Ttd797Cq5/SSIQzAl98HZfRFnTBPv/gGN7yyIA92eJis8mpuW1jJcj4vPlooG9cqkE4Eb2aoraM agoNF6JPVw+qDCNyJKNq6igaw0zHlQzrT2Hv0OFuX88eHjZb9dtGaTRJ0saCtj/GC3G4LcD89qG ekKeFQL8jxcZQHCbSbcZ4CSUsFBe+NRTiNi7bvObHMlQgjPiF7Ucy9rX36ReR7iLh5suRXBd59g iMzZK2zKs3EKXnM5W31d2iT4pKgVgvSBhkF/diAH01uAXX9x4/cVVQ8n2Ji4tPajh/R9eNOSPIy c3NAvTm09R7x6E6YYE8b1gthZ9fiCiueKuyk7Dk8NhPHzyGVJn3ECcGVgO94aiH4rQmkZhrSORs vEsxUZiHHw+rYa1UOp0hmp12I2QBFv6nfY6nDdyWKnOmR0dAPVffO2OjvAPk0Z+xTRkZtK931JS gfZwD0xyCQPB6XHe9G52fWY6Dqr5puzKz5qDATddMmVtAx1Q6kM3/10UMRYla3G6kO623MzgD3r I/j4tJUpRtZIDAg== 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-20230929_080321_403341_71A85E6A X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. 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 The framework provides an interface to the sender to specify the notification to signal to the receiver. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver invoking FFA_NOTIFICATION_SET. Implement the FFA_NOTIFICATION_SET to enable the caller(sender) to send the notifications for any other partitions in the system. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index b265063e76ea..b0d1ddfe0230 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -616,6 +616,26 @@ static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, return 0; } +static +int ffa_notification_set(u16 src_id, u16 dst_id, u32 flags, u64 bitmap) +{ + ffa_value_t ret; + u32 src_dst_ids = PACK_TARGET_INFO(dst_id, src_id); + + invoke_ffa_fn((ffa_value_t) { + .a0 = FFA_NOTIFICATION_SET, .a1 = src_dst_ids, .a2 = flags, + .a3 = NOTIFICATION_BITMAP_LOW(bitmap), + .a4 = NOTIFICATION_BITMAP_HIGH(bitmap), + }, &ret); + + if (ret.a0 == FFA_ERROR) + return ffa_to_linux_errno((int)ret.a2); + else if (ret.a0 != FFA_SUCCESS) + return -EINVAL; + + return 0; +} + static int ffa_run(struct ffa_device *dev, u16 vcpu) { ffa_value_t ret;