From patchwork Fri Mar 12 16:24:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12135241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B991C43381 for ; Fri, 12 Mar 2021 16:28:13 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FB5264FD9 for ; Fri, 12 Mar 2021 16:28:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FB5264FD9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4Ol2dtKPYpAMa6Rfv2rWFhjpKBdqBFZGHp/23479TEw=; b=hYX913hGZ3TgVk6Fwmv+NWXPf YpiPSkRXaDzTmbZCoQQYMnSxm4yS3CKuEMBN5OnDlqJd8It3Z3A60fYeXRxGdr+KEU+08Eq5qg12Z B4hiQK/ouJ5/DSfFKur2seepZ/V5Tcc/1Aif2ANAheC0dNFfWAFR0ys1FT3tQPT2gwsTtKZ7eR9hV F0QLhD7NfbnxXL6ttrcQWs1llw1VWf2UC4XDMXR5jtDpyhQOYRH3UCRU/b/olATRNhgeeXF78YntK UQGI5gOFq/f76nW+kbdIvLIdra5TZO8wRZY+3opLC0oUZhm+QXDHoUhDWEQjRoo5I1QtfIs+SZjsB A19uvwVnQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKkc2-00Bx14-8i; Fri, 12 Mar 2021 16:26:08 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKkay-00Bwb7-5r for linux-arm-kernel@lists.infradead.org; Fri, 12 Mar 2021 16:25:03 +0000 Received: by mail-pg1-x52e.google.com with SMTP id w34so15127541pga.8 for ; Fri, 12 Mar 2021 08:24:59 -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=dKfNn2iJY5E9p7zskcv9vdaz1urizBwgvTKpuJUzcyqpj4MgVPP8I/TnAVrOebY454 Z5NvWmlvMvJM0XH6nL3T4Hx2y75PcNMtSfM3JU6m8w6uTbLnnX2QLEYEN8yFpG+Za8By M20XrRlEtrpK+LuEt6CvpXDeKVG9QRn7talC8t90SM5HiBlDs5vZ8+49KrcM85UVt4z8 3yABuyzHsV3Q5L0rlkHH2DR0x9Om2ISFc7I418CjYQRN3nx8uoXyqtiQboA5/6yqRy/h /D/IuiUnaZ5pWORF2AIMCPh4mZAG5FXz97ppqCFqOr+Ly9R3l5rIXJcY2ydZEX+U2SPb vihw== 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=TjveWnKBz9QrGjUVMwYGUQQ+N4l4qy0ZRNflZ7dcBA8yZopISpyagb+vDBzsLEifjW DmGBHxOGQBWB08NFIPJrwip72LdvfsiAHkoL79vmxd3GoOHl+vCyRN76IQLIbY2mXCvg JPtzRTKKzNgIw30NzqJ0zYjGKi8qacRBH9Qkd0KpJULdKvDE6bxbknSs1XcdG7I0mTNZ zaD9TK4gx7HGLN2pYg/SEI9o4UghJVK8MHYj2iJFOTgva4/lUwyobCWFozHyPNW4x9B0 6BpLbALg/PzJjmLudLwPCi5hDlwSFKVN/xjmJBn/uCTpoTalNIqeOl5242Q3iP6oJsSA RTDQ== X-Gm-Message-State: AOAM532MWloyHITzOymOwI/+K5RrlMiIG6hPAUZpnOiP8xZxfTTVgMJM 9yparhzpEZb8QBZ17laABBDZAA== X-Google-Smtp-Source: ABdhPJwe6MsgvkUtAkvoJC5S6pbE/3NgIMb3TzqdAmrlhzcoXLzkqS1fjpoI580QTCX+eKXoHnZoRw== X-Received: by 2002:a63:5924:: with SMTP id n36mr12926892pgb.183.1615566298659; Fri, 12 Mar 2021 08:24:58 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id e8sm5899599pgb.35.2021.03.12.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:24:58 -0800 (PST) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: arnaud.pouliquen@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 03/17] remoteproc: Add new RPROC_ATTACHED state Date: Fri, 12 Mar 2021 09:24:39 -0700 Message-Id: <20210312162453.1234145-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312162453.1234145-1-mathieu.poirier@linaro.org> References: <20210312162453.1234145-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_162500_494667_D9BC3F54 X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(-) 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, }; /**