Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1391450pxf; Fri, 12 Mar 2021 08:28:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6BbjS3tt+lOc/Ye+PzS02ptv7f4E9Smw8epV8H8goQmnirlM63awr1J5tTqMiJ1p/cc+l X-Received: by 2002:a50:e882:: with SMTP id f2mr15204893edn.184.1615566513211; Fri, 12 Mar 2021 08:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615566513; cv=none; d=google.com; s=arc-20160816; b=gg2ldSePAuUfgLYBnhAV9ffksW8fy5l3wetxyNS0b++oE1Ac+Up1A06i2+n3ohlhYn FCsuX1IKlgIfokK7olvivIhM9iGHth/tk03Qd3Tl3epIn/LPZEENU4tqvszCf/C1wMG1 +RCjF4VbNSiYM/BCE2lBiKd2LdrLGX0BlK9bWUbp4vKpgs8dg2wQnAIRZBB3MXgZEpHh quyjl7dMbyXydhGk9O0fj7BPjugYzVvTGawBsbZ89N/GAtk+BNrorSjWVLOOgWYCWAL6 AMlnNZfa2mJ43z5spe0xUQ0Q1aWbDYgaFzvaDKG6lN12YUtEOpq7bOWCJItmyfC0xlQ/ /5IA== 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=y4yyaBEGVAJuF1cE5I5KagCnyr0kxeqqDbz8hFkGXj4=; b=onCJTdXSYy5it+Ly8ijbnrFF8xUNWsPRhmaH7Kb2FxQiOo6zxeSc92m9+fBemjFtAk +NskTMKp3gIcKrUVpWryBKblMHylVTh355FF8DU11dP1XOuv6SoQr+QfMVdNdEGZvRrf cHYvPvVY4+wnQkh1LM5sghX2U1sNbln2LAvBpMo9XpIfrpCebmu/zW/YheXuTW+ubhFg ffJweVlNCDGzlKrZ4SfHTJ5RjgLvtBqc2oX0LUYlh+wzMGFDGvkTrpgxoO1/TjI9s71B vB51XPiVgqMW5r7PH52K/7CtjIqUGmhYV45NnbSUDfYNmXpLi3u/jStUYmuiIMFP9bXo g7IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wCNDAmgV; 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 y1si4391574edp.405.2021.03.12.08.28.10; Fri, 12 Mar 2021 08:28:33 -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=wCNDAmgV; 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 S232950AbhCLQZt (ORCPT + 99 others); Fri, 12 Mar 2021 11:25:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbhCLQZL (ORCPT ); Fri, 12 Mar 2021 11:25:11 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D5DC061761 for ; Fri, 12 Mar 2021 08:25:10 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id j6so12148704plx.6 for ; Fri, 12 Mar 2021 08:25:10 -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=y4yyaBEGVAJuF1cE5I5KagCnyr0kxeqqDbz8hFkGXj4=; b=wCNDAmgVCqt2qIVMTG/QwQDP3qUWhxwn+eKFtTYBxSagINdG3dJtOLkpPvgRxGwavE T0E7P3teqFNvCRACI9e+CDt0fDTXOIiduA7xjT0HCzDTz2gZSR9mlIpPbTUxYLIm0bSW vkqy8RFMSVInXsgKXfrzAgaIIXq5Q725TQ5cqpXHnHxao5LxTY4ePygVKyuYSSVTmlE2 R66Llg+Pf9H0/+/glN2URVQ/31SIcc0M9tQ3Y4gWkCMP8AN0qhTNH3qw7EY4NJv73RpS segUMbKSmCxJDuyKydU4mSfBeV4exNmLS7qYtG55gH+nN94d5Fj3nIZ6XPw+fuejh3YY VgUA== 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=y4yyaBEGVAJuF1cE5I5KagCnyr0kxeqqDbz8hFkGXj4=; b=Tq35jMSCckIDrSY3bCNd/S0A0a2kiux/kQTKhJh77sCCpk0TbYA0L7RNepR8x0HMln M8TiRh4f+u9q36APCrYUiAm1YEc80NLIRfJIk9oDiQ+JFxwZEtu2cSPWWEnUHggkkCC9 QLBhSeeHEx4hGqOY3w8c0mh6C1688/lFXLOe6UjqPvJf6kCVR6dcBfuRBYWvQ/GkHjsL hhgp0asL0Gsp3SjIpB24y6HpIdY6cTkVi/2OpnORsLFBCsEwg6is2w9QvWi9TPpgSx9E enhFA5Th7eI5Ey9ZcUSVuOaEkdWxPHMqhK0fELa7XMx662kfnON869kPcGNkR51i3jCB reEQ== X-Gm-Message-State: AOAM530FXbLUjpc9FCS3oGlOKL+r6sHbU+f24OxCptnznSnHftFHof4V 1MlLxfw9uvlcyDax9AWgX+Fq+A== X-Received: by 2002:a17:903:30cd:b029:e4:93b5:3547 with SMTP id s13-20020a17090330cdb02900e493b53547mr13731867plc.53.1615566310435; Fri, 12 Mar 2021 08:25:10 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id e8sm5899599pgb.35.2021.03.12.08.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 08:25:09 -0800 (PST) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com 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 v8 13/17] remoteproc: Properly deal with a kernel panic when attached Date: Fri, 12 Mar 2021 09:24:49 -0700 Message-Id: <20210312162453.1234145-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312162453.1234145-1-mathieu.poirier@linaro.org> References: <20210312162453.1234145-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 37b3b7d494e5..c00f3f8bdfcc 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