Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1941676rdb; Tue, 5 Sep 2023 09:22:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc2a/NpKIPd7uO6Q++ck3rrA1/IVrfSWqeAhAWObNkfNa1ikLN6GqRv2XWdYmkV05ZP7eV X-Received: by 2002:a17:906:31c3:b0:9a1:af6f:e373 with SMTP id f3-20020a17090631c300b009a1af6fe373mr261466ejf.42.1693930966046; Tue, 05 Sep 2023 09:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693930966; cv=none; d=google.com; s=arc-20160816; b=kbtVdKiP/oC63lCX7Bamgjack1TmL3a8lyOywYSnl+KClXnLHr3sUvabeFs5t3InuK iWUV6bOZyql6RHd1/iWMpXKfsvgRafZCLGDjl6tTgtdUkNzOTykJlgYtwnmt4mXP3W6T Gg98C/sev5UqwqqnVbqRzy7Oa5IlieuJeTZcWFLXn9rksmE5w7eSVzr3Vd48PpjyzQrb ccXf4d3UwCLM7tx0OJKmx7Y4pjOUbWxjBy1gURrzQgk5RnBf4jJYAw4viAWyRphmKuZ9 CEZALOOFQIp7VhhGgODR+jO3vsz2gUPj1r3RLGqBI2WmD57VzUAwfGnWXnri47c3vo23 c5uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PyPai8NIgkWNOmARB7iXnlYxYbG0CqFHrErGakUUcmY=; fh=JT/wFpzl+9G/Bu2S1dxFWMIOMo5JIjr0XGytQ8A44vA=; b=mPs7bXjSJtYNuMHS9cIWgXnGDRb6WNu2hRFW6zG2bmHitIKLFSZOb+hy+yRFadBwsf JZHFDIgrssFHYaJojfxIaOaC+szJ8kiE+mDqxQOSm6hY8l3pOHfE6EFSkmFXLbE75DBk tcQ6wqOvmlh4xtVT7smf4LNyLzaYOQm8E5CKQMMbWIMkc+G4RboUveQGliKLxO8X9N+5 OlJASnZZEMVfvYB4lsu3YklUMjilx8NVC4kYH/uVobe9BFY2+GNTjrtXOj7azNHIm+NS 57j8rAqSyjgPDFo0cAHeZUVZqyVKtf0Fr2dTIi8wvDz/ARt/r0RM7mDU8tTeEggcyDVm wFcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="OEQ/g/Qq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a170906961500b0098e31cd141dsi841981ejx.744.2023.09.05.09.22.39; Tue, 05 Sep 2023 09:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="OEQ/g/Qq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238021AbjIAIKL (ORCPT + 9 others); Fri, 1 Sep 2023 04:10:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbjIAIKJ (ORCPT ); Fri, 1 Sep 2023 04:10:09 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30EFE10E5; Fri, 1 Sep 2023 01:09:59 -0700 (PDT) X-UUID: ee611776489e11eea33bb35ae8d461a2-20230901 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=PyPai8NIgkWNOmARB7iXnlYxYbG0CqFHrErGakUUcmY=; b=OEQ/g/QqN9FZK8sTTF0y476Y2ZbbPXnWrO/czqps75ubtb1y9Om+CuBUNXXdR1s7eJzgT/Dr9235Z+A2AwpoxXo9kOu5UeLtsrzzWTW3VQ5k99/6HNQBKkro2CQH7ci3nChbmzI2JV/4bdTfzpyib3B5dcCNVv7x2VHD2vD8AyI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31,REQID:1d7c4c9c-7a9d-454c-97b5-caac8f2e759a,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:0ad78a4,CLOUDID:01f90020-33fd-4aaa-bb43-d3fd68d9d5ae,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: ee611776489e11eea33bb35ae8d461a2-20230901 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1497995999; Fri, 01 Sep 2023 16:09:53 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 1 Sep 2023 16:09:53 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 1 Sep 2023 16:09:53 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v17 12/14] remoteproc: mediatek: Report watchdog crash to all cores Date: Fri, 1 Sep 2023 16:09:33 +0800 Message-ID: <20230901080935.14571-13-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230901080935.14571-1-tinghan.shen@mediatek.com> References: <20230901080935.14571-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To ensure consistent behavior, the watchdog timeout handling of the multi-core SCP should reset the whole SCP sub-system when watchdog timeout. Triggering the rproc recovery flow on all instances will ensure proper recovery of the SCP sub-system. Signed-off-by: Tinghan Shen --- drivers/remoteproc/mtk_scp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 49b2ca2b30b3..37ee5e6286ee 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -68,8 +68,14 @@ EXPORT_SYMBOL_GPL(scp_put); static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host) { + struct mtk_scp_of_cluster *scp_cluster = scp->cluster; + struct mtk_scp *scp_node; + dev_err(scp->dev, "SCP watchdog timeout! 0x%x", scp_to_host); - rproc_report_crash(scp->rproc, RPROC_WATCHDOG); + + /* report watchdog timeout to all cores */ + list_for_each_entry(scp_node, &scp_cluster->mtk_scp_list, elem) + rproc_report_crash(scp_node->rproc, RPROC_WATCHDOG); } static void scp_init_ipi_handler(void *data, unsigned int len, void *priv) -- 2.18.0