Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp613180pxf; Wed, 10 Mar 2021 13:12:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJySc0wKh0glfb089Bp6Am76DMTAFn5j345Dc6hurhRSc2tZyHbRKGe0W1wY96wULACbgZdu X-Received: by 2002:a17:906:3496:: with SMTP id g22mr357942ejb.143.1615410749699; Wed, 10 Mar 2021 13:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615410749; cv=none; d=google.com; s=arc-20160816; b=NGjeLEloHu6ui670v1LxD9xEEOABlbEInUpQeZCM1kuuzbnzo52Y2LPWag1oYLeGem GSzS5bEeXIWS2JuoxiIkOoz0AqEX9DuuFh2acnNxN6HN5gxlTqLDvx8wzlaWhgd3A3oa w351etdbK0VPDAP1lBXbGh8KTdGMqKjSm9FmKlGlJTgkGU2ojACtu8yLU5UIYVsMxx6U YU6EwXI9jUQXFz5w/UKoha1a27mr5k2OXj6/3CjGbWpHvLl7ynQS0Jj5nYLTlfPrSEaQ lak6vUuWBcXARYYpl7aqwHil/FZT4vKcx15cDnx1dM/HsOfn02K4uvNlHv+pQtlkrZEv oXSg== 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=//t8ceQV9F1IbLzcb1N9QjBaVQNk+K1abKjB3CMSp5E=; b=kI93mxg0xmpAN0mMETrvfDsCIXK8FRc3z/4mCAHiLYS0vuPTwKLW3UobRqWJoIZclZ 5V8GOhSYpPv/QhgAj2+Y82UrWyC/zPewXJuR7o81J3foVbe/XqyjQzyqHUyfbWl3pXnP n/dhgIHZtEHbBQALluZThxgsx5IBpXBKdsUf/V+oo2pTYFhTqxVkJS5ntBDZO7qeT2g3 EMD4kE4GdgKL804oHdtmw3IvkIof7CqbR5FIAB3g6NjIZe8vkzZTvjRMjSVNoxkkFtl9 pvtzoBMg33Yu0qJHh+Q/Pa7GjpcNvTKA468V7vWbGCKzmf4H1rrqCb+LiLwjNB+Dd2Zg B3aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rfkm0nJE; 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 c12si385406edv.455.2021.03.10.13.11.59; Wed, 10 Mar 2021 13:12:29 -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=rfkm0nJE; 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 S233470AbhCJVLH (ORCPT + 99 others); Wed, 10 Mar 2021 16:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbhCJVKq (ORCPT ); Wed, 10 Mar 2021 16:10:46 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5784C061765 for ; Wed, 10 Mar 2021 13:10:46 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id x7-20020a17090a2b07b02900c0ea793940so7942029pjc.2 for ; Wed, 10 Mar 2021 13:10:46 -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=//t8ceQV9F1IbLzcb1N9QjBaVQNk+K1abKjB3CMSp5E=; b=rfkm0nJEZoMdLtilTXPgnGadhHuTtG+vM1fymP6gqGdeCnlKc4F3KB3Uaq/4o3K8Cj ZbaN+Ybje2iSv1GM27/q82Hn5SvEDzItHSyb+kYTu3LNsulPhcXzLF8IbMQU6oNEF/iu MHnF625jXIXo225Nhk2Sxzxb+v7XZFpIAjZkW0mPrhJJmmdtRblLANQC8+1TlbXuB9QQ Gk9OKYl5UgQWNKLC7vouDjdEgoSgeJaWR5hHGu81uIrXlhXaNmaKc9C45M8dT5cnJagu qa0+ylB5RwENeF6kWFLCSSgbJeUTBQK2LKrqLl/gwb1h/Xtpx6f1q0SPjmDGDEY5WV7t H3Mw== 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=//t8ceQV9F1IbLzcb1N9QjBaVQNk+K1abKjB3CMSp5E=; b=OlaDkVgOOESO/Tp97DbDEJDvR/hXobp2FG2ivPw8AvhAZHGhqfVWencbbV7nXUqZPX 8MDYdZZy/lRqnkdQ5kxsgRR7SLYfyCoynvgILKwbkhVl5s5gvO2HevvpaF/T0ZFYmb8L U+xEFVF2i7MbWi0mK11dXnRFbqk0DDrD217zlfOZwu5nwB1LzoqL128SR/0abxtW2DRC ljN7+s+J/GckI+GJrPjZpb9FbpvzTxEaisGiMjOMdVX26I9mEujdJmqdE1/4uwU0CquN W/GVDhOZkUMxxwefaudvFW+bE6GKaUc5gNfWc3tbTWmhwwrHIHWXX3LBMBMoPNwwnGde yzsg== X-Gm-Message-State: AOAM532wX5GAH2yXpgkC0P6ezby9HMJ4Vm22YnjhwfvCdfJk7aJnhal2 3kBxYB+IvfhKWftVhUqsUaiqXA== X-Received: by 2002:a17:90a:86c9:: with SMTP id y9mr5427957pjv.205.1615410646372; Wed, 10 Mar 2021 13:10:46 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id j21sm371508pfc.114.2021.03.10.13.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 13:10:45 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: arnaud.pouliquen@st.com, 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 v7 13/17] remoteproc: Properly deal with a kernel panic when attached Date: Wed, 10 Mar 2021 14:10:21 -0700 Message-Id: <20210310211025.1084636-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210310211025.1084636-1-mathieu.poirier@linaro.org> References: <20210310211025.1084636-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 c488b1aa6119..f6f0813dade5 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2728,7 +2728,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