From patchwork Thu Feb 11 23:46:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 381061 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2495622jah; Thu, 11 Feb 2021 15:49:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJynz8B2cHNWdT86IwOVgfT1i4R9R0ctTXDY+dd0jHEfo2dl7cX3a4DT5/CQgwtiK19N1m1T X-Received: by 2002:a17:906:b50:: with SMTP id v16mr191536ejg.298.1613087371658; Thu, 11 Feb 2021 15:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087371; cv=none; d=google.com; s=arc-20160816; b=nbAoTQG0QMoeT3lRK99Y7YHKH40C6FbxclVekWCZdtbPCI3HPiSIYhz2V+5pCWzaZQ KBKxWyQgwFygNJ13unoisu0EUseYk5QeN6s0tQtMO42t8AHncMZuo8dQPXCsfslLxMM5 z7+9kwO1p4SlFYWo1Yv25TZgQTJfKR1dQUlrI8USQUkVi6nyC0H9DD6rweOualrB8gK7 CZfNaPtIRa+GNq1LzbF/DSBPfCI5vM2sJoPJ/x0hvawV7PGHTVheYtpygjnjNM6F33xG jk5MJ6/B4W1r1A44IfZSmpSRNQ+2FaTqAJckGMEf8PCBP8vIAw3sIIYIFx5hGf9/n7OT PXYg== 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=z1IiqWTeE6tRf2mh+685XttPWduKSnwyiLJ1bBqoM5G2JocxPShYSReYeF061Dfq6H VzEkMV3hQFny5IsFAs+n2dIJp1O7BsI8ntWuWuICrFPB7NFIK2ucq9UJ4N2Vxmq6ZBfN PictdjYMTeeWFurawdVcInWRAAzKROBx538NGLhLItocZcVrQkzJJs/MuYTe02I8l1pn jviH+M2x5no30urA3wezCIGPwkqb2J7QwuPlmhBfVMvO73VUYdqodVZeGY5VZnh6RNAz MhfHIDtRUPt1P5Vb0PniKU8he26p4qqb4aHn9Y3pdxhQIkkgNvFwAsbtZhYXcCjJwQzL UGpA== 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ot7si4969638ejb.88.2021.02.11.15.49.31; Thu, 11 Feb 2021 15:49:31 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S230259AbhBKXsm (ORCPT + 6 others); Thu, 11 Feb 2021 18:48:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbhBKXr3 (ORCPT ); Thu, 11 Feb 2021 18:47:29 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65E9C061225 for ; Thu, 11 Feb 2021 15:46:34 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id nm1so4367996pjb.3 for ; Thu, 11 Feb 2021 15:46:34 -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=YsfMpE2IBLdBQgYaSN//x1F5XVLdT2GSdRdY2GBJs3ISN9yefF2vKzReJMFTfq0bW9 PHV6OqnFzrpKl5dcvzfr8hKY87QnT21AXl+Onv8nvZEtSCEhmqLlTUg8Zmbt2Fi6cJ4U TeQQ3nkQ6/e00yThmI02NBhAP2fanCnIRlkHsHpexgS/dF06ojjQ3i55CTwK4xvwaMnl WcQzd2z1TjK9VaSMjN+H0c2beYcQUS5x1grdrsxXP47g+T57Jmmm3JELpTmQD1ZReo+b +N5eUBpdGbPUctVabQWjwuj9JaoLCUC9HrQ3hHSSJwOv3+6cwzidKPkb8NY0K5BiJd4v dVvw== X-Gm-Message-State: AOAM532D8sptj6UQ5hD/38kl9uXfw8RQ0YwK8QLFI/2FdMfKLBS0lDAF XL3e3UEJCZWKxtXXkLmHNXG7KA== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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(-) -- 2.25.1 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;