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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB144C64E90 for ; Mon, 30 Nov 2020 11:14:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B6E82076E for ; Mon, 30 Nov 2020 11:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728632AbgK3LOW (ORCPT ); Mon, 30 Nov 2020 06:14:22 -0500 Received: from foss.arm.com ([217.140.110.172]:52628 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728619AbgK3LOW (ORCPT ); Mon, 30 Nov 2020 06:14:22 -0500 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 23DA71042; Mon, 30 Nov 2020 03:13:36 -0800 (PST) Received: from bogus (unknown [10.57.62.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDCD23F66B; Mon, 30 Nov 2020 03:13:33 -0800 (PST) Date: Mon, 30 Nov 2020 11:13:27 +0000 From: Sudeep Holla To: Jens Wiklander Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Trilok Soni , Trilok Soni , arve@android.com, Andrew Walbran , David Hartley , Achin Gupta , Android Kernel Team , Fuad Tabba Subject: Re: [PATCH v2 7/9] firmware: arm_ffa: Setup in-kernel users of FFA partitions Message-ID: <20201130111327.xnw7gzqgygpjiays@bogus> References: <20201103174350.991593-1-sudeep.holla@arm.com> <20201103174350.991593-8-sudeep.holla@arm.com> <20201128133655.GB8649@jade> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201128133655.GB8649@jade> User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sat, Nov 28, 2020 at 02:36:55PM +0100, Jens Wiklander wrote: > Hi Sudeep, > [...] > > @@ -113,12 +117,19 @@ struct ffa_driver { > > > > #define to_ffa_driver(d) container_of(d, struct ffa_driver, driver) > > > > +struct ffa_dev_ops { > > + int (*open)(struct ffa_device *dev); > > + int (*close)(struct ffa_device *dev); > > + long (*ioctl)(struct ffa_device *dev, unsigned int ioctl, void *arg); > > +}; > > I assume that all interaction with a SP is done via ffa_ops->ioctl(). Yes that was the idea. > For example the ffa_msg_send_direct_req() function is then called via: > struct ffa_send_recv_sync arg = { .endpoint_id = xxx, .data = yyy }; > rc = ffa_ops->ioctl(ffa_dev, FFA_SEND_RECEIVE_SYNC, &arg); > Correct. > That isn't too hard to use, but is a bit inconvenient and less safe > compared to a plain: > rc = ffa_ops->send_recieve_sync(ffa_dev, xxx, yyy); > Agreed. > I don't see any big win in then next patch with ffa_ioctl() either. That > function must still do some actions specific for each ioctl id. So I'm a > bit curious about the design choice. > Initial idea was to keep both in-kernel and user-space interface inline. Also the assumption was that expect few old/legacy usecases, the userspace is the way forward. While that is still ideal, but things have changed since the main user of userspace interface(pKVM) is no longer using FFA. I will change the interface as you mention above. I was also more inclined towards that after dropping userspace. Good timing though, I was about to post revised version dropping userspace. I will modify the interface something on lines of your suggestion. -- Regards, Sudeep