Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp257357pxa; Wed, 26 Aug 2020 09:46:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVuHBYgyGVDp2du4hWS1ZfR8IAmygBSiNarLpXYnL8CIcXgld2xKIcLCfLz0VX6MW0KEPj X-Received: by 2002:a17:906:5902:: with SMTP id h2mr17459858ejq.423.1598460416352; Wed, 26 Aug 2020 09:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598460416; cv=none; d=google.com; s=arc-20160816; b=IO1r7ZedydULCIElwC83EX5pfszTrfZucEzGnsr+7gthH2q/YNHYuUfiwFO0ajalv3 /Wy0F26mtgCuGqvzRazXwylpdSbiWfOso1e+3PO26+Ary/zewo0oDTQLNNdpKYpxzWUq RD3CK9migODocAgqbw3lVp//AbCi6w/qmDgWUAyHZH5jsbPmyQU8RLcojStdYPgzRjZX SZeMJ+2b0M2CtrN0m6OasXYd7w0xsPKznEBzzhRLi043HCekAOLS8mkYRgJxpu0GfZqu uPOX6coMv4GBuIypavFaDYP47XGNDIgmun5OlcaWO5UDf3xYfFAmmEVtopJ+d5ZNIhdw Yuhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UBjkd/nhJw+5eFsm4c9uEVXQEw9HU2zN9X5gsAn0rmo=; b=tS3MlAWjfP3lWpBEwpbWokdIlApNO3ydZQCHVJgU35uKnQ0Cu9XgNxzM/QvkBvC7sm VsSzvdWT8U/NFplTiYqZaTnw1LfoN53bCQ72pskAmTOiYNrQxFMasYtMfw7Y8uB0cB9R FQoWfl7YVwKJTIJlhWhoEaU8ZozMLIY7rD8nlGVNC20fQfCAtjqKLH7WcM7/Fs76udGD teOh8vq44y7qifVpVHK4XImHfRIR7xp+PurAOTGEbSedvbXLZ136jcngi++rFzniWgYh 5zbkjsK8qRNvN9xSQL4L+6/dNvlnDIz2KyybSACE866CdmWhgryUX/eMvMHzJHLyVYFc daiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qf8ULyJn; 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 gy3si2000912ejb.268.2020.08.26.09.46.33; Wed, 26 Aug 2020 09:46:56 -0700 (PDT) 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=Qf8ULyJn; 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 S1728092AbgHZQp6 (ORCPT + 99 others); Wed, 26 Aug 2020 12:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbgHZQpe (ORCPT ); Wed, 26 Aug 2020 12:45:34 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1883DC061786 for ; Wed, 26 Aug 2020 09:45:34 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id a8so940029plm.2 for ; Wed, 26 Aug 2020 09:45:34 -0700 (PDT) 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=UBjkd/nhJw+5eFsm4c9uEVXQEw9HU2zN9X5gsAn0rmo=; b=Qf8ULyJn2F0iIwf8dA+aVpTzmLX0NtkKs/Jg3rzWujRiqTX/BHskaLds1G56xa3F29 FTRgUuV6keGhWYBXOPLaqAXhI7qkN7cMWY10ZU6ejxCHlUV+8K6bP9PuHM3NEASjyvJE nBDfvDxgy0jcWkglP3DTRGGkN7DLsjFFis7JQ5SRvPY+4w4XSdpm4GzCerzPaturE5KD +H/uDvHagHaN16pGk3gDL/jHhsQJD7wPXm1Xe6oSEnUTNbVWbqE7xIlmRXN+SsOGczdC 3/sjiH0qrIOqBUdxrw2KKAvnUK1YNxOFkaowjK5A78JQuwO5/7meLRB6Qjcnaf23tqFV k+4w== 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=UBjkd/nhJw+5eFsm4c9uEVXQEw9HU2zN9X5gsAn0rmo=; b=d9n4rA7yRWLEhLdGYzHaTqhca6yf+VQC1lxYfqT8IHkWa9m1UrDAQ3zZ9tV6vtVlGA qgloWAede6iE2TurV7KTnzQIO1limIN/P8eLHJbEFAfy3iHD1DFsoWODs0iQnRDgt6Oi A7pZlcTDkeFe5kMkJxH+s/n32QWm5I995u8IglH/EFcSl4fh8DjsOFzp3Xn1m+Nf6PaJ 2nWeI96M3SPE8ZYB3WRos8oa5AGRiR/3bnRn4d9LVrnfvL30kHDIS9JzN8Z2UXaALHft q5TOxlSvqh2f0P/ag+wfGe223KXgbBkhwETSaoAZxjsiHKNojP2ZnRWgnlj8qBjkrH26 V+jw== X-Gm-Message-State: AOAM533RHtDUmsyxRBqR8JRaVqTSX6P4tDRW8BMkxeBcWau+V3/GEZzl oOA0Un3sj8NB7k9+mbhkGIJpsePpMLmjhA== X-Received: by 2002:a17:90a:8904:: with SMTP id u4mr7075859pjn.87.1598460333569; Wed, 26 Aug 2020 09:45:33 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id u3sm2548878pjn.29.2020.08.26.09.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 09:45:33 -0700 (PDT) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/13] remoteproc: Remove useless check in rproc_del() Date: Wed, 26 Aug 2020 10:45:18 -0600 Message-Id: <20200826164529.224476-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200826164529.224476-1-mathieu.poirier@linaro.org> References: <20200826164529.224476-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 --- 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 fb2632cbd2df..7d78c9a9d88f 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2260,10 +2260,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