From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 589D0C433E0 for ; Fri, 12 Mar 2021 16:25:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 266EC64F80 for ; Fri, 12 Mar 2021 16:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232506AbhCLQZC (ORCPT ); Fri, 12 Mar 2021 11:25:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbhCLQY5 (ORCPT ); Fri, 12 Mar 2021 11:24:57 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA598C061574 for ; Fri, 12 Mar 2021 08:24:56 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id w34so15127483pga.8 for ; Fri, 12 Mar 2021 08:24:56 -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=goU7+hhY1A+/8UPZ/6wfKNvo1Wd5VQk5jmBUyB4029x3LFD06OY4N/dUHCx+6JCMXN 4Gv604F1GGYcYScSB4t+ihHzgM2x8Ch7DVxgVNjczyeVTttmuU3DBliaoapfQk5O23Kg hiUyz5WqO+6GDpVzqB9HytOAgr9LMdDGgQLfcjzobhPwF9/CjmUhEgtIiKPMMsEH6CLp 2tpDMCtV8g1mZzaQ5Rocm2jwTzFqtBEpB8iKUmpUpHVZo1zXml1JKLnFf+I3Op6D5iHv sRNaLOOxIOXudYl7cgQogN2Pwugrii5UcRF2dH4UnCTzdcZcTQYoKD2wXsIGLdA0udHI IPmg== 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=KqAWZexP1zmvw1UQVKdKKkyvp056sOWm9tN96DT36bwNjSM32INvWTf4+/r83EFt1x tnctGgw+kOKkTKsTXpLsA4KJiE5/vSlf7q7jJx5NBPRyZEcffNJ7NneQCQYzyJpLGwev 6YttQQbk3WyMLpUnm5BYyFXz1Vk+LyIBT83nKZkI0quAQWpgzQpoZG1nLa7Xa98LPrHd o7KHjuZED1Hi8NAwukvTNk1eMoRm9I1ZhakUGLlZLX2Zli1IBzfb9wBzn41WFWgxV3+T PKzYwSZnK9oKyETE/x51R9U4v+BOlZgfkdDYhBfE7kQ4Z8fTBP6mBmU4RGNpD2AuHeDK Icjw== X-Gm-Message-State: AOAM532hlmvtokejS4qcKFTFn+PS58oPg/Oam4VEEu1GAtzptyv9Qwz4 XkFd/bM4fmcZvnphKfTUC5QY+g== X-Google-Smtp-Source: ABdhPJykxgaKFWIUgas1xT2OFrRSUDk0+gKUmLvfAEZ0CH1C6V+Xud5HnYNRHhvdgH1YX++ceZwngA== X-Received: by 2002:a63:ea01:: with SMTP id c1mr4449870pgi.236.1615566296467; Fri, 12 Mar 2021 08:24:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:24:56 -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 01/17] remoteproc: Remove useless check in rproc_del() Date: Fri, 12 Mar 2021 09:24:37 -0700 Message-Id: <20210312162453.1234145-2-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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; -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 4F4DFC433E6 for ; Fri, 12 Mar 2021 16:27:00 +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 B975D64F80 for ; Fri, 12 Mar 2021 16:26:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B975D64F80 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=PXNC80IFyxM8yKNoPPlGwBITA +7rGErzp2TSx41zhnkKhBdRBComaRkmLliBJ/oNg6ow37dFmZSw8WPe6h9g59ywW9whsCPelKYg/V 4V3K8EqGMiokjwDwZNepXPyi39pFhewb7wqBiJge2R2RP5jHRKLXtKTQOa/Ehs1EXqw8LtFCpO3o5 lw/LKBUAJtxHTijrVoCj/ZLcoT+34sQjLYmLiNRqPNaelfMCne+nkbkUrJwo28hOhfgsrVavJo0Dj QykMC0F7WPX/wXRXaXxKmfeobJFejDRUyB1o4X/kB5MsU6TMvAYsoO0coDeAOq7pTN/4Y5XKiLuEd 69i6Idd8w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKkbL-00BwoT-FZ; Fri, 12 Mar 2021 16:25:26 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKkaw-00Bwac-Fi for linux-arm-kernel@lists.infradead.org; Fri, 12 Mar 2021 16:25:01 +0000 Received: by mail-pg1-x534.google.com with SMTP id l2so16200161pgb.1 for ; Fri, 12 Mar 2021 08:24:57 -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=goU7+hhY1A+/8UPZ/6wfKNvo1Wd5VQk5jmBUyB4029x3LFD06OY4N/dUHCx+6JCMXN 4Gv604F1GGYcYScSB4t+ihHzgM2x8Ch7DVxgVNjczyeVTttmuU3DBliaoapfQk5O23Kg hiUyz5WqO+6GDpVzqB9HytOAgr9LMdDGgQLfcjzobhPwF9/CjmUhEgtIiKPMMsEH6CLp 2tpDMCtV8g1mZzaQ5Rocm2jwTzFqtBEpB8iKUmpUpHVZo1zXml1JKLnFf+I3Op6D5iHv sRNaLOOxIOXudYl7cgQogN2Pwugrii5UcRF2dH4UnCTzdcZcTQYoKD2wXsIGLdA0udHI IPmg== 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=grpue1Kl3EimrLgn/SjQ9EI1fjoAq9jvTTIAexaRnDldUftpJ2dnWAeVrL74m5fG+k TAT5xbX7uMCbmALcfpuElQiscvB73kdMCyOFnBUR5+9H/wvCMtSrvyRDelk5p69Or6FM xt+lOx+Gtg3OAhtOzyOpZ0HIVhWouiwXFrsavtJlP920hYDDunSCJ441CdBD8hX6XJzh 6zo1kLzwMSomtexIohAbJCXxRJ4N/OxgvEzULU2C1thIarKOuz/aATf8OMt+FTBQQ0R5 t2SRslYq33r6vxih1I/+7VzsPWGN4nhJQHd9zKlA6CvE1GUYtGxFDKc6qviOqyyasfUx 8Awg== X-Gm-Message-State: AOAM533kFkrbHaVwx5ee8IkngV4d4KDIK+S0csBpd6kl+uDp+bCjwOz4 K098KJFFJ1MuaLEVWMwBI3ekew== X-Google-Smtp-Source: ABdhPJykxgaKFWIUgas1xT2OFrRSUDk0+gKUmLvfAEZ0CH1C6V+Xud5HnYNRHhvdgH1YX++ceZwngA== X-Received: by 2002:a63:ea01:: with SMTP id c1mr4449870pgi.236.1615566296467; Fri, 12 Mar 2021 08:24:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:24:56 -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 01/17] remoteproc: Remove useless check in rproc_del() Date: Fri, 12 Mar 2021 09:24:37 -0700 Message-Id: <20210312162453.1234145-2-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_162459_781245_1960820C X-CRM114-Status: GOOD ( 13.05 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel