Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp33756pxb; Tue, 23 Feb 2021 17:09:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCkmpcs1Zqhdjsc4f+/yFEpUHhZ6Ay+qTfazo8m4J3AenxToeSlXlaxwwNce8esY3IceOR X-Received: by 2002:a50:cd8c:: with SMTP id p12mr31165050edi.114.1614128978443; Tue, 23 Feb 2021 17:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614128978; cv=none; d=google.com; s=arc-20160816; b=K8HFmiA9/wmfukzroVv88i5IDcAPG+A8SGjurokp53v8mZGf7KvQKjmXB6HUmjaC85 wwotBjBib6g/mvHi5OBW+0P3+LxW9EB8wK+T/G4mlm3wcBIwjSB0sx8shU8hLjwnJ+uC U9nGQZB69YgpW9PeOdZOkpZ7pw4JdwuCK+c5R/gEdCEZr13CvKHjxGBFF+o7zHZ60QMB +2tNYBL3wx2TE7imtfOFHBSGq9S2Lt3qnzwm/tbC1xXwOgftEn2u/tbtOmjsv+9GFaHd d4dRKTOOP1oiiIDoWT71/Gyaf0JjvcEdfYk69g07lWpaZdx6LzI8rBSKjrUcZXyRYW+K ekow== 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=70JCEwLX10Z8DU4ByYhqbD5Bs/NYPpdr+UeUH0EROyg=; b=El75dMBJaU5AtBtPAChbhIx9tbjRX7YrBVc3xVfgwA0wyVGbIvkFhvByvneuwcXA/0 HmvRsZKe/J5bWPd+HfMaVkCgYynC3UMMfsSzdwjXOYabqDFwXJ8/GOLt7hbJmE0u6Pv5 41AULmC40MSD/AN+1r4dnPVphDjGJzCS/Sofu3z8wya9XegomuFYF8J7QnWh82EYv64U QsSuzxWEWwH3Pjw4VJrInoHc7FPvKTAlITYqErRMfHmsRXPAZjw3hp/nPh3IUwIn9x2E 4LFxrjoSMQduNaCMnJggBx/AyaCk6KaMFy81l/D0sxlJuppTXaOogSMbGIZgCzVWPZo5 SyAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N88XbmgP; 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 o17si270228ejg.615.2021.02.23.17.09.05; Tue, 23 Feb 2021 17:09:38 -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=N88XbmgP; 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 S232389AbhBXAjk (ORCPT + 99 others); Tue, 23 Feb 2021 19:39:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234012AbhBWXr4 (ORCPT ); Tue, 23 Feb 2021 18:47:56 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B49C0611C1 for ; Tue, 23 Feb 2021 15:35:30 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id g4so245037pgj.0 for ; Tue, 23 Feb 2021 15:35:30 -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=70JCEwLX10Z8DU4ByYhqbD5Bs/NYPpdr+UeUH0EROyg=; b=N88XbmgPFY0tBL+nREjZof5xI3M2ZNmAG8U2gcExz3QoFVbxPON6BETexyL4v5/axT NMvkJeeyOx/gXRHMZKTpGuV2CrN/cYTde9bOUTYNlrOjcwrROSGin9JWiFSbNskLAG2z g+n7hzn5LtTJ7SWRABd+hnyBF3rWONLrJt9/7b0Re0SjI7kMF6ZyzXqUy2yKiZMcQ+uo Mc9wgFqCHhAppyFeuJUW0XqXLG7V0xqTJK/wGe2WhfK1rz0qK/tFwQtV4Ztf2EmJebmD pmDFdOS8mCjz1F3UaEbjiH85CTJSMNxEU/xeioeWcY93f5WYGMqhvmsCWH5t4dnMVGir LBYw== 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=70JCEwLX10Z8DU4ByYhqbD5Bs/NYPpdr+UeUH0EROyg=; b=VtBrOm7x+ewTxp7s7dYTvpz491AWzadZllCgtk7lXRcn1eNR5OOjr3OCXwS4iKizzD o4XSGCIo2/U+njMckyyVbg2KP4z6vPBHIbjm1o1Vn2wNVhfYT1/61PJsqabm+QV4zjIk JLoLL0a08dOKWJW7ey5mo4MMGp1JThNgZmG7XFu9x8Kx6yVRkJQ2SnrxniSg7+KiAVIf ZcSSAbY8SuK8EJpBoxpQf0fe1V3uvwyg3HDY0mIAnJEZOAVSHnOturs4bCJ5dIODJki/ 4HwpzUk0pR5vTlBT4Yr5m7jqE3pcT88DuZKLSOMy4CC/oaHBGoAzxZXG3hqDwB6r8OjS +IOQ== X-Gm-Message-State: AOAM533AQk/wQrYgxVvVw/0kmB7YdME4pHf7/8/EUiU6GjEbcq30dT62 vMrRq3Ezd/v8AOV/fKMpC41xow== X-Received: by 2002:a63:a22:: with SMTP id 34mr23087036pgk.328.1614123329746; Tue, 23 Feb 2021 15:35:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 15:35:29 -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 12/16] remoteproc: Properly deal with a kernel panic when attached Date: Tue, 23 Feb 2021 16:35:11 -0700 Message-Id: <20210223233515.3468677-13-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 The panic handler operation of registered remote processors should also be called when remote processors have been attached to. Signed-off-by: Mathieu Poirier Reviewed-by: Peng Fan Reviewed-by: Arnaud Pouliquen --- drivers/remoteproc/remoteproc_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 3a4692cc5220..0dc518a24104 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2684,7 +2684,11 @@ static int rproc_panic_handler(struct notifier_block *nb, unsigned long event, rcu_read_lock(); list_for_each_entry_rcu(rproc, &rproc_list, node) { - if (!rproc->ops->panic || rproc->state != RPROC_RUNNING) + if (!rproc->ops->panic) + continue; + + if (rproc->state != RPROC_RUNNING && + rproc->state != RPROC_ATTACHED) continue; d = rproc->ops->panic(rproc); -- 2.25.1