From patchwork Tue Feb 23 23:35:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12101059 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=-16.8 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 C25D1C43381 for ; Tue, 23 Feb 2021 23:36:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 71D2264F25 for ; Tue, 23 Feb 2021 23:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71D2264F25 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject: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=QySy6qBEpA46l/lSEyn5P7fSY V6OclB1nKLUGlXGyiPlvFH0HnzobfjpPuoTtsjMwFXxCNJlhscOkYqJAR0nomwgufpfDby+duTfl0 tKphO7FmO4pp+/LPlZBqEWRjkta608v8pGJORKxtFq9L0GvmsmOvrKuLDechjH8k0P/ntbLGNvQ8S SGVPHw07rUbgHC/tqos9kUPLZUROLk6JZkAk2av2FB3ulb9iJqEcGEwZzQZAd9DaRI3LS49bBVqpi hRafqLEfAkkumDg0ws3mZDrlVgFc2EUQqrKxDi1q3+GtTfqLCzjMgl29gx5sbLWlr53+Wv3xuKWEd f4gT6t2DA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhDM-0003X8-EX; Tue, 23 Feb 2021 23:35:36 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhD7-0003Rl-SO for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 23:35:23 +0000 Received: by mail-pj1-x102e.google.com with SMTP id s23so50784pji.1 for ; Tue, 23 Feb 2021 15:35:19 -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=hProZpbwagUKv41hMCoRYJoV707MPNsVHGbwRazl7gPd5Tg/B9uHQ5hVyKA5KNE15I M3Fo+N8IXuAOe+XOLOL8Y051pYgrTeeF4uopk5uWKvexlUIccnUn+H61i+BxCib2/rn7 ZnUf+E9URF0rq1HwBa8zuT2Xl/n1FSj5b2wj0Z45e/EuOjqy7LwH7Vj/M3+s9+vJA4kH zYEzVwBbtd7uhNzVnLzSTrRqaH6EUHlGhOy/fhMsu77VzRG18xeolObBm9Ycbq6D/2ox nTYlkUytljkGVkyjbFeE4h4QA7Dz+x9K9PvSCPZHkqsYO7rNA72bmeIlmFHHSPoOREVK +wLw== X-Gm-Message-State: AOAM533KKYGrWK06ahMxM1DGz5oc4QW3l7/xtgNm0o6uUw6f7O36lo2W EZXS/T8j15bL98SWGSCgx86Ozg== X-Google-Smtp-Source: ABdhPJzME6ROr47/MgtNT8Vns+S4eE+gd/rS7UXIX0eua10m+gAhj0BDo1+R5PHgYg8wdAG3+u1+bA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_183521_949826_1F1311EE X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, alexandre.torgue@st.com, mcoquelin.stm32@gmail.com, linux-kernel@vger.kernel.org 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;