Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp700338ybz; Wed, 29 Apr 2020 07:54:30 -0700 (PDT) X-Google-Smtp-Source: APiQypI7Q8uH2iQ1G+RGN5B2SUT5W3fwMdPxKmsei/6QZxnqE8ITQlyJ+XuOO54KDtX/rLYfWbuH X-Received: by 2002:a17:906:37d0:: with SMTP id o16mr2819920ejc.368.1588172070814; Wed, 29 Apr 2020 07:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588172070; cv=none; d=google.com; s=arc-20160816; b=iPtFe6rFPyFd/CyUxQknONIFvNnhIREO+HUb8HQmMI/soztcYZ+TPI57YXUduaisR9 nyxCndKaa7CGpIXWGa2lxbJVJky2D3yZD+A73X7Wu07ibpFjACS94xbLnJZ9DVZBCE3R ZdAl34aFvI2IYd+V8ijvMXRZYUXeR+1llymIhB4v0KKKcCwo4pj75gpVj0BGOTxtjdXR eULXcuzry5OAuO6lWQS727VKKCgLiBpGe+8wtbLD2BvO9CKzXH1IBAwaiPW0fwY6cJH/ t3kTwmXPrl+NpKOcebr2oq5ctK127weglvrtGNLXCrRXg0SzuUVbKMqBlEqUp9Nrusfe Ss0Q== 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=k4HHTwS+8Ljbwqtos9h637MEEsprgCn+OA+4OMP7vFM=; b=VE0a242nUavwwzEbS1sBfWDBs8n8O+zcq4XogXn7zUHzwJCyz0PV3w/piP6lgmLi3J mQC3uNQHy+a/wwnPMr0KfsqdDnK3yBo+2fx0yWOMtHCxJ5FG4Ezk9T5Hu8ZUOhJiOJKg p3Cmme8a1hZEOZziJuJmkIDpO7mtWuwESYr+07kUWaY10Ak5n1Wuqfy2ZTQXqCN2v5kM 3sB7O9tU44VZ5UN1bsGoN5bQBkURwCa8dP7iY6bG1az0Ji8tAzOGpEDSdkwaxy0k/rPV qAG8WXbZY4iiYzCVCzeMmJlKuvoAldxaPDIl1gI/53zoYw5TUgBlVY6aL4x7dW+30GcD qDNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="MOaili/s"; 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 bf23si3404551edb.414.2020.04.29.07.54.05; Wed, 29 Apr 2020 07:54:30 -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="MOaili/s"; 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 S1726828AbgD2Ow2 (ORCPT + 99 others); Wed, 29 Apr 2020 10:52:28 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:42728 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbgD2Ow1 (ORCPT ); Wed, 29 Apr 2020 10:52:27 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03TEqKrF025571; Wed, 29 Apr 2020 16:52:20 +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=k4HHTwS+8Ljbwqtos9h637MEEsprgCn+OA+4OMP7vFM=; b=MOaili/s/VJ0fiUvGwJyitOHHjHTrw54nh0Chwl9+QzytQIlBGkcQzCavUDbaLCgtUqn 552MnWhqHPq9pZdFCBdi3KR5en+UQi8FaFqHh+q6f3mVuK/jhfHMhyg+wncyvR4XIZmd UlLJBdrW11H0bRqWyoLj9xUBGtPNeB0B69AgpyI/4VF6Ku9YfLIClRwpQsQdXttjtPDO di18l2lPdHUe+Qaq83dAJjNIOyAsYDp9keWtKqVXPf9k5TnsOhXRjX0Y87kUHsGle7lt LecV34D//WmmYfrJ+9FEdKajqgQlxd+oe/Oef6+XDTllvg2LzkOXWjxKewKfHzBGFiwZ Dg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30n4j6352n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 16:52:20 +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 6CAE710002A; Wed, 29 Apr 2020 16:52:19 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5AA232AAF70; Wed, 29 Apr 2020 16:52:19 +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:52:18 +0200 Subject: Re: [PATCH v2 09/12] remoteproc: stm32: Update M4 state in stm32_rproc_stop() To: Mathieu Poirier , , , , CC: , , , , References: <20200424202505.29562-1-mathieu.poirier@linaro.org> <20200424202505.29562-10-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Message-ID: Date: Wed, 29 Apr 2020 16:52:17 +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-10-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: SFHDAG7NODE1.st.com (10.75.127.19) 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: > Update the M4 co-processor state in function stm32_rproc_stop() so > that it can be used in synchronisation scenarios. > > Mainly based on the work published by Arnaud Pouliquen [1]. > > [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 > > Signed-off-by: Mathieu Poirier Reviewed-by: Arnaud Pouliquen Thanks, Arnaud > --- > drivers/remoteproc/stm32_rproc.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c > index 404f17a97095..86d23c35d805 100644 > --- a/drivers/remoteproc/stm32_rproc.c > +++ b/drivers/remoteproc/stm32_rproc.c > @@ -493,6 +493,18 @@ static int stm32_rproc_stop(struct rproc *rproc) > } > } > > + /* update coprocessor state to OFF if available */ > + if (ddata->m4_state.map) { > + err = regmap_update_bits(ddata->m4_state.map, > + ddata->m4_state.reg, > + ddata->m4_state.mask, > + M4_STATE_OFF); > + if (err) { > + dev_err(&rproc->dev, "failed to set copro state\n"); > + return err; > + } > + } > + > return 0; > } > > @@ -531,6 +543,7 @@ static struct rproc_ops st_rproc_ops = { > > static __maybe_unused struct rproc_ops st_rproc_sync_ops = { > .start = stm32_rproc_sync_start, > + .stop = stm32_rproc_stop, > }; > > static const struct of_device_id stm32_rproc_match[] = { >