Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2289157pxu; Fri, 18 Dec 2020 09:36:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaNxoMVywPI2SpOxUjMlSijfPumq6PP/NVVKKET4bmtAC8qI9bAPKzwbAFODWqcxssobCn X-Received: by 2002:a17:906:b7d6:: with SMTP id fy22mr1544700ejb.219.1608312984708; Fri, 18 Dec 2020 09:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608312984; cv=none; d=google.com; s=arc-20160816; b=jT+x5Oze4Vb5jcSvrO81ABR2Nr8CoV/q0X8gcxzoCRc3Kg+dxQE6Z78NYomdxJcia9 CeFiJpxxn7O68LdyM5wxart+Nq/nJeQ/dtEISf/2SMDrD2Vwq5h6IilAggkxV/eeWmAa 2se0gCZi6AQtRqCrcQrsBB63RwiCTExceKS53ThfbZdULcl5yrPxiYbTgBmvPvNuM8fC W32A0qMbqTnxpKoXx0++J9c5HVqyZz85CDVI9yJ0xLPJgEpZOhiMMXZ8jqhNuRhlywrW D2zlW1nhs0Np+WcNNNdAdHV8chMQalLI8DFERte4yNM0ZvRO6OByal/0zYMj6NhOI6cs OuLw== 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=S1HgCKBSeYWceu/5Tsos67As2E/8FgrkAm9u2K2eWO4=; b=OIR8UZpu2IKPH9SNG2tM2G6mr6pehVgTyLRrYcmNs+iSs9A+M1O9fdm5zVzNr+D7Qy vxb28VytoF8ioqqJfe8iNRMT2NTgLG1AAWxxXb6kSqYXqJav28xcDzb7mo/IoTGQ9kVm BsylY0jfgR8/XxFHoVuQarLGZrpisHIAT5rIx6QfrEZqji1Cn0vVvHVCL7QZadKqQKST eWyT6Y8vBNIDi4M2cEWh68i+SuTbTqowmm5CaTr7uQ0p+cmIXYTlspQ4GBYtH0Tk9fBc e66QMbItElXZqDYW0IkAdTLWFl/k5tq15kGsoFIi+AWsoR17EUnrrSU6ge8sW7lcaONR uzFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K3x5/W+4"; 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 z102si6522557ede.307.2020.12.18.09.36.01; Fri, 18 Dec 2020 09:36:24 -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="K3x5/W+4"; 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 S1732920AbgLRRee (ORCPT + 99 others); Fri, 18 Dec 2020 12:34:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732901AbgLRRec (ORCPT ); Fri, 18 Dec 2020 12:34:32 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 282DDC0619DE for ; Fri, 18 Dec 2020 09:32:41 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id w5so1761064pgj.3 for ; Fri, 18 Dec 2020 09:32:41 -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=S1HgCKBSeYWceu/5Tsos67As2E/8FgrkAm9u2K2eWO4=; b=K3x5/W+4ULJWJq8l1Xd1CrmV5GLr2egnactNfaaxBBudoYDP98hWuY9AKWADXn3sNo rg8GirM0BO7YfJ6Xx/jTtMdlMnhoP1HC1SMcRAlMtni21IomvYF98rQ9V5uYtB7P8fuw jK05p4Xz1+HGRGpohfJXxFPnqPXtoFsL2qlnqbf/diJ+x+XukYL95mfJNYxypHI2uybz VB0lkh1qPoU3TrgQXk8THBwebaCScTknt+tyZqOAar1y0PXPA9m+rb7hhm4ieF7vVO1W FOoHkIvQup28bX6TAzsW4LKjS/884fW9yO5LVDXkBrbfvRDWrspz/gugSNIaOkDb40I9 vdKg== 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=S1HgCKBSeYWceu/5Tsos67As2E/8FgrkAm9u2K2eWO4=; b=U5boeAFwByWdKODHsIKKDO6bu86oS8VyxfWCHVpGCubsnMb9u6fKyDaITlRfj/piju qKXr+O2qbAzSvr7XGmm6FiDh13GYuYTebo+Hr/dl5JTdq4IB5IKMVITYat2p7YV5acPB PXzlyqYXm80WTnlbXCMOXtH+EqNKaMzHzx321DvwfHc4DBSqcIOeYGaqIIpE9Rk0ZzBW 1al7ayhdf57h1REkyBmvBUwsy+qgb/slpbsExpyRof5wRUpEjlMF57ZKEJHB9am5bfpj 2Wxk2Xeg/Q0pM/cGpBRunq2EJesNdvT+yc797ba+MErHuOkWJaog58Uavdo3hKmoN5NL R+0Q== X-Gm-Message-State: AOAM533sRSU0aNTNa+eT34RyA1bd9s87xiwcNYhsRypsgeMgs3dJ51Z+ PxnZHjwp369HlxVSsDCOV++n5Q== X-Received: by 2002:a62:19cc:0:b029:19e:321b:a22e with SMTP id 195-20020a6219cc0000b029019e321ba22emr4824607pfz.73.1608312760748; Fri, 18 Dec 2020 09:32:40 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id l11sm9892957pgt.79.2020.12.18.09.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 09:32:40 -0800 (PST) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, robh+dt@kernel.org Cc: arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 09/17] remoteproc: Properly deal with a kernel panic when attached Date: Fri, 18 Dec 2020 10:32:20 -0700 Message-Id: <20201218173228.2277032-10-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201218173228.2277032-1-mathieu.poirier@linaro.org> References: <20201218173228.2277032-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 19545b7925e2..fc28053c7f89 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2414,7 +2414,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