Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1307098ybj; Tue, 5 May 2020 17:42:54 -0700 (PDT) X-Google-Smtp-Source: APiQypLUuuPEcRHV6RwY9GvWGGksISuVSx1HTze5kwJbsqX+imn3QkFmX15EJGMhjqy1Lu5Q5/vz X-Received: by 2002:a17:906:8699:: with SMTP id g25mr5183585ejx.365.1588725773920; Tue, 05 May 2020 17:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588725773; cv=none; d=google.com; s=arc-20160816; b=R8e6GuQ3uXGGziWMLx2rTGqKj589KNUlIB1Qclukj+8nd+qUinQDS42iJ2nKQOgaMs Lgz28xaLJWRyegpMSKNwoUh4pcn5zELrxtj9t5pP//hdugemIdh3xRxZbNB3c7O7D46P pnAbbnoxMLI13eYyC7KFdt1roDhoyfcA+X8MqH14pt2AsAElVjViGPYiFXDgCrUiit1g G/Np59+bqG+TLiFQtyCXLOeoYlhT4puVUceTMCoNHM9N1Ca2WbwrXEqYH9ehfAWuX+H5 dHx93yQVJUUM6nLkpZnoVqv0D9SgHMF3TJ/mrZijmg0OtQCtWv8mz/HmBRqbnFGKOlz5 K7WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZvtFEnMi2NJUvYOA1hwzrk2/9S5POTyl8kbWV2Gm77s=; b=LRsLj9Vm6VICqILo2BD2g0Qlf9VxNysCYhK7NrHnWwHVfpOcIuuteRXghX0pmbQi3M jNffNeOo3VQspwIuo6F9VS2EZUx8RI9DXzjqgoBpotfpO9VJ5LumKM6ig3lTTKbPSJo8 7LDF9NtpuaiXwjjLKpMTW0Z4HgSOrTw6/5O3kOeHejDS6z0T7AhfypTkC8qRazxOvlJo WavxCMmPb+Y9tZpj0LWy8bOwQZ7ykLVMBKAFgWfH05Gn3sbv6DDzAnfN0JUER0juA6gR ogV5VJ0f+u2NgOHYwvXTkRChrvHGWYVEVtOU/UWT+bIhTFWjonfrQAYk8nXoKjBXeGi5 A5aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zdz3xM+E; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si187899ejn.336.2020.05.05.17.42.29; Tue, 05 May 2020 17:42:53 -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=@linaro.org header.s=google header.b=Zdz3xM+E; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729346AbgEFAWK (ORCPT + 99 others); Tue, 5 May 2020 20:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728609AbgEFAWJ (ORCPT ); Tue, 5 May 2020 20:22:09 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A743C061A41 for ; Tue, 5 May 2020 17:22:09 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id v2so1554905plp.9 for ; Tue, 05 May 2020 17:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZvtFEnMi2NJUvYOA1hwzrk2/9S5POTyl8kbWV2Gm77s=; b=Zdz3xM+ELRXpwtak30Fv1xijJe4qxJHC2SV4aWG7BDk+yT4JmAW1WWkgyZwupaSQxp 4gY9CuZXwkSbCLt47HLwSHMRm9z6EA/zuvXpth2ltBtV1JcsbdvUNtF4lnxzs21aZxmj qxtNLQurjkXFLAiIuOYlVEYA5Ez13CEKfKk3PSTZKLeE+MPBnAecfB5cGfO5hjxWBNNi yoAZKsMBB+4mBdk3ciERe8OUrLaSU8l+yL1flVMMmkwmbTdKg5ewjuJ0cmfFcZhszfSi oXcZHIvrLeQ9/5acB/GUdxk+cdniuX0BTm+jWKPTWokDGWvz7d2p3veNfdUVMGbtgmwq QaSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZvtFEnMi2NJUvYOA1hwzrk2/9S5POTyl8kbWV2Gm77s=; b=pyOUl7Di9e6UXn7HfqfM08qj6SmHE8uNWmNHCf0IAe+mel9Rh6jBg4RESd61pXNUUY NXvcd0EAcAxXnN+7JUPT9s7C8ikfMzpytqqjDaDMBs+Cpb00SKW4Zu8wUuQvfLTT9o9G ayUnmq8H38Y2PmE6DlQtVYhhEajSNGrSSOd/fw16k/g4jbSOIXrnHy1U7d0ut3aWHFZW y0soumtxWLSoxZY0VA6Mb+9AMgDkW1qwQYGLiELfMOKUZDCsDvV+Hwrb1GWObjjqxG3F 7WZfv6onW/DbqGn0tb59BD5Z/OqF+QNrprMedMSAKhNyVLaGEXqq62grXZmtRlQa4Rr/ j7sA== X-Gm-Message-State: AGi0PuZ4qx9+UeUeWSMUyFPgG6CuvGm0tGBoHpoinjpTPCY7d0hNDR6e YCxGFYeYDBFbyjhcQHknM5YpxA== X-Received: by 2002:a17:90a:f404:: with SMTP id ch4mr6078272pjb.123.1588724528573; Tue, 05 May 2020 17:22:08 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id x18sm21139pfi.22.2020.05.05.17.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 17:22:07 -0700 (PDT) Date: Tue, 5 May 2020 17:22:53 -0700 From: Bjorn Andersson To: Mathieu Poirier Cc: ohad@wizery.com, loic.pallardy@st.com, arnaud.pouliquen@st.com, s-anna@ti.com, linux-remoteproc@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 03/14] remoteproc: Add new operation and flags for synchronistation Message-ID: <20200506002253.GC2329931@builder.lan> References: <20200424200135.28825-1-mathieu.poirier@linaro.org> <20200424200135.28825-4-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200424200135.28825-4-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 24 Apr 13:01 PDT 2020, 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. > I'm sorry, but no matter how many times I read these patches I have to translate "synchronising" to "remote controlled", and given the number of comments clarifying this makes me feel that we could perhaps come up with a better name? > 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 > + * @after_crash: true if synchronising with the remote processor after > + * it has crashed > + */ > +struct rproc_sync_flags { > + bool on_init; This indirectly splits the RPROC_OFFLINE state in an "offline" and "already-booted" state. Wouldn't it be clearer to represent this with a new RPROC_ALREADY_BOOTED state? > + bool after_stop; What does it mean when this is true? That Linux can shut the remote core down, but someone else will start it? > + bool after_crash; Similarly what is the expected steps to be taken by the core when this is true? Should rproc_report_crash() simply stop/start the subdevices and upon one of the ops somehow tell the remote controller that it can proceed with the recovery? > +}; > + > /** > * 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; Do we really need two rproc_ops, given that both are coming from the platform driver and the sync_flags will define which one to look at? Can't the platform driver just provide an ops table that works with the flags it passes? Regards, Bjorn > + 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; > -- > 2.20.1 >