Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2473918rdb; Wed, 4 Oct 2023 02:12:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpL/yKhwwFdDCR31ZbbBh3FN2u3959T7XH/qQoLQ+BY5pJ0ycEiMENnefhQuPvQTP67LM6 X-Received: by 2002:a05:6a20:1a9d:b0:158:17e6:7a6 with SMTP id ci29-20020a056a201a9d00b0015817e607a6mr1516895pzb.42.1696410733379; Wed, 04 Oct 2023 02:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696410733; cv=none; d=google.com; s=arc-20160816; b=pk6tSfWs2wBfD98nX/07y4Xawhls5vaAL2lYdN9nQ7e0adtUrBoM+kAkAFeTRsQmuo WL+UifqxtZVms9vW86ifTO2IpTXAcQktfUqUXhOBe8TA9weYQu85bcdA1r0DBlaEpU+D a2OhfMaQjS3XMdqdpcBy19EK2/KdYX/lU+liD1NVMNEWepWipUzRYzqb4QCSwlvCDn+e 43Fxz1XPlOrM3wiCTclZzVeaF7aslZ0qHzY0a02eFp+l/ZLBWvenlcwyP2TrJ9iuEMbZ Zs2RteHR3V5i+Ojg19Rk8F3SzTKJNoaXg+R/1N8R7Ev1i29InaXguUHRuyPcuA+D5svt P6zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bdOdPPFMdcei2S7fb8cUUxol5V7FnF0pUPc0MzWLtwM=; fh=QcgK3Sk+ji0WwgAeFVTBy3YGJ/qOucM0zDsBjDfcshg=; b=HfpJDUMfFOgqNfxFtfqTYJqlf0gWEB+b+4b7fFnY66o/jRcjVwNZ2yUr8tc4shYujm /YsaQSw1/442IkQHuZ3qldre9qEnCCpsTz/lEkpGC1dp1efUBlbd5VxGzGdJqcZjzUKt e8UwL9905fDMKNT8PqoxJwT4Ea+gUoAycZVQ6hNV3AluI4saWUV0UsjBQt01IaQulH1o U54BsE9yeN+uTTOhy1zNEMsJxclgi46YKVchYcopayuJTcCmsH44iMksLFUjJdPDzF+q 14dH0jvpM/lkN1ZqPkmWd/aDdn63e0V07yt/TiO7BlSCkz5YoJJx/PpZK3I1Ao4Q1GZ2 xotA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eRTp74y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h7-20020a63c007000000b00565360714f0si3191130pgg.902.2023.10.04.02.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:12:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eRTp74y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B08EA81A4A1F; Wed, 4 Oct 2023 02:12:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241926AbjJDJMD (ORCPT + 99 others); Wed, 4 Oct 2023 05:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241885AbjJDJMC (ORCPT ); Wed, 4 Oct 2023 05:12:02 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0DBE98 for ; Wed, 4 Oct 2023 02:11:58 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99c1c66876aso342112866b.2 for ; Wed, 04 Oct 2023 02:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696410717; x=1697015517; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bdOdPPFMdcei2S7fb8cUUxol5V7FnF0pUPc0MzWLtwM=; b=eRTp74y3HaboucgV4WqVJfo7fRzQqVlA/OO0Am/guxhc5mToBw8/HgerSSLH/aVRsY AU6cV+chlewyM3dFPepu4mNHkugXFiLflpR4Pz5KqxC1PHAhiELapyGQNmRKB319NljH ltcYUxrZJMVFWENmHJCkeL6H5PDwsZK0n+wXHeFRztKNL83lXr/HUnn6DFvVHkPwEMld Xqa3WCcaca2UhzqgCxDbi8h9ylZp8+ngCyw0ov8a2aePbcN8SRxnHLfMr/LMqIhLRVAM w+AsU8rC0gMNJwouRDgEKcCPQDva0MsQ3RfPesBGqWxeIhNWBFPyIqb82SLAVwS0jR5+ h7lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696410717; x=1697015517; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bdOdPPFMdcei2S7fb8cUUxol5V7FnF0pUPc0MzWLtwM=; b=HmL+kNNxFHaqfYETimm52BVFwHuy1nkV8iYF6/OXjTXg67vRlqAO27l7dDqIwvk3lq 5sT8IPzrngkO5Taunw5Q0zq74EL9dDV02m6+A42c+5HxXyhIbHRHTQeLYptOVL/hY5Ss G28Yi9VRPsuTAdCPJmLhk4h0TmSOPRkU/2RIKOWHNSF901kpPflGT1pMn03Isxh/NuPR 7fgZ8vrQ7nkWdKi4NgiLq4RrJMko1ghvgsb7h7hEymVgWMDUyCWamqEo0VSApcOZVgMW 9CUIcbEzfymBSNh1Pn3EkSFnDTQgnzdu5ULiUG4I3z5YoIc3bxXM5vvsJJYpKmOjnaXv 43YQ== X-Gm-Message-State: AOJu0YxG3BwkVuuukVzJLyvronsU6SGUsghOP2mwhEPx58zDFX2Ugror B0cl9GxloYVPOptL0nQpkIbr4Q== X-Received: by 2002:a17:906:13:b0:9ae:519f:8276 with SMTP id 19-20020a170906001300b009ae519f8276mr1423408eja.73.1696410717148; Wed, 04 Oct 2023 02:11:57 -0700 (PDT) Received: from rayden (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id g12-20020a170906594c00b00997e99a662bsm2448324ejr.20.2023.10.04.02.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:11:56 -0700 (PDT) Date: Wed, 4 Oct 2023 11:11:54 +0200 From: Jens Wiklander To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marc Bonnici , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez Subject: Re: [PATCH v3 03/17] firmware: arm_ffa: Implement the notification bind and unbind interface Message-ID: <20231004091154.GB1091193@rayden> References: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@arm.com> <20230929-ffa_v1-1_notif-v3-3-c8e4f15190c8@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230929-ffa_v1-1_notif-v3-3-c8e4f15190c8@arm.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:12:10 -0700 (PDT) On Fri, Sep 29, 2023 at 04:02:52PM +0100, Sudeep Holla wrote: > A receiver endpoint must bind a notification to any sender endpoint > before the latter can signal the notification to the former. The receiver > assigns one or more doorbells to a specific sender. Only the sender can > ring these doorbells. > > A receiver uses the FFA_NOTIFICATION_BIND interface to bind one or more > notifications to the sender. A receiver un-binds a notification from a > sender endpoint to stop the notification from being signaled. It uses > the FFA_NOTIFICATION_UNBIND interface to do this. > > Allow the FF-A driver to be able to bind and unbind a given notification > ID to a specific partition ID. This will be used to register and > unregister notification callbacks from the FF-A client drivers. > > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_ffa/driver.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c > index efa4e7fb15e3..26bf9c4e3b5f 100644 > --- a/drivers/firmware/arm_ffa/driver.c > +++ b/drivers/firmware/arm_ffa/driver.c > @@ -587,6 +587,35 @@ static int ffa_notification_bitmap_destroy(void) > return 0; > } > > +#define NOTIFICATION_LOW_MASK GENMASK(31, 0) > +#define NOTIFICATION_HIGH_MASK GENMASK(63, 32) > +#define NOTIFICATION_BITMAP_HIGH(x) \ > + ((u32)(FIELD_GET(NOTIFICATION_HIGH_MASK, (x)))) > +#define NOTIFICATION_BITMAP_LOW(x) \ > + ((u32)(FIELD_GET(NOTIFICATION_LOW_MASK, (x)))) > + > +static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, > + u32 flags, bool is_bind) > +{ > + ffa_value_t ret; > + u32 func, src_dst_ids = PACK_TARGET_INFO(dst_id, drv_info->vm_id); dst_id and drv_info->vm_id should be swapped. Thanks, Jens > + > + func = is_bind ? FFA_NOTIFICATION_BIND : FFA_NOTIFICATION_UNBIND; > + > + invoke_ffa_fn((ffa_value_t){ > + .a0 = func, .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 void ffa_set_up_mem_ops_native_flag(void) > { > if (!ffa_features(FFA_FN_NATIVE(MEM_LEND), 0, NULL, NULL) || > > -- > 2.42.0 >