Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2551332pxb; Thu, 11 Feb 2021 15:52:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzc226ufu84XtbKg3YU7dswxTZ7M6iBJnbQESRWphvERhAar/eI33aLNu6ZZDvBPo3bmiKN X-Received: by 2002:a17:906:259a:: with SMTP id m26mr153198ejb.399.1613087578040; Thu, 11 Feb 2021 15:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087578; cv=none; d=google.com; s=arc-20160816; b=i3A+WIQUMPFCeMFJUIFJWYrK0wj5LO6ELWYntK4XC9a+Yv4k4/cmcUlvZxs2y85ih6 8O+Bj0mQNCXGSwvqPRff6r2KVUoQeFhy15mAES4oeqnU47BU7qNB/qoDBNt2wfpF9nyU BbxBrBtH1HBADDhuU3uP3i4QgzTw2oMihlibvMU5CR7PIUxVkSwC0knyn5WfB2dhMqUY Pvk8Uki/zFTYdDxRvF7w+8n8TWUtzNK/KNC9jgFrmG3qSg7/kI0gey+rkF9B9w8DWSlR fkP8Cw4/vx3N6uTsIiJuRUs9dHRiTqqBFFxnKwvtnnVVRh9/vcOkdum1cVxaBq4/3LIV g1Jw== 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=yDRxGrQMToW3Vor3njhDmnUs8pFP7mgJszB9Khz+OuE=; b=USe5eyT8lAf5tzGvVAwJhWojXvZxrm1x57DcLuXou83k6afIxWxaGkLDSTPC00EqjU ajnjmQhFjLTZcEE/xIIF/VyKx0czWLU1OT+oYwprNCNGcgzmNGJwaCtRmYdeO/4xTD2T 4hEifF7F6rVRX/08FmxBJfIYcJX2amYmZKS6zFPJceNNsk08UE+7XKF9vBEzv0GA4nmo 2Oz5ZT6SaV5boyFbdPIrwSWKnmFvMuRKEUPpqKoYjf5wL8KB5WlXlW/+c000M2MnYx0i cSWskFYQ0oEPcig9Jz+iE1WR9uZQUv9fcIgLMvUhALB8wIN//yl5on4iS2H0T75Qz0nD C6AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pZyDs0Bt; 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 v7si5570988edj.572.2021.02.11.15.52.35; Thu, 11 Feb 2021 15:52:58 -0800 (PST) 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=pZyDs0Bt; 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 S230238AbhBKXtQ (ORCPT + 99 others); Thu, 11 Feb 2021 18:49:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhBKXra (ORCPT ); Thu, 11 Feb 2021 18:47:30 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BDFEC06178C for ; Thu, 11 Feb 2021 15:46:32 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id b8so4180176plh.12 for ; Thu, 11 Feb 2021 15:46:32 -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=yDRxGrQMToW3Vor3njhDmnUs8pFP7mgJszB9Khz+OuE=; b=pZyDs0BtrY8aWl00bxfY7/rUW4h0wlDAGZF0GeV3Qjiz2SqmaEQrAI4QSlfRj8N+9t PoVI/WLAZ3NDxNM5hkalhv6HF2k3fvD7jDtXfybSOhTpY4bDRLir4Cf1R2adpqvrhGQy 5khsgwhoFSfmPZcXdo7/JDewtBmkZAk1IYQdDFq2cTDIxiiUEkd9nye2qvckKooNB/X2 QJ+5nOWUGzNlS5whigrKloP656FOAc5MvLSt0LX1/X4B2rtoZN04Ktd/b0f5gVc669ws TQHICqjLS0U3PlKZMtwHKwDQIusCVq0qcEa4zKMWQwM1hLfrNnCcIOmKkw+mH/c/EZev jddg== 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=yDRxGrQMToW3Vor3njhDmnUs8pFP7mgJszB9Khz+OuE=; b=LjEuwCRwlVSaYYdgYT5ke33+60w9fFvrIjwCLKmT20jXqKbwWE1aCmNGw7L0y3n+Ik tLVIXD8sC6UF0w7lL5F4u4tv18Zx2yqwbqZZbn25Ejw3+gspO3wpbqFUHaFYPFJ82IPP FcJuqvnzo7/VBpjZSbT9wWDej4xwT+KPi5u/YaGoDzirVQEt1VoOg5YnPSNVAcQvJInf jvsGWBDOToxigXV5f9cpds6MMaFl7c4VS04nOepfkkgsb1UkNPMnLlVbu8pdtey84pH/ SqHyGuiGs0zRSgNlVSYF4TYyLoWH8HRNBvU1vfFU1Slr9R3ugR4ptJacjeoFMqT71fIp tYDw== X-Gm-Message-State: AOAM5325/wMNBcQky806MgaC3ucclk1q7gOxbJzAlByTxEj8cbJiCokS 68LMO6TezUkG8yvA3O9POYE0qQ== X-Received: by 2002:a17:90b:945:: with SMTP id dw5mr186517pjb.34.1613087191843; Thu, 11 Feb 2021 15:46:31 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:46:31 -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 03/19] remoteproc: Remove useless check in rproc_del() Date: Thu, 11 Feb 2021 16:46:11 -0700 Message-Id: <20210211234627.2669674-4-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index f1c097572e01..86bd66955060 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2350,10 +2350,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; -- 2.25.1