From patchwork Thu Feb 11 23:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 381060 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2495611jah; Thu, 11 Feb 2021 15:49:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmS6rH3tg/EHesux7mDaxgxaSQvHoKFo+gnaE81CrgSYHmIkOMT+WsiLVzvDkr+G844e5r X-Received: by 2002:aa7:c944:: with SMTP id h4mr574536edt.233.1613087370538; Thu, 11 Feb 2021 15:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087370; cv=none; d=google.com; s=arc-20160816; b=ivAMlGB7W82sIZ4uh2w/8Hg4hci7PhKwBX166yXITDwREJSqObXjDTIB1xqpl+qN2w US/Ss722SW3SaWQRT1C6F6jqCDn+4BPol0cub1s2T+yaxnNsaZ+XbMuPlo7OBern/o1j raZFQZGryEp64RD4bEhiHNOqe4xi81Lm0m55NC+MtIaiBcrtolCa2yfCgcQB0k+G+IHC yvBSAJyCj1u2NT81QvOC+SahyK3qRt4L2VlQ1HFJ4lZRRLlRZrQa0ntUH2TqWGlD3dqf P2BJJbBA/mZdTWmx3XkcmWl0+4Xj0rFZ5t3txT1GgoMEdtzZdsvTc5JQw/KPmAd/LwJd dHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=waytkFv28UuOXcaaNeh19CxfKAUzKWp03mnaFrOUKvo=; b=kXfWLPUZwQHyfBSucnBLanvPhMW7HlRw4SPx50SG5zhUqM1RXaFDsxO/vwfpSkT5Ea fRbYlBe6iC6m5KrUoSmtLEYHUpq3VXYN9LAgNAuWV+8y2Lueijn1EtBOMyZ4mCJ59Nf5 zRln+hJ4D/769f/Wa4oQoymhcqDNGBOcrNmV8NS2CIOS+17jdQS+7UZgtcU2TyYgP6JC sIP+NfbNPKCoLodc8/QuGgi4CQIREogfgWh+GrTevU62oV3cB/45mcrD+0xFaIzgLjig FmMSQtGZ+jsDZ4zMzDahq1rPpl+/RalX7xLdrI1lTwvToL967tJmCB7zR68ezmLHl2Kb WiNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KbxKOZQM; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ot7si4969638ejb.88.2021.02.11.15.49.30; Thu, 11 Feb 2021 15:49:30 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=KbxKOZQM; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S230357AbhBKXsm (ORCPT + 6 others); Thu, 11 Feb 2021 18:48:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbhBKXr2 (ORCPT ); Thu, 11 Feb 2021 18:47:28 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED1FC0617AB for ; Thu, 11 Feb 2021 15:46:34 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id k22so4197288pll.6 for ; Thu, 11 Feb 2021 15:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=waytkFv28UuOXcaaNeh19CxfKAUzKWp03mnaFrOUKvo=; b=KbxKOZQMaAycIE18CAf5wu1OBlPfG0cR5mApGKP4RfLjOjDlL2D8/lfvVD2porDZvx 3JE2qjSISKthcDCRBzqSBcMX/6J8CzaGauhuZSTT97bOWs6xYNxRZqwsML2SG1SY1HB3 7lWsIaKBt3xqQxFEMnxZpiHo6O2PYgIW38f3VhXqHdzUndeexhx32Gz7YhZ6qrXh1QTV zocoRY+IWe0I9PqLTuhfLY/7548FvGTFz2TvfBDCMw4LbMtHh3/YyVN4qUBujIYrzvHd 7AtWEaUtPOutyioGfaValaT4vO+t6OEm/FhoUmewhPAA5v5jgh3qHCmM4VlAtwqmarX5 tgEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=waytkFv28UuOXcaaNeh19CxfKAUzKWp03mnaFrOUKvo=; b=NQYmTuHjuu2g522X0ZvhFrMSELBxdL6+tf3bRKdzib+RaS30bUMKj1b6sRoPBZXKrr XBxr7gyXwcFzAn0Pmi3V2m8FRjLxHB9HnkvMBeDUghMYAcmmJ4QG8UR8LmRtakbMkU8T d+OueiInKvpQ+Y1Hs/2gxYE/BZwX+/LCZqRghVtL2coeve4oMkfCGzliYqsElGfH9UB4 TVkJUMg4esOwa7pDDPf/96sqRINaDuhEj6HlZKqY8FagMLnF1+XkyUXeyv4RLLgak1JO MxL6lFyRZbx//B4D6o8F8h9JHh9NueHFLYWRfYKwGjs1ZjUhTX5wOfjgPIOnVTrK/+fT GXkQ== X-Gm-Message-State: AOAM532QuEeGU14vLP14MtuHe8MKv0RxA/8igOkxSoRn11Z6OeEodf8N gHhNGPS9GtTnpa/kryZ3MXk85WEL+alKeQ== X-Received: by 2002:a17:90a:c08d:: with SMTP id o13mr128236pjs.149.1613087193787; Thu, 11 Feb 2021 15:46:33 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id iq6sm5932740pjb.6.2021.02.11.15.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:46:33 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, arnaud.pouliquen@st.com Cc: robh+dt@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 05/19] remoteproc: Add new RPROC_ATTACHED state Date: Thu, 11 Feb 2021 16:46:13 -0700 Message-Id: <20210211234627.2669674-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211234627.2669674-1-mathieu.poirier@linaro.org> References: <20210211234627.2669674-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add a new RPROC_ATTACHED state to take into account scenarios where the remoteproc core needs to attach to a remote processor that is booted by another entity. Signed-off-by: Mathieu Poirier Reviewed-by: Peng Fan Reviewed-by: Arnaud Pouliquen --- drivers/remoteproc/remoteproc_sysfs.c | 1 + include/linux/remoteproc.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c index 1dbef895e65e..4b4aab0d4c4b 100644 --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -172,6 +172,7 @@ static const char * const rproc_state_string[] = { [RPROC_RUNNING] = "running", [RPROC_CRASHED] = "crashed", [RPROC_DELETED] = "deleted", + [RPROC_ATTACHED] = "attached", [RPROC_DETACHED] = "detached", [RPROC_LAST] = "invalid", }; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index f28ee75d1005..b0a57ff73849 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -405,6 +405,8 @@ struct rproc_ops { * @RPROC_RUNNING: device is up and running * @RPROC_CRASHED: device has crashed; need to start recovery * @RPROC_DELETED: device is deleted + * @RPROC_ATTACHED: device has been booted by another entity and the core + * has attached to it * @RPROC_DETACHED: device has been booted by another entity and waiting * for the core to attach to it * @RPROC_LAST: just keep this one at the end @@ -421,8 +423,9 @@ enum rproc_state { RPROC_RUNNING = 2, RPROC_CRASHED = 3, RPROC_DELETED = 4, - RPROC_DETACHED = 5, - RPROC_LAST = 6, + RPROC_ATTACHED = 5, + RPROC_DETACHED = 6, + RPROC_LAST = 7, }; /**