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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9917BC001DC for ; Thu, 27 Jul 2023 12:37:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A8AA686834; Thu, 27 Jul 2023 14:36:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8EC858681D; Thu, 27 Jul 2023 14:36:57 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id A3E338676D for ; Thu, 27 Jul 2023 14:36:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=abdellatif.elkhlifi@arm.com 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 06513D75; Thu, 27 Jul 2023 05:37:37 -0700 (PDT) Received: from e130802.arm.com (e130802.arm.com [10.1.31.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCD013F67D; Thu, 27 Jul 2023 05:36:52 -0700 (PDT) Date: Thu, 27 Jul 2023 13:36:44 +0100 From: Abdellatif El Khlifi To: Ilias Apalodimas Cc: sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de, nd@arm.com Subject: Re: [PATCH v16 09/10] arm_ffa: efi: introduce FF-A MM communication Message-ID: <20230727123644.GA12766@e130802.arm.com> References: <20230725185246.GE3630934@bill-the-cat> <20230726094503.100497-1-abdellatif.elkhlifi@arm.com> <20230726094503.100497-10-abdellatif.elkhlifi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Ilias, On Thu, Jul 27, 2023 at 02:27:21PM +0300, Ilias Apalodimas wrote: > Hi Abdellatif, > > [...] > > > +} > > + > > +/** > > + * get_mm_comms() - detect the available MM transport > > + * > > + * Make sure the FF-A bus is probed successfully > > + * which means FF-A communication with secure world works and ready > > + * for use. > > + * > > + * If FF-A bus is not ready, use OPTEE comms. > > + * > > + * Return: > > + * > > + * MM_COMMS_FFA or MM_COMMS_OPTEE > > + */ > > +static enum mm_comms_select get_mm_comms(void) > > +{ > > + struct udevice *dev; > > + int ret; > > + > > + ret = uclass_first_device_err(UCLASS_FFA, &dev); > > + if (ret) { > > + log_err("EFI: Cannot find FF-A bus device, trying Optee comms\n"); > > This isn't an error. If you mark it as one it will pollute the console > every time you try to decide if it's an FFA or an SMC call to op-tee. So > either remote this or switch it to log_debug or something. While at it, Good point, thanks. I'll replace it with log_debug. > any reason why we need to keep probing the ffa bus? Can't we just run this > once during init? > Probing the FF-A bus is only done once. Subsequent calls to uclass_first_device_err() will not probe again, they only return the dev. An existing dev means FF-A bus is up and running. Failure to find a dev means either FF-A discovery failed (e.g: FF-A no implemented in secure world), or probing failed (e.g: a setup FF-A ABI failed). Cheers, Abdellatif