Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2660798rwo; Thu, 3 Aug 2023 12:51:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEtTPAetbZLRkMPOr7ZzxGQ9TGvWtOu0SoQlYFGCkAYGXfGfkTtB5FDfDP9y1m1fr++RlUg X-Received: by 2002:a17:903:11cd:b0:1b9:e972:134d with SMTP id q13-20020a17090311cd00b001b9e972134dmr16957936plh.3.1691092268856; Thu, 03 Aug 2023 12:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691092268; cv=none; d=google.com; s=arc-20160816; b=qNSSeYupeKx+Bfoq//wreZeaVSibF6X/N5aR4PnXxNHIgluWq8e8BstTizLVGd7EwP zRRfxNM63dQZtBW25rWPcNlHaFtTQP9KVepzAJKHPluP4rzXMurIEgcCZb0YujJRniu9 XcMwyCXmniwe1HzVx6/9FXl0t3kbdkeaprTSKkkUrZnRmwPBGx9YpT0jimpgv2mhpk6X IPYwKmde3JnHp/L0aAlmmta1ZAyKY6ZceTgAYBeozqTXy+HZvT9/X33CMLpMBMHD5PuK dWSWQls7pbo/SjIFk79X7EpCAOk+L5MAtOUCeg3e7y6qmwXHScSTvr4SHUFe/D2dgQ/O hr/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JXqQt/SxGtMWP2D8zSpW6EuQ1prz2Po3fFz7ouipGH8=; fh=uIXkm8cj3c9TR2+QLs5NFfyS+JdekmBAQ3a9JCgCFII=; b=r6yhmg95k5AerRyJWiXp0Fn4Y0Lpa3/F8FdvjjG8waEfyddgXN0EJlJ0jLiaNDubFc QDSqWBeeQgWf6h+K//Pp/r+SjDTEGrd6tlPs3d112K0sR394v4Fth+dOsDiX27i1G4nB ZlsORhhYafhDr18ZQuQ3HjjmzaVfLI+a+oG4pt2Tv7yEJtD8fRuv+7Vntagh/v74TxDi ROQKGxwOLPFNTppQJXt6YlPWu9b0VHHypHOpaQOGpZ/cilajmGm1MaFUQwKlQvxJ87qA TmvMaGLNW0Vv5x8/s3q73JovjaJgr8V3pgcJLZtw9CqY4wOJyzXgqD+/6bGAyj4vyVwB E3Vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a17090341c900b001aadba392c1si520085ple.464.2023.08.03.12.50.55; Thu, 03 Aug 2023 12:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232152AbjHCTCj (ORCPT + 99 others); Thu, 3 Aug 2023 15:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbjHCTC3 (ORCPT ); Thu, 3 Aug 2023 15:02:29 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BFD412D45 for ; Thu, 3 Aug 2023 12:02:28 -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 88F7B14BF; Thu, 3 Aug 2023 12:03:11 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6DB2C3F6C4; Thu, 3 Aug 2023 12:02:27 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Jens Wiklander , Lucian Paul-Trifu , Marc Bonnici , Coboy Chen Subject: [PATCH RFT 05/12] firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface Date: Thu, 3 Aug 2023 20:02:09 +0100 Message-ID: <20230803-ffa_v1-1_notif-v1-5-6613ff2b1f81@arm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com> References: <20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=gIcrWaE8JjUgJBbBV1coOUsOSzQnr17FTAXR0ZVKxfU=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBky/iNKfnamF9bQ6t4TFfYJFZV5REuiS1Xy3AD1 vlZ5aBZZsGJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZMv4jQAKCRAAQbq8MX7i mH0iEAC6zQT+zR4ZBTgQfPzkLYDo+kli3u41l6gxWq9DroxO21dHwyuoxTNebt9LONyflU9080T 3C8Esz2fATBbZepXXtLymI/w5eqABbzsqEyhNbkO5tvJEFuzlfpWjdI0pH7a87uqhDwNU+SfmGi ds4bySxPNCTe3VCYZtLKwXpHkys63ide10vyGav0i0PHiFVTa662IKduPD++3ilsRcsVauaQaSq 8zx2Eg+MbDxSizAnii878HgO68JWasJ16Oedm2sCdS5nBAZ9ngasItOSBduaDAc+Vl5VkQyiYE+ hMOHtvdsRLSQVc0GTDuus+MKboxaSwqxjvjUOyRNHne/MQshMCdg8nr3I9WmrWyXlhMDxC7HbEo 7EjHYevbXwvbZtb+HjyDreSBl7lCR0p1Vr5xL0NNMQY/UHHgz1mJSknxpTgTJnTemOUOORVWisv 6Zvcpg4zJt1ve7v4NnspCL/jdD7l2hfGQULukUBDAOm6lxOzfyX7gBp7cQFbafhheMTez/qTUqF cVuh0MlSTCisXkaOPA7vMeJlc+MiQWqRyWE5qBN4h2seBZQ26M1POhMtzpgxPKLwi8VWQE7ReN8 EARC93Fc/nWtWxn8fw72W5j2peB82WNDTyOSLgDT9y/7/Qi7KfWOde4AS0PEc8cXutdqfcL3Rim HxtYrY/f gkkqNLQ== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 41171ae7f63a..492f5bfa3751 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -604,6 +604,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; -- 2.41.0