From patchwork Tue Feb 23 23:35:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12101081 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 136A4C433DB for ; Tue, 23 Feb 2021 23:38:20 +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 CACEC64FBE for ; Tue, 23 Feb 2021 23:38:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CACEC64FBE 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=rLJczm/QVqkZbRSiF9pchuCAJaHfkrHY+28xnZrNg6M=; b=JTAywy/0kZM51bzHmCL63V1XH +I/JlgXUZBgw/aYxbYDRI+0uO6aRa38w4KoluIIYEmzwFVQUzfqH0UKbsi6mSy0B/jXT5b+yfZpLY GfDUz7taMEMAbAMUGAdPlz+4Sk42PJ8K40HMZg5Gm9/uA3ap564Y26/PF415HNpLkrTXrACVmy1q3 rzyVv6VC2sVsoe1h4YI2fFfTVk9/41WUZJpyyK/i1gNZkiMJMFrzOhuptlm3iFO8j40ZJxeuTMtIl D0oRTBOUSpaPqNrFasMo62f+PCY0SPOdOiOq75f8McWvYXXLS4a9+vFNKwJNaQuzNL+5Vi33U8AEa Co5e7k06g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhET-0003v9-Jm; Tue, 23 Feb 2021 23:36:45 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEhDI-0003VT-0G for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 23:35:34 +0000 Received: by mail-pf1-x42f.google.com with SMTP id z5so63042pfe.3 for ; Tue, 23 Feb 2021 15:35:31 -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=szR98LZfjAVOyW6ve/vgeIMyQ2FWEVN+saTNSVrLAWxRbdtb2TYpajfVaAKOik4cuB rrE6nJlJtAbGL8zfvu/844QodQKosyESWgqGA8wnOuKbf7d4jS3meL9pO4bFeYSb9YQ5 568PBFZJvyknEcZAWDAXBfLGUzaRQksWMk0iRMMVIjnjRPgwZfY9Uv2ojQ55xgljcsjf lt3MoBImmysuo4rsWAph8roMnmBGc+54Ez1+DLCXblAtMKloRV4dRcROgmTBN2P1FVjG aa/SjwsiJ7rL9UeadI4ZnT9LxzBsZ2g9O1GvjCUDFFTeRu+wCZMMOL1uVI0+aalxyFwB gKbQ== X-Gm-Message-State: AOAM532hXxEsiIbPZZvRWO11zKZZaEvGSZetL/av/MDVxGc6pDIz/dnn HlucBLZgp08suIuB6ps7vptmJw== X-Google-Smtp-Source: ABdhPJxktytv7llBIEju6a5H8h+Ul5Vrj9GmHcU8b1aSOP67/rAzaK7GrW6MDJiRmAWPqcQkjT+Qlw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_183532_132442_68CC7312 X-CRM114-Status: GOOD ( 13.52 ) 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 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);