Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4342742ybz; Tue, 28 Apr 2020 09:40:48 -0700 (PDT) X-Google-Smtp-Source: APiQypKILgVOjBdQKEcm0t4diigRmGhPylOfxD0ba/b3vUxmr06bpxRiikJ5vP+34KdKUAsfn6qR X-Received: by 2002:aa7:df92:: with SMTP id b18mr23300328edy.238.1588092048072; Tue, 28 Apr 2020 09:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588092048; cv=none; d=google.com; s=arc-20160816; b=YHO6Y54PJnm0us//dlC0bgRBOgbY78eWOpwnl1L/PzCcPMvDlW3/8avzQOon7Sq04R IuOLjZRnPibG5ghV58ColXzOoCxsv+TVLnGt0zWJu692G7H72yn/6z3UtBMtC+DhRuDj 5nIiHGm4sXkhFcjIGl2QJuOJKJV6LRJrX98MKr+Bvq/AHb4XKkWbeCNrIeVi1szCOASk Q1zc3068zk/LX19dD1SKPjyBIth50Nx7g0rVoH0FRfniSZg+X6zMTRYkRYIVThVpK17e 2cAmNaw2aAkf38QXYFpc5VqAv15jZu8751wus1j4IvOX7+kdgeMjCnuCi2vNwrQIV1AM Xs2Q== 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=ho062TRS0YdQ6wUnxTpdhRHNh/WM5Lgej+B4b4n+1WU=; b=US3IKJMZQcJ+SO0dGutIKe9I7Dxvx7/cDFU0B/xkObaedhnqQwBPBm1tcWL76rWPMW l6xrIE0N2y/Y/XGB+tCvLBCDmGs0BeJWE7j43/N+HWJbIVOA8vMDxamXTxKw7CtOO7Ce WXbtmFNahugnc3HFHk8zit1vPFhEJjs2aWqXqZ/cr6DxeYQ6XfozWAiqbJfcG0VHo+Xf G/X7Zf9Xo1DAqI5Wrckfw/ZMptzFbQraivhs6+3JpxC+WEq9InXvFENc30sY2RVFrI8K KMfYvimb2t4tGnfWxtbfXKTXeeGJCtipsADFSjZ4Xzeu68X1QZ3zt0b6efHFFKiZDZa0 1wmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Y4JojaNB; 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 sd18si2207730ejb.534.2020.04.28.09.40.24; Tue, 28 Apr 2020 09:40:48 -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=Y4JojaNB; 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 S1728291AbgD1Qiy (ORCPT + 99 others); Tue, 28 Apr 2020 12:38:54 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:47834 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728037AbgD1Qix (ORCPT ); Tue, 28 Apr 2020 12:38:53 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03SGcWQr007658; Tue, 28 Apr 2020 18:38:44 +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=ho062TRS0YdQ6wUnxTpdhRHNh/WM5Lgej+B4b4n+1WU=; b=Y4JojaNBtGP9CoyX+sKdfiEZeYVNiE9SsaFXBE4sApdQ179oDInnlsJfgIXrRuYmOkuq PpLyX1racB7DlJrMZ55V4evElOtb9DjKjwj99Jed3EPuNJWxWiHxZbAJ7GTfqWSfkuGX sAYKpOfqtCJxYrSz91Oj+jGyv9o7sy5UgYrIzibaiKunR9TMB4tm+n7IRTya7TEs0l4f TX6ZD9mrw+Pb2l7/zuoM/NhG9PJkf6yobA7mUMfoq2vA5KBItp+OZibVbQv/WZw9GfSA bG9+FPzeHXZNj/6XWPERS5fqs4VuRFeHQ1QQ5T7ZwRODPgJDfME3ZMF+X/fcPjAFYSTQ LQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30mhjws5jb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 18:38:44 +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 A9B9310002A; Tue, 28 Apr 2020 18:38:43 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 95B912B5F4B; Tue, 28 Apr 2020 18:38:43 +0200 (CEST) Received: from lmecxl0889.tpe.st.com (10.75.127.44) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 28 Apr 2020 18:38:42 +0200 Subject: Re: [PATCH v3 03/14] remoteproc: Add new operation and flags for synchronistation To: Mathieu Poirier , , CC: , , , , , References: <20200424200135.28825-1-mathieu.poirier@linaro.org> <20200424200135.28825-4-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Message-ID: <7c5c8d5e-feb7-74ad-a2eb-1ccb8192b0ae@st.com> Date: Tue, 28 Apr 2020 18:38:41 +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-4-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.44] X-ClientProxiedBy: SFHDAG1NODE1.st.com (10.75.127.1) 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_11: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: > Add a new sync_ops to support use cases where the remoteproc > core is synchronising with the remote processor. Exactly when to use > the synchronisation operations is directed by the flags in structure > rproc_sync_flags. > > Signed-off-by: Mathieu Poirier > --- > include/linux/remoteproc.h | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h > index ac4082f12e8b..ceb3b2bba824 100644 > --- a/include/linux/remoteproc.h > +++ b/include/linux/remoteproc.h > @@ -353,6 +353,23 @@ enum rsc_handling_status { > RSC_IGNORED = 1, > }; > > +/** > + * struct rproc_sync_flags - platform specific flags indicating which > + * rproc_ops to use at specific times during > + * the rproc lifecycle. > + * @on_init: true if synchronising with the remote processor at > + * initialisation time > + * @after_stop: true if synchronising with the remote processor after it was > + * stopped from the cmmand line typo command > + * @after_crash: true if synchronising with the remote processor after > + * it has crashed > + */ > +struct rproc_sync_flags { > + bool on_init; > + bool after_stop; > + bool after_crash; > +}; > + how about a bit field instead (just a proposition)? Platform driver would set the sync flag and rproc_set_sync_flag could be a simple mask instead of a switch case. Is it possible to split this patch in a different ways because difficult to understand as rproc_sync_flags seems not used before [PATCH v3 09/14] remoteproc: Deal with synchronisation when crashing Thanks Arnaud > /** > * struct rproc_ops - platform-specific device handlers > * @start: power on the device and boot it > @@ -459,6 +476,9 @@ struct rproc_dump_segment { > * @firmware: name of firmware file to be loaded > * @priv: private data which belongs to the platform-specific rproc module > * @ops: platform-specific start/stop rproc handlers > + * @sync_ops: platform-specific start/stop rproc handlers when > + * synchronising with a remote processor. > + * @sync_flags: Determine the rproc_ops to choose in specific states. > * @dev: virtual device for refcounting and common remoteproc behavior > * @power: refcount of users who need this rproc powered up > * @state: state of the device > @@ -482,6 +502,7 @@ struct rproc_dump_segment { > * @table_sz: size of @cached_table > * @has_iommu: flag to indicate if remote processor is behind an MMU > * @auto_boot: flag to indicate if remote processor should be auto-started > + * @sync_with_rproc: true if currently synchronising with the rproc > * @dump_segments: list of segments in the firmware > * @nb_vdev: number of vdev currently handled by rproc > */ > @@ -492,6 +513,8 @@ struct rproc { > const char *firmware; > void *priv; > struct rproc_ops *ops; > + struct rproc_ops *sync_ops; > + struct rproc_sync_flags sync_flags; > struct device dev; > atomic_t power; > unsigned int state; > @@ -515,6 +538,7 @@ struct rproc { > size_t table_sz; > bool has_iommu; > bool auto_boot; > + bool sync_with_rproc; > struct list_head dump_segments; > int nb_vdev; > u8 elf_class; >