From patchwork Wed Mar 10 21:10:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12129405 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 2C101C433DB for ; Wed, 10 Mar 2021 21:12:47 +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 32C3564FC4 for ; Wed, 10 Mar 2021 21:12:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32C3564FC4 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=iQHgNCjXw2gbKvbggID3LDgVMQeIMTG2TBMC4+Kjkjg=; b=jQWCU61Oe4/8hMi5gIAgD5QiY EPzJmxYfnKMES+hAuv2YBNSHJhRKbjH9XPXPvNbaykKY6xKgsyzL0mLiHeRiU3Pm2V3WS2kEGdQGb L67TBz5DEJfIQPKLq8JhxaCQ+N4tds60oevaoK5EQhj32UVtGViVXg28Xbp83mAQWA3NXSrz1RLdh YBhckgf2fzfgD6zIcIZgBAwErsgbyWBajao7CILkAIUyRWaijg0pS/t3JIaW6sbJSuH+EAJR2P4GK 3aPBuHGQjHP+bzHKm4//F34L09sijOLwkhwcWyM/h9sPt2GvuN4U9H3AA42BTnWuk7pqx8qwL61e5 h+y6qPb9g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lK66b-007jYw-23; Wed, 10 Mar 2021 21:10:57 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lK66A-007jQW-N5 for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 21:10:34 +0000 Received: by mail-pj1-x102e.google.com with SMTP id cl21-20020a17090af695b02900c61ac0f0e9so2172286pjb.1 for ; Wed, 10 Mar 2021 13:10:30 -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=2KkXz7Q+zlIq4fjTeJz23Qytt+RMPnrKFr7q6Kz46gw=; b=uxghajg9JyNe+viMY5CmPx45ytmcbsKjTjHHbDoN/ea5chNBMZkGesEQe2w9XtgjeB CVLg5EuWCvv7rhnSGVI/+Lls4kdjZrn0JlYogFmvZ/ER9GQdvqRzzQyLMiDrO8uI19kF XVbHP9D3FUS+7XMcEEjeRZnrNs64IbV5kd17yqH6tgIyGfCxha6umk5tBaur9NiITS0y f9bN7mpQKzYPMKJK+FaGaXUOFLJ4GsVR3o3rAQj8HDAJfJT8v9BTzUIWXDO2SLtDXazN BqZO+zTp1ZKx7DELLH83J5maAdF4AWcdS2r13jjL9hb9xIIVCAqOTtcxQMgw7cNSthmm yD0g== 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=2KkXz7Q+zlIq4fjTeJz23Qytt+RMPnrKFr7q6Kz46gw=; b=relowfaFm/2+Qu5wxse5WLXKuVgjP9TKjwk9hRBvhoFIjJy+Akl+oe+0n8JSSIbxsN /oiTMJRmYkmOGQwKnbnjAU02V2ofeibuRZsygPFU9CTKgFmZQ58NoKoFur6gEkkuP5Qg AvYCdXOgPP/f17Zi4VYhKIHK+7YrR0PDuJPWZ7/wjFDiRuSSQF0TK8LCINTuTwWfExku 12fYzfTsLKCj+emki8/G4zOzy2sVVwdqmtnFrpTYyKOjosLo/rIN1euGU/M/fyrikDqA XZuDN0yB8i8XjUygvKhB4No5oUHDB+UNsx1DhjCtNRbX0ByQIH/Oydg9bGtRR5e0aEG/ YzZw== X-Gm-Message-State: AOAM530CVQfLE+JzqrfGa4ISWJVzn4CrYCLswA3W1gP62c7N7CaikFaF 7M+sOyl38f6owGylHQucBUOxbw== X-Google-Smtp-Source: ABdhPJxpVSK/wCZdFiwxSc/jYo2GQZobozCzcsdExTvaG0N3ILT5bOh2mT/poVuSdphe5WV4A2rORA== X-Received: by 2002:a17:90a:8c84:: with SMTP id b4mr5333915pjo.21.1615410629004; Wed, 10 Mar 2021 13:10:29 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id j21sm371508pfc.114.2021.03.10.13.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 13:10:28 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org 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 v7 01/17] remoteproc: Remove useless check in rproc_del() Date: Wed, 10 Mar 2021 14:10:09 -0700 Message-Id: <20210310211025.1084636-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210310211025.1084636-1-mathieu.poirier@linaro.org> References: <20210310211025.1084636-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-20210310_211030_929171_5D6A75DA X-CRM114-Status: GOOD ( 13.19 ) 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 Whether started at probe() time or thereafter from the command line, a remote processor needs to be shut down 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 ab150765d124..d2704501b653 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2347,10 +2347,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;