Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10361601rwp; Thu, 20 Jul 2023 20:20:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFziqjsdLVxyiDZfDnZ6UT9XLxNGxCyjtPCLR5tNu7Br5+FoV/AvYRK3h4iVPxiJPUnsh3Z X-Received: by 2002:a05:620a:258d:b0:765:a984:ac52 with SMTP id x13-20020a05620a258d00b00765a984ac52mr751681qko.9.1689909606732; Thu, 20 Jul 2023 20:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689909606; cv=none; d=google.com; s=arc-20160816; b=pyRPghzLRx4vxxszYLFdupkjmnYZnvdjQCuMPxe7rIRWWml65RKV+dlWaWiYvsakq/ moXvc2hzZGkbFCpc9D5HXqYqO9XxG2lVrPuHtLtBzFmAbmQjpxwQeW8kKM0iwR6JrzoS JtkrwhMawnSoSxZtBT8PWBQyGGO1hhdnwWpjL7tTc0oMKp9kLF2n74CQ8UBWnAmuwrKD BaZswB1F4sXlLO02TiK2p52KvHOd560SCT6BcUu4hzLn/eW3aXuzEFXQPE59KQX0ehng LOgebV5OE+pzu4ChwIx/b1dDOpH5dBINgIW9sr3NRYKPTCnewtRPtbkTAAS56KOepQkP Os9A== 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=i634ZhMfSzfCWgqPzYo892EfK/lf78npMnhCjtYSpK4=; fh=fiUFlTmdXAnPLHH0bIyIc4brKi/t2/OmtpRJQ8s00Ug=; b=cTBfjLC7CSwYDdWQRp2bcjhsA6UIPEKEzWDfun7B9qGdVPn0OwVsptvdVJHsHDrARt mV6Da6sfmCXTdWdkip+M+ttrhgXJkw/647fqNv0cNR3an4YKxbzMgB6Kf7xy3qbvcJPp 2Vaq4Cp8tdBZGVnUNpyKa9zFYInrPKx1G8q7ncYOK5bID/bZWkKdW4PIRIopVcs9OC9G eyrR7uVd/De2QNrLOEPbw7Xu53BIcUVtEp6XkL3pz98EBohl3FbM+KImjBxjTGXV9B6i 0yus5y80n9izEkav9MTzoI/ZSKog2ImV/WsxRX1DGAUHBZJeDPmZUO/Imm4aqv/hKm7a TVPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=G8CsWhZn; 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 i11-20020a17090adc0b00b00250331e6044si2265848pjv.25.2023.07.20.20.19.54; Thu, 20 Jul 2023 20:20:06 -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=G8CsWhZn; 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 S230004AbjGUCm0 (ORCPT + 99 others); Thu, 20 Jul 2023 22:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjGUCmG (ORCPT ); Thu, 20 Jul 2023 22:42:06 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80764272D; Thu, 20 Jul 2023 19:42:02 -0700 (PDT) X-UUID: 265c45ba277011ee9cb5633481061a41-20230721 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=i634ZhMfSzfCWgqPzYo892EfK/lf78npMnhCjtYSpK4=; b=G8CsWhZnhH2DhybhO0Mg0IHuwnkVVyuHUxy5w57lkM00w3VgxrMGNGLDcWrIk4jgPAYdjevu5EmeSGr2XvkeYSxAf4pGCZh2fvs1MXpSAUx1bnnpPSjRrb+O5xpaHE6Hl6OsFbHhwJDYGOQsIF12V8EQdovHKF/NDabA9RcgOao=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.28,REQID:99143d0a-992e-47ec-a7aa-0367688a419c,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.28,REQID:99143d0a-992e-47ec-a7aa-0367688a419c,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:176cd25,CLOUDID:d911de87-44fb-401c-8de7-6a5572f1f5d5,B ulkID:230721104154FISEE1YH,BulkQuantity:0,Recheck:0,SF:19|48|38|29|28|17,T C:nil,Content:0,EDM:-3,IP:nil,URL: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 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_ASC,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_SNR, TF_CID_SPAM_SDM X-UUID: 265c45ba277011ee9cb5633481061a41-20230721 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 811468357; Fri, 21 Jul 2023 10:41:52 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 21 Jul 2023 10:41:51 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 21 Jul 2023 10:41:51 +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 v15 11/13] remoteproc: mediatek: Report watchdog crash to all cores Date: Fri, 21 Jul 2023 10:41:30 +0800 Message-ID: <20230721024132.6548-12-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230721024132.6548-1-tinghan.shen@mediatek.com> References: <20230721024132.6548-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED 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 fcd1dd9b3580..9ed2e18e36ba 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