Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp695686ybz; Wed, 29 Apr 2020 07:49:37 -0700 (PDT) X-Google-Smtp-Source: APiQypLhd16qUP9GCtZYB+lzLB0EZfJDU1ZldIlBTpC8X5yFgzTqRHU+3AIfR6AYBsDzF68UeAUA X-Received: by 2002:a17:906:e90:: with SMTP id p16mr3011950ejf.14.1588171777255; Wed, 29 Apr 2020 07:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588171777; cv=none; d=google.com; s=arc-20160816; b=zR7lACvm0xhkiFz26AHrs4a97M4KZtcjnH9O1J7eyQBpIulXzY7m+xREFSVFzChmjK 9VWRWfndDefwByOpXXjsUeEv7DoRmaiR3Rn5w4UenX/4ZtvV+IiQuTdTIjbGXICDmS5N K9Xhd/mfKLUvXsmrM/NqSATWmF/xJZdxBJujVGU90l9UZLTZtjlRWQztt0zRA2pHg3o7 uDLwZ77QOVPFiqnSiAM9ffZDx4YNwvPcgyzuxIgYKF83+/sHuRcjY+sDTFWYah+nmH/T Ji+vEWpgo2cxvC2X0HAmhzVnzCx05qblY5PMYyu9SeFJLW3+kzhxaW4R8Yrppc761al1 EF6g== 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=JrIPiTkgDLXSrRQnzVSRty80wJa9TRbjQJelaiwRij0=; b=iozjPlOJ7IlRKAnkQbntW+JvqS0W5vVg7lfQ+34tQYBITuXpAqJJRjlDD0REuUIMar hicvp5THX9IemCkIXvP2RlqLOED32K0aNlPia9zXpPdrf6BcMcCePTlSXcn431U94okk 0uGNpD2DKzJRPvGW5DRLOPAavsd4591qMn+VsQQoHjvx43zJOrf+nvi0yH6rV18OH3AM u6lstaZOsCmLO1X4crGJY4tTTQgrbKQfdBeeJDM4kHCYH+Xbg8kqNQC0650C51X0wngq tQ6ptrfWmLkw7JgElln73/zjuTgGNEQ3Fn8iQ9mGx6aoVqw76QMUsudF/17YAyoa3Lyw bL2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=JwUMktf4; 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 b89si3392418edf.345.2020.04.29.07.49.10; Wed, 29 Apr 2020 07:49:37 -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=JwUMktf4; 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 S1726599AbgD2Orb (ORCPT + 99 others); Wed, 29 Apr 2020 10:47:31 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:57307 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgD2Ora (ORCPT ); Wed, 29 Apr 2020 10:47:30 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03TEkRih027849; Wed, 29 Apr 2020 16:47:22 +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=JrIPiTkgDLXSrRQnzVSRty80wJa9TRbjQJelaiwRij0=; b=JwUMktf48FF2PsljXEuCR2xkw9mjJjeopDNAzqIeJL97nifniD7adyIsogQB3N1ND0no +oynYWeBUAMTnwhqPPRJHeb7OyBwQAhypgu/YsEUYa8w5742NlVpUIwNNL2jhc903xSZ cxwUJraOoL5JZ79h+079PzHbMpgKRqOzfoTzouKt6qKEjXLLAh+AEzZ9KGTCUKoMsKYt vkTj/cvwlUug+xyunlSIeBd1aRd6F1izLa1EuGFixG1iYGLhr0G+FmRLb9F7NrDO/3WT rr7Pg28i1yclIfr3Eu/EIDsnGCAeCtlaRXe5O9tMY5jTJIPdxGPsjLQp6iIxL0Fg56w3 Vg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30mhcc6yhx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 16:47:22 +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 07D5910002A; Wed, 29 Apr 2020 16:47:22 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EAFEE2AAF65; Wed, 29 Apr 2020 16:47:21 +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; Wed, 29 Apr 2020 16:47:20 +0200 Subject: Re: [PATCH v2 12/12] remoteproc: stm32: Set synchronisation state machine if needed To: Mathieu Poirier , , , , CC: , , , , References: <20200424202505.29562-1-mathieu.poirier@linaro.org> <20200424202505.29562-13-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Message-ID: Date: Wed, 29 Apr 2020 16:47:19 +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: <20200424202505.29562-13-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-29_07:2020-04-29,2020-04-29 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:25 PM, Mathieu Poirier wrote: > Set the flags and operations to use if the M4 has been started > by another entity than the remoteproc core. > > Signed-off-by: Mathieu Poirier > --- > drivers/remoteproc/stm32_rproc.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c > index dcae6103e3df..02dad3f51c7a 100644 > --- a/drivers/remoteproc/stm32_rproc.c > +++ b/drivers/remoteproc/stm32_rproc.c > @@ -598,13 +598,20 @@ static struct rproc_ops st_rproc_ops = { > .get_boot_addr = rproc_elf_get_boot_addr, > }; > > -static __maybe_unused struct rproc_ops st_rproc_sync_ops = { > +static struct rproc_ops st_rproc_sync_ops = { > .start = stm32_rproc_sync_start, > .stop = stm32_rproc_stop, > + .kick = stm32_rproc_kick, Seems independent of the path. > .parse_fw = stm32_rproc_sync_parse_fw, > .find_loaded_rsc_table = stm32_rproc_sync_elf_find_loaded_rsc_table, > }; > > +static struct rproc_sync_flags st_sync_flags = { > + .on_init = true, /* sync with MCU when the kernel boots */ > + .after_stop = false, /* don't resync with MCU if stopped from sysfs */ > + .after_crash = false, /* don't resync with MCU after a crash */ > +}; > + could be const > static const struct of_device_id stm32_rproc_match[] = { > { .compatible = "st,stm32mp1-m4" }, > {}, > @@ -803,6 +810,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) > struct stm32_rproc *ddata; > struct device_node *np = dev->of_node; > struct rproc *rproc; > + struct rproc_sync_flags sync_flags = {0}; > unsigned int state; > bool auto_boot = false; > int ret; > @@ -837,11 +845,17 @@ static int stm32_rproc_probe(struct platform_device *pdev) > } > > if (state == M4_STATE_CRUN) { > + auto_boot = true; > + sync_flags = st_sync_flags; seems an useless copy Regards, Arnaud > ret = stm32_rproc_get_loaded_rsc_table(pdev, ddata); > if (ret) > goto free_rproc; > } > > + ret = rproc_set_state_machine(rproc, &st_rproc_sync_ops, sync_flags); > + if (ret) > + goto free_rproc; > + > rproc->auto_boot = auto_boot; > rproc->has_iommu = false; > ddata->workqueue = create_workqueue(dev_name(dev)); >