Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4365126ybz; Tue, 28 Apr 2020 10:03:16 -0700 (PDT) X-Google-Smtp-Source: APiQypL0WChA413lsjT2bULHJGt4pdIe/sqzXgPXD/wKHABg+JHNVbQlBmjB8SRPq0g/S+ZBRWUm X-Received: by 2002:a05:6402:1a46:: with SMTP id bf6mr22959915edb.44.1588093396784; Tue, 28 Apr 2020 10:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588093396; cv=none; d=google.com; s=arc-20160816; b=1DXw01duF1Vku84IgGNp+GB+uoKwwI03D3+P4imnlRpl33WJTKNagz/pi/7IAptXJU bJMlOdi1Av8rVDFb+Li5vWG5Cc+qdzIEaAwhFDYETrkNdki0zHiB5Fp0PTD+zte879J+ Dn6/7yzsmG1uP7mG3MGZ9uvbAbkLwRwxQ1bz7a2GFACl0arjt0czkoWUvhIqAuYZp0L7 LdlBn1CCoaLHVqc4MZXdugZo/q88EU8FD6ZL65AnY/oj7sNp81W/fI+mTFIMxuc4hmH0 mYhzzMqDupLvh+mb6nWu3LKSm9wOJQzzreDsLCEAmaxHg2DWNUbIw01eJySBnHjjUVd1 WPfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=OhXvZ6+5rWO/7/RQgV+XwsAJbQ/rHapO7GNXCSCc8CI=; b=WLAqDRnYQhfHB3wuUcEg/7PVDVhtmVeblDPdhX1eiAlpaeri6kWxCWs27h9aAGjcU6 z8AVeC6pfBJI1AFvGWezfE1kOTZpaZ5js4H5KBC/Z4CHNPVlOG87ug/eH2VLSiKKAAto GHuAfQRP+SL9G4fOW4sLAAjFOt86dQBT1wBT53lkguky9dpvvoJtBH9ynlPdfdnNnnY5 CpBeuqJC/mdfNHvuY7vNz5qypYvC7WxMEPZBeykflnf3R/wqmTsoXYVZpN+thJvHFPPm zPl2RDQlhZuKw7Mt4u0SWZzfILhWQ+dIzX5+9OE40iWbJ2i6HtSfqksfrmgMzzjI0N1C Hpwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sZY2I7SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si2080172eds.152.2020.04.28.10.02.47; Tue, 28 Apr 2020 10:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sZY2I7SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgD1RA5 (ORCPT + 99 others); Tue, 28 Apr 2020 13:00:57 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:11116 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727957AbgD1RA5 (ORCPT ); Tue, 28 Apr 2020 13:00:57 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03SGwWVg026814; Tue, 28 Apr 2020 19:00:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=OhXvZ6+5rWO/7/RQgV+XwsAJbQ/rHapO7GNXCSCc8CI=; b=sZY2I7SFG9WqqfQrKMW/xmRIGWjzeIXDu6g7sKN+S7MLyyibQdyy0DGqDWHHTKuZua/J swqplnQ+2mM92p3l4b4dCToOBTUz6Ug5FcId3FIEHkb316pysy1yC8WHNcIERDlQlhxy IJQWbEThKOpya70I0AHBzUjdVfx/GiTiED6bKT+ar3cMqNHhf2/z3LwVEOv7JL8GudCP IwhjK/B5wBlRWzY4SLnGowr0bYyAQJDLle+QHyU8BP4V6ozHlt1JID4taImMyXd4u5FS aC2cNU+NbFrHZczQUhZ7RFoE11IzQY7QJpultiCB+XovzYF+T510o8SQcMVgTLjTILvy AQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30mhq617j4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 19:00:48 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 34C6C10002A; Tue, 28 Apr 2020 19:00:48 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 21BD52B3BA2; Tue, 28 Apr 2020 19:00:48 +0200 (CEST) Received: from lmecxl0889.tpe.st.com (10.75.127.47) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 28 Apr 2020 19:00:47 +0200 Subject: Re: [PATCH v3 06/14] remoteproc: Refactor function rproc_trigger_auto_boot() To: Mathieu Poirier , , CC: , , , , , References: <20200424200135.28825-1-mathieu.poirier@linaro.org> <20200424200135.28825-7-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Message-ID: <4b20ea71-2787-c063-7ae0-dc44fed5252a@st.com> Date: Tue, 28 Apr 2020 19:00:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200424200135.28825-7-mathieu.poirier@linaro.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG5NODE3.st.com (10.75.127.15) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-28_12:2020-04-28,2020-04-28 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/20 10:01 PM, Mathieu Poirier wrote: > Refactor function rproc_trigger_auto_boot() so that it can deal with > scenarios where the remote processor is already running. As such give > it a new name to better represent the capabilities and add a call to > rproc_boot() if instructed by the platform code to synchronise with the > remote processor rather than boot it from scratch. > > Signed-off-by: Mathieu Poirier > --- > drivers/remoteproc/remoteproc_core.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index e90a21de9de1..9de0e2b7ca2b 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1457,10 +1457,17 @@ static void rproc_auto_boot_callback(const struct firmware *fw, void *context) > release_firmware(fw); > } > > -static int rproc_trigger_auto_boot(struct rproc *rproc) > +static int rproc_trigger_auto_initiate(struct rproc *rproc) > { > int ret; > > + /* > + * If the remote processor is already booted, all we need to do is > + * synchronise it it. No point in dealing with a firmware image. typo: suppress double "it" and double space. > + */ > + if (rproc_needs_syncing(rproc)) > + return rproc_boot(rproc); > + > /* > * We're initiating an asynchronous firmware loading, so we can > * be built-in kernel code, without hanging the boot process. > @@ -1971,9 +1978,12 @@ int rproc_add(struct rproc *rproc) > /* create debugfs entries */ > rproc_create_debug_dir(rproc); > > - /* if rproc is marked always-on, request it to boot */ > + /* > + * If the auto boot flag is set, request to boot the remote > + * processor or synchronise with it. > + */ > if (rproc->auto_boot) { > - ret = rproc_trigger_auto_boot(rproc); > + ret = rproc_trigger_auto_initiate(rproc); > if (ret < 0) > return ret; > } >