Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp156363pxb; Tue, 23 Feb 2021 21:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJypgL/y6Oj0qporhFifeTQV3CBmXNW27ge6yy0gnGsWbkB5iHsrfzUIFREbHt0npmDH8oQc X-Received: by 2002:a17:906:5d06:: with SMTP id g6mr9011425ejt.548.1614144697373; Tue, 23 Feb 2021 21:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614144697; cv=none; d=google.com; s=arc-20160816; b=Ehx2YnEs0zCTNWDOelHX1CBIh6NsY/cnPCCuXUmFrZcGa1Pl63gXmZ5QxHjerlELnK B+WM0mw0nNhaqPynbnP84K2P3i84T27bcnvkVgGMResfgSLCFsDSBRGHuJKaxVOxrkcd CVXt+KzuPp6nv1W8IWlFuJ9rT4QF2oHLkRTLPSI8RTWry7UlP62AlyRCKf2SknxorORx Uz5ZaBJpft+7o88u+613cm4zhntTzVsCJVdYFEx/0Mzg3rh3/MCkSv/hgOSwxwXUJC5F hjQY038j3qqpypmD9CRSU3345Ktly2nN2DnQSmaeEwF44E88b1saOpfRH9YW50wrrR4i gVoQ== 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=2KkXz7Q+zlIq4fjTeJz23Qytt+RMPnrKFr7q6Kz46gw=; b=Ch07z2kESmYXfmYyUQg06BNsIj2u31UtIh23jPWqKj/ElAqqpxhhsFdDHpquX1m+Q7 pGQSqrxxOBd+BoWs3iTKAotzpqdUmK2aBH2t/mEwGpyMaIRNEf2Jn7eGml9mFCDj6UDq ai5aiEnlhOCVU7WuVyEKFHM+z0ZRLVSVeBTRiMD9KewNVqtY1CBKTbOICzoXgsoOC7yO ksc/OeAIkIl+a9NkUAjVILjTEihZMsS3qcGvlDhkjYBWR+m/KbgfcMiU2wI3tBpPK1Cm bj6Vqn3GpXhudSY+iTRZAjusF7bXte4M4jQfuiRoCEzSYCCfXdtgNFLiDB2ZO5dIwBk3 r3Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VT3vWAAA; 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 g19si664677ejz.742.2021.02.23.21.31.13; Tue, 23 Feb 2021 21:31:37 -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=VT3vWAAA; 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 S233988AbhBWXoR (ORCPT + 99 others); Tue, 23 Feb 2021 18:44:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231843AbhBWXgA (ORCPT ); Tue, 23 Feb 2021 18:36:00 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C916FC06178A for ; Tue, 23 Feb 2021 15:35:18 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id l18so43834pji.3 for ; Tue, 23 Feb 2021 15:35:18 -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=VT3vWAAA1/nWsaEJw5qwCO0P0+fsf/zztlHgIz27KF6UqyOj3/o4QRT+ZnBkifIFFl ijt3TjrVTXgRdMiNE41ZaxRFrnMsB1WHCc9NZ0oXoNjAgETLSILe1CDqHduMyCQXX5WZ tgaIZBHWoNk0/2CmLsXaS8226jUShwMzLeIRL3iOSfMFCKB6x0TvF6Z7psLOoOsMx/q0 kgVnboJxNpRg0aE/NIZPJ54I0lteJH8hVC6XX0i8bTCpXFAIdpXSnUBdOeCEz6gXWehw Kbn/fgeQBcml5A9IzvpUTOWr7CHq21nbbBZIjwoEUME24CAp4lSupkH95NZIMs4Hzetc l2Cg== 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=kyb6tOWIJE85861g1k225VkzJzXkmkGnKP8Ay/3e5/eCztuKJVeGfpPjb8RCK/CfdU d5yimnB87nRBDPSs/hH9ByfQAUpLTvlhA8dvb4Gd4AOieY3nLSv0cp3JSaWg6sxGlN/p XNq2SGkpDgZYSKH8qnilMcU/bM37qy+guhC57Ii5moyuiCiEGIUtGF2qQpzYkf1fFQsk f1cqMuNjfPvQ95Ns90ve4nRNBH0nyW21bfCVNqN8GbBAZGv73aqvD+1ZXXfaR7QlhIzP n1VWVyW/uj4IzM1qZXxais/1zpYxuZ0Yx/fr16OMca/ZO/vtYRQb2JvU7LC9PXaDA+Uk T8/g== X-Gm-Message-State: AOAM5316mW99FO11X075ipAEP+i/vozabKbvuHkRiuU3iluUapD3sYHF AqclPxuJnRd5lWrplnHddtRg2g== X-Received: by 2002:a17:902:c789:b029:e3:dcbd:843b with SMTP id w9-20020a170902c789b02900e3dcbd843bmr4832710pla.61.1614123318320; Tue, 23 Feb 2021 15:35:18 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id c24sm311999pfd.11.2021.02.23.15.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 15:35:17 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, arnaud.pouliquen@st.com Cc: 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 v6 01/16] remoteproc: Remove useless check in rproc_del() Date: Tue, 23 Feb 2021 16:35:00 -0700 Message-Id: <20210223233515.3468677-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210223233515.3468677-1-mathieu.poirier@linaro.org> References: <20210223233515.3468677-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 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