Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4017718rdh; Fri, 29 Sep 2023 08:52:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIGG/jL8i+L8Nu+5me+HGPGNtENXGGyVD50nSDS/qYNqoIkpsYFeV4HN0rNlXmZXAKYadv X-Received: by 2002:a05:6a21:9984:b0:159:beec:79ba with SMTP id ve4-20020a056a21998400b00159beec79bamr5380314pzb.2.1696002723316; Fri, 29 Sep 2023 08:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696002723; cv=none; d=google.com; s=arc-20160816; b=w8K5JdSApDbD9dbcF/YyiUmaZrgQaThmtFT2gDskqP138MiGcUNJ4f7zd0OC+sANPD S00XVSyzHHANZ6ZR8UxuPCma9WlFthNSD+nK+QxtdhmPFrhog0UVya4GHxCEiSGDgyTP xXNfolVi1uKN/ZJLOJLXhQUE6oBoF/idV54N7A046l3ZFKf0gOEMoGTLdwbObr9LTsnT zaPAzKfCccEoABgnaZJZGcYqa3gkU+d2hcsa8xJa3I78B+3p9hCLdcmYI6XcWgiqRRdc xM3BqdKalOmi583Lrx3LmnmkPJtn9300eUosSbwGDAaCkgfQ8YNVAFhbu6qe8BfoLG7w QdsQ== 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=sNK/P7KB8KqTQkKt3VBpWTcjiTjAbC/j7fZFMOOxSgw=; fh=iZJRvoZuVJp3Jcg3UWu0imuTLbH0nKChof8pDyzNHj4=; b=vOJyza3Uccyh+EuFtyo3n46Qnbjtp9cV6/bjdE4BRm8rvv7IgykiWQUzXVJNeGPp9H qkH37bDqbiznNHNwDn3ystuJ8S2dW6KnuwSECIjJu3LCYGpUNY+FLFT2A/kqEsPWS2Cn zBv14lQji8s2beI3+vEUL5+RibfL4vaofRP5jTjNzw4heB9X7p/IBlXBGakHe/HkoPQf OoQU2KRoNJWg81F/Gt2mKdHUD2A+GUBnXCBNStpNHmY1klJdKtkko4xg2SfS+vzRdBQZ P/hHuGvyyt65osdFpa+4dz3Jk7rEiPQk0yR0oPipxgpUAgpTzteg9U+qI//8Vlcxceqb Rg/g== 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:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id r203-20020a632bd4000000b00573fc6a17dbsi21905282pgr.435.2023.09.29.08.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 08:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id EDFB98563291; Fri, 29 Sep 2023 08:03:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbjI2PDf (ORCPT + 99 others); Fri, 29 Sep 2023 11:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbjI2PDZ (ORCPT ); Fri, 29 Sep 2023 11:03:25 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D77C71B3 for ; Fri, 29 Sep 2023 08:03:20 -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 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:03:47 -0700 (PDT) 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; -- 2.42.0