Message ID | 20230523025933.30494-3-trevor.wu@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1860010vqo; Mon, 22 May 2023 20:08:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4tS8PnS6Nmh5QUb9L6X0R4jjYV+qgehwbnLFNCjPkeNlJU5lgjEpjE75mEwwqD/3FcQ2g1 X-Received: by 2002:a17:902:e9d4:b0:1ac:b0c5:77e5 with SMTP id 20-20020a170902e9d400b001acb0c577e5mr12265252plk.68.1684811292110; Mon, 22 May 2023 20:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684811292; cv=none; d=google.com; s=arc-20160816; b=K9C1OevXKTqx6s35CQmpyl4+YUkqndRo9YY7cafRo8N3r2fJQ2vBJYkUcpE5kyB4E2 5ZqTeC1/5kNzkle2bmoUWckaUTTevQaimXj5kuSTrxjgnV4ayJxuPQArkCBnnIrie9mY r5kzEWMTmlDdAOXnxUmsk2mopRmKhbTO7J3Szkyv4JVt2AMZNn3Qd6t4Iag5qzxGbezs WwWHKC9VFbmDnYXGwRB4Mw6CgrLJDGu8cxDrCIzSq9mwdPURotBjeYOZ8I1noUZqRVn9 +RemQNhD42qoc9KHmOLN/G9GnSVpUWXzG1imZOuxWo/8xk51BulgIisFPkJVc9Rjq7qU xHmA== 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=7HMIGvCD+aOZDLrsQizWYm0Y51qXJCJHHQPRwoRRYCE=; b=UW81ebYPqk17Ca0nhzsyoWkpbuXm/Ncs0eH4q9xe/vgdDqo3wIvvD2p6xTP19pQU4u HCjZmotWs6QL3B7ESs5df8Pf8pI8Ar1qFO3YlG5iTm69rZv81K9MtH3Ee9indlh9q4LX oLyqshRsPp5ALeJ6VszdYlv9rYskh/VKaGE3vUdj7bfNTxXsNjSVhmBYspLnchUQcJzm +RJEhnOMp6pwluXRT2lQHHKENeFJu+d8SYCuc/nQ+yQt3BGjpqovdP8YpkBQcNCkwh6j Ahrhr1Kux8BBllS3vLe92Rxj3U/dcSHzWSKK1JX+Hs/lguCduW7IyNSJhFHCXZhW+wQb PfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=IwvoBkKR; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a170902ea0c00b001aade54f986si1121328plg.249.2023.05.22.20.08.00; Mon, 22 May 2023 20:08:12 -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=IwvoBkKR; 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 S234349AbjEWDA0 (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Mon, 22 May 2023 23:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234956AbjEWC7m (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 22:59:42 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711ECCD for <linux-kernel@vger.kernel.org>; Mon, 22 May 2023 19:59:41 -0700 (PDT) X-UUID: d98338daf91511ed9cb5633481061a41-20230523 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=7HMIGvCD+aOZDLrsQizWYm0Y51qXJCJHHQPRwoRRYCE=; b=IwvoBkKROHuUjH27ma0DRPV0Kaxe+ZAmwCmXdROojFrtoLYH+LjAbf6RTXxALdOBPzfPFGGHEgzijb99igv+nUyX17AakW82i7EnN+AzO8Et0CRvbX35ZYhSW83wplcTChXUz/IuViLVBGCjSXwIS7QIYWVtOXxqQzV4psSR1tc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:3800f729-4111-47a5-90b5-fd0899450448,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:d5b0ae3,CLOUDID:464b083c-de1e-4348-bc35-c96f92f1dcbb,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 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: d98338daf91511ed9cb5633481061a41-20230523 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from <trevor.wu@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1336574284; Tue, 23 May 2023 10:59:35 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 23 May 2023 10:59:34 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 23 May 2023 10:59:34 +0800 From: Trevor Wu <trevor.wu@mediatek.com> To: <pierre-louis.bossart@linux.intel.com>, <peter.ujfalusi@linux.intel.com>, <yung-chuan.liao@linux.intel.com>, <ranjani.sridharan@linux.intel.com>, <kai.vehmanen@linux.intel.com>, <daniel.baluta@nxp.com>, <broonie@kernel.org>, <lgirdwood@gmail.com>, <tiwai@suse.com>, <perex@perex.cz>, <matthias.bgg@gmail.com>, <angelogioacchino.delregno@collabora.com> CC: <trevor.wu@mediatek.com>, <yc.hung@mediatek.com>, <tinghan.shen@mediatek.com>, <sound-open-firmware@alsa-project.org>, <alsa-devel@alsa-project.org>, <linux-mediatek@lists.infradead.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v2 2/2] ASoC: SOF: mediatek: add adsp debug dump Date: Tue, 23 May 2023 10:59:33 +0800 Message-ID: <20230523025933.30494-3-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230523025933.30494-1-trevor.wu@mediatek.com> References: <20230523025933.30494-1-trevor.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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_MSPIKE_H2,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766652685471401872?= X-GMAIL-MSGID: =?utf-8?q?1766652685471401872?= |
Series |
ASoC: SOF: add mt8188 audio support
|
|
Commit Message
Trevor Wu (吳文良)
May 23, 2023, 2:59 a.m. UTC
Add mt8188 and mt8186 .dbg_dump callback to print some information when DSP panic occurs. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Yaochun Hung <yc.hung@mediatek.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> --- sound/soc/sof/mediatek/mt8186/mt8186.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
Comments
On Tue, May 23, 2023 at 10:59:33AM +0800, Trevor Wu wrote: > Add mt8188 and mt8186 .dbg_dump callback to print some information when > DSP panic occurs. This breaks an x86_64 allmodconfig build: /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c: In function ‘mt8186_adsp_dump’: /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:483:56: error: ‘DSP_PDEBUGDATA’ undeclared (first use in this function); did you mean ‘DSP_PDEBUGPC’? 483 | dbg_data = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGDATA); | ^~~~~~~~~~~~~~ | DSP_PDEBUGPC /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:483:56: note: each undeclared identifier is reported only once for each function it appears in /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:484:56: error: ‘DSP_PDEBUGINST’ undeclared (first use in this function); did you mean ‘DSP_PDEBUGPC’? 484 | dbg_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGINST); | ^~~~~~~~~~~~~~ | DSP_PDEBUGPC /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:485:59: error: ‘DSP_PDEBUGLS0STAT’ undeclared (first use in this function) 485 | dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS0STAT); | ^~~~~~~~~~~~~~~~~ /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:486:58: error: ‘DSP_PDEBUGSTATUS’ undeclared (first use in this function); did you mean ‘DSP_PDEBUGPC’? 486 | dbg_status = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGSTATUS); | ^~~~~~~~~~~~~~~~ | DSP_PDEBUGPC /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:487:57: error: ‘DSP_PFAULTINFO’ undeclared (first use in this function) 487 | faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTINFO); | ^~~~~~~~~~~~~~
On Tue, 2023-05-30 at 15:12 +0100, Mark Brown wrote: > On Tue, May 23, 2023 at 10:59:33AM +0800, Trevor Wu wrote: > > Add mt8188 and mt8186 .dbg_dump callback to print some information > > when > > DSP panic occurs. > > This breaks an x86_64 allmodconfig build: > > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c: In > function ‘mt8186_adsp_dump’: > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:483:56: > error: ‘DSP_PDEBUGDATA’ undeclared (first use in this function); did > you mean ‘DSP_PDEBUGPC’? > 483 | dbg_data = snd_sof_dsp_read(sdev, DSP_REG_BAR, > DSP_PDEBUGDATA); > | ^~~~~~ > ~~~~~~~~ > | DSP_PD > EBUGPC > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:483:56: > note: each undeclared identifier is reported only once for each > function it appears in > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:484:56: > error: ‘DSP_PDEBUGINST’ undeclared (first use in this function); did > you mean ‘DSP_PDEBUGPC’? > 484 | dbg_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, > DSP_PDEBUGINST); > | ^~~~~~ > ~~~~~~~~ > | DSP_PD > EBUGPC > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:485:59: > error: ‘DSP_PDEBUGLS0STAT’ undeclared (first use in this function) > 485 | dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, > DSP_PDEBUGLS0STAT); > | ^~~ > ~~~~~~~~~~~~~~ > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:486:58: > error: ‘DSP_PDEBUGSTATUS’ undeclared (first use in this function); > did you mean ‘DSP_PDEBUGPC’? > 486 | dbg_status = snd_sof_dsp_read(sdev, DSP_REG_BAR, > DSP_PDEBUGSTATUS); > | ^~~~ > ~~~~~~~~~~~~ > | DSP_ > PDEBUGPC > /build/stage/linux/sound/soc/sof/mediatek/mt8186/mt8186.c:487:57: > error: ‘DSP_PFAULTINFO’ undeclared (first use in this function) > 487 | faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, > DSP_PFAULTINFO); > | ^~~~~ > ~~~~~~~~~ Sorry, I didn't notice that I missed the header which possibly caused by the wrong format-patch command. I checked the same patch in v1, and the header was included in the series. I will send v3 to resolve the problem. Thanks, Trevor
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index cc91c2928fb6..3e0ea0e109e2 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -24,6 +24,7 @@ #include "../../sof-of-dev.h" #include "../../sof-audio.h" #include "../adsp_helper.h" +#include "../mtk-adsp-common.h" #include "mt8186.h" #include "mt8186-clk.h" @@ -473,6 +474,26 @@ static snd_pcm_uframes_t mt8186_pcm_pointer(struct snd_sof_dev *sdev, return pos; } +static void mt8186_adsp_dump(struct snd_sof_dev *sdev, u32 flags) +{ + u32 dbg_pc, dbg_data, dbg_inst, dbg_ls0stat, dbg_status, faultinfo; + + /* dump debug registers */ + dbg_pc = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGPC); + dbg_data = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGDATA); + dbg_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGINST); + dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS0STAT); + dbg_status = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGSTATUS); + faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTINFO); + + dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, dbg_inst %#x,", + dbg_pc, dbg_data, dbg_inst); + dev_info(sdev->dev, "ls0stat %#x, status %#x, faultinfo %#x", + dbg_ls0stat, dbg_status, faultinfo); + + mtk_adsp_dump(sdev, flags); +} + static struct snd_soc_dai_driver mt8186_dai[] = { { .name = "SOF_DL1", @@ -555,6 +576,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = { .num_drv = ARRAY_SIZE(mt8186_dai), /* Debug information */ + .dbg_dump = mt8186_adsp_dump, .debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem, /* PM */