From mboxrd@z Thu Jan 1 00:00:00 1970 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 E9C2DE8FDDD for ; Wed, 4 Oct 2023 09:12:31 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BMXkR0IZRjHagGhvQhAnZhXa+Y7v2ud9/2QBmsENv7Y=; b=K5c32PUd3Sjt6b KuwaOotisSHl6X4PCYg0s/G1weLwPDH7hd0wwHcuB0IcxbjPfonXmbmkacy0guANzybKnm69/PBxd 5muAaRxbAYmbOfsQ1BBW4ufOgB4FmeNOagCMez4qugjuM6MyQSPeCuU+jwEVqrJ+5wVjZDaqmH3FJ /KWDwDpLUdV0nto+eIXNwR3Vj5CutCW3TKnEuKrJWopBwu8OM6u9v/KebpsavWYCLtCYcvG6fqmWY /v29MkrMV0ken7FMThkfAuJ3SDqf6q+KlCl7qKrc6tz/mscLqJDKRbF5lOXuIayotg+aeYrIJmshh CgtQ8yMaiAzJR4esmYog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnxvH-00H0Gv-2e; Wed, 04 Oct 2023 09:12:03 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnxvF-00H0FG-0I for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2023 09:12:02 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9ad8a822508so344508566b.0 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=lists.infradead.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=rOk5i7VtIis3mfeDHO9nLu0PNVr0MpIosahh88GZrWnPdK9KWq8OvtvmnV1VT8bmwA w5jTE9XdizZeWzHF/038FQZ/34YznStNYrZRNhT2qovvFcD8XFrK28T3b98DzztWmS8F KXyvOez5PGEk0nPAZlznXeBE6FA3CZPFyeAZdFOD1jSm8EkKzjy+gCvE6AI891UX25Wn e4p7eNAOVaWO6YQ8sM0IzpdREhgp196VBDfEeiv+Jf2TgSqH1Ra6GsiJvBIJ9P/6g3CW xqkV6wZZ3+ZeAeVPHFaRqViGMrnKHvPiRjgusq5hp20iFhDKnebjqVcZz9CpfH7GuqPQ +YOg== 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=uBtHFdJpc6M9hsjnXA8O+Fy2wiEeV6wZe/jDYX8aPQ2NloCYyML4uq0nh1hFkERhmM MGoE4/dWyoBG+Ngo9kZmjQkXHcJCMNS7JF427giKVdh9sjyiV1RgBZ+wPCckf8Al+HKL Y7a7rGJNsGzWnYUwaISiIH1r1KfY4Es2iZLV+H9/DZlQbYiT2QzCIp5ZS06SLJw5cU/5 +8u0b4oT2zmowBAk9pE0W7ltP3lr+ThnoZmiJ+dXjFhu4sxjKKInGskzRDT2IUyKs0r/ 9LUou6JPpDFx+sdaXIAAzdYx+ggFkBF6cBnUbOcIqg5NDmJw5Nsvza5uCx6wmmmL/Oln N6dA== X-Gm-Message-State: AOJu0Yxnj931f+L92KGDGBDfY/Wf5YF7hbFAFZPRn8kLSS6uYge1rYqi fM+51gdqk2MAmNyZLuB6hPMyeQ== X-Google-Smtp-Source: AGHT+IFdCq/a3Ahhn3WZlqm5Nk2OC7djHwlYLFv5BofaQ2vxpeiJPbXJjIZWTFKJ9mcv05gaELflyg== 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-Disposition: inline In-Reply-To: <20230929-ffa_v1-1_notif-v3-3-c8e4f15190c8@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231004_021201_135092_1BC65FAD X-CRM114-Status: GOOD ( 24.83 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel