From patchwork Thu Nov 26 21:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 333066 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp1634103ilb; Thu, 26 Nov 2020 13:08:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0kWLYmEja5rhRt6XqQXEc41tnuZAe12TZXqs27fMBwF7wu3qoW0MBQQfeC+0SJ0h8LUbP X-Received: by 2002:aa7:da81:: with SMTP id q1mr4357167eds.14.1606424912434; Thu, 26 Nov 2020 13:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606424912; cv=none; d=google.com; s=arc-20160816; b=fcg1X/iuM6/j6SeTfc6GLGDaOjTcbXRQ7Pqnt2NI4YEakBEnKmrTsxQaVvPz6N9xlc 9zwPDhRCaobJo1F+LftmeUEpRvwwlHRhbiEwkUx96/9rxLuBu8a/W0H34xt753IblYjo TUL60WgeL94F/CzWiyzHyVzEaHYPwsCb+LHlG+HdIHL+lM6JiiwPEtoRGo88f9tyddMS RVOrJHqFqP58UcW1jvowYsOEqPYZ2sV8yXWCMNLKIt2A4ihAhGl184G9GZXjXaIkhRtV nAEfIv7w5EF5Xm/jxnqmOMW/0MyJY2oO6V6r55ytIbK/6aov03CxIU8ZF7qaVZ6zhlSJ oRfA== 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=h359vTbVwJlGrgkdHmv3KMar/l3F6onVc2vwd4+bMoM=; b=FohpgdZke+nQRe4mU6R+6NEnvbUNlqvyUKKrDDsHbFGN8rjNCA0B3+8DUO/NLLy1xw tCk5zugqaPz37W1ghCRFnaFK2WeR+rLLHrNUp63BAoK78ePCgs4LsXSL8nNvCtwJcT4j 41RsgpyfF7FP+U1Gn2SQZ/7tYWhPL3EJ8JfJ+V6OvlD9YL9qROuny/EJxpGIprEMMy++ ZtM0moDm2JOeGDmlLMXzIxerlib9yrHElap4zJCPUrRrXWU/oJtXV5wdKn6kMd6T502N 35VCQ0q0FiCp6j0euZlnbmTn52RsDIO1t7VrqKYLqLIH4PskCogG5GaH8Fm5/KG5VJmt +alw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sbYeOUWm; 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 k11si3567033ejg.330.2020.11.26.13.08.32; Thu, 26 Nov 2020 13:08:32 -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=sbYeOUWm; 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 S2391780AbgKZVHT (ORCPT + 6 others); Thu, 26 Nov 2020 16:07:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388414AbgKZVGs (ORCPT ); Thu, 26 Nov 2020 16:06:48 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3687EC0617A7 for ; Thu, 26 Nov 2020 13:06:47 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id l17so2596863pgk.1 for ; Thu, 26 Nov 2020 13:06:47 -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=h359vTbVwJlGrgkdHmv3KMar/l3F6onVc2vwd4+bMoM=; b=sbYeOUWmzzujt1T3Ghu7+LmmnBe3sUsp1le+rTdJX/snuOxA+fsT2eX9h7sYesj/Ga Ut79lCP2xNmRLwkKDupPvx13q/bJFwjdWkeX0WBfwDO2c06litT2gemYS0eu1MNSxVjd cZc4iqYF7KD2Bx+VwKRlVUsaoWVojMmmiu5UAUVbJlfaW6rUIL4Ylv09ej9847yLAelJ XKKtJGlgNN5pm5k37MhiHVI1aLdQc0DWATdSW9BF7ZIvv9VGh+8WlD8dPZ+msbTjf7wU V+m5KtCIW1jBWJiCgk9leRGR0BwYEUh6zVnPsf11l/tKQI7oMvhBrLtN83fvreFpqcaT pZhA== 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=h359vTbVwJlGrgkdHmv3KMar/l3F6onVc2vwd4+bMoM=; b=hteJ2aupVbmKnB/mg1ekUdav/TsFh/+4nb/GWcDTJqut2iuFbE616oR3AtHQTrMW5H 0j5vjTNjv9jmXuEJbg+hMyC16Fq44OmBQ052xv3pQoX9/ShGekgsoasGIhGW6wpVS1mX 3Jk0LYZHA9cW5NWl6w5ob9WYgF+QpWiTc6CnhBhotQX774goTuJCd+V+CBEvjoRlcs5o +/sRq23GFjG53jnDhTyIq0cmbd5BBEu/z627qA4dyVWXxGaK3dd1UbADdY+dn288OYYm Y6h0Ja9r0vVvbv6SQATUWZmYViKs1J44douzdyleBM892P+XzJCh15+WT9LgP0ln5OEl 0qVA== X-Gm-Message-State: AOAM530ub9y4iuSBN5CWc2s3aPcfGt2YCep6qNpYrQLTt4PdSFPrHax5 /iZ623mzVA5HUvxCQZ1MYhHp+w== X-Received: by 2002:a63:5418:: with SMTP id i24mr3841679pgb.165.1606424806763; Thu, 26 Nov 2020 13:06:46 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id c203sm5612676pfc.10.2020.11.26.13.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 13:06:46 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, arnaud.pouliquen@st.com Subject: [PATCH v3 03/15] remoteproc: Remove useless check in rproc_del() Date: Thu, 26 Nov 2020 14:06:30 -0700 Message-Id: <20201126210642.897302-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201126210642.897302-1-mathieu.poirier@linaro.org> References: <20201126210642.897302-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Whether started at probe() time or thereafter from the command line, a remote processor needs to be shutdown before the final cleanup phases can happen. Otherwise the system may be left in an unpredictable state where the remote processor is expecting the remoteproc core to be providing services when in fact it no longer exist. Invariably calling rproc_shutdown() is fine since it will return immediately if the remote processor has already been switched off. Signed-off-by: Mathieu Poirier Reviewed-by: Peng Fan Reviewed-by: Arnaud Pouliquen --- drivers/remoteproc/remoteproc_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index e8b901f34c91..a2b9cd541315 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2346,10 +2346,8 @@ int rproc_del(struct rproc *rproc) if (!rproc) return -EINVAL; - /* if rproc is marked always-on, rproc_add() booted it */ /* TODO: make sure this works with rproc->power > 1 */ - if (rproc->auto_boot) - rproc_shutdown(rproc); + rproc_shutdown(rproc); mutex_lock(&rproc->lock); rproc->state = RPROC_DELETED;