Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp923233pxb; Fri, 22 Apr 2022 14:25:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywndW47I6C6plOyCPfNDsLb0X0F4YnRJeHWUN7eJ2VAcVO6hcmohnMjnSoBJCK6PvlmHsu X-Received: by 2002:a17:902:dac5:b0:15a:fc5c:10ce with SMTP id q5-20020a170902dac500b0015afc5c10cemr6430054plx.41.1650662708832; Fri, 22 Apr 2022 14:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650662708; cv=none; d=google.com; s=arc-20160816; b=UEU8YjdIx5np+DYJHE9C+KsC5YEt67+jGaZhmutfMkAFQitXzdEDj4qO0w6+Cn6UIb DtcFPoOAZ6QgZB0sE0Nmz3Alutf1/W78SEX4fZCX6G0hgxuCDKCnPsDM12TVgSjW6Nhp REsyF2IWHJ+u6XQW+7yrZ7nPYs7Mi4fth2NrlRVUhrwAnAV7PixOXAlPYkZk++7ovWUR BFxRHgFYmY42szUvFYtrc+VGtq96d4v0lKr817/QSLuE1CVXxgUTlbekhUNqL98sQNkE VDjAmtGHLe6UU6kNkjZqpnAzpJhnd0DL6laddLtfAXV5zAttf1Px0WWbbI/UBcwK8woG u8CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s5ggRjzOw7Gt81v8sXilrQHuEib8glDkjAkkxUqaE64=; b=Nd4HQ/5wk5puJCo4JUfUB+SLV/Hb301ChRpBIxNXvwl9DNkzzCa2vWgyy+YDMCFHEi Z8NK32s/bzXepWU0ls2/ImbKpzhRIE1T/oPJ8jD55uM09rPObJQi6ggmrJTuwY0LAXBb EvF7SV3pw7+BXPMSExBUlWb10nUYzHuTK4nONLqTab3tKu0wEEeDhBjKOwThE2wfuDiK hcUWPzWAG+zR4NqT5QrzyJhSxNzGVyRJP02SuAz3yDBSQPjfPQ5uZytnf+Y0UrbD9K/X AlASaxeQmB3QnsBpqqyilrkAgEmX+uqLwSi6o9LLmLfDW2nRUJi+4rLJOVy5/CptHDn9 2qyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mBQ78bcB; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id rj3-20020a17090b3e8300b001cb8365e641si9507893pjb.52.2022.04.22.14.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:25:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mBQ78bcB; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B8A22C99C4; Fri, 22 Apr 2022 12:32:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241780AbiDTQCP (ORCPT + 67 others); Wed, 20 Apr 2022 12:02:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232100AbiDTQCO (ORCPT ); Wed, 20 Apr 2022 12:02:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE0440926 for ; Wed, 20 Apr 2022 08:59:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18366B81FC3 for ; Wed, 20 Apr 2022 15:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBD00C385A4 for ; Wed, 20 Apr 2022 15:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650470364; bh=jBfkbPt+WqgrPbEPmDx39QoUW/YAD8qvmYlg9t4Mkzc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mBQ78bcB6jv/eAbe97JJ8+XTsUUv+Fv5eapfmKoPLosoW1/bBsGuUTm+jOMTjqO3Q w+7eagVbzzcLB019NsyReCqk3xJTYToZAmHOPSRAHZYwl42QpuisUDVqf6sDZHmV7k XGU7KbGQycQ64H92sJMIxZvR6eWjeSsOyIFFGmHOe4ob0U1yRF9hU/y0QMDBWa3EuV Jmw38jHt7/c4N6rooAP9Lf4Wn7Qos7KWrEiTrRGPlFaL9/a/XSqYT+ZTc403mzWwN/ rA3YkxV7gMLeeI/dtXGw4wD4HjhBPcmD+DGJaczdqjoEk2laSBvuhI8NeuvjEMYP0r qubCCfPI2bvnA== Received: by mail-pf1-f169.google.com with SMTP id b15so2325164pfm.5 for ; Wed, 20 Apr 2022 08:59:24 -0700 (PDT) X-Gm-Message-State: AOAM530jr0QXBO5gD31/nHq804x9CyJakuRQ4ejabtTb3jqrVwwHTy4Q oOMkQgGidRhp13BPg7mU3DAn20hjogPevUo0Z08= X-Received: by 2002:a05:6a00:181b:b0:50a:46c6:aa74 with SMTP id y27-20020a056a00181b00b0050a46c6aa74mr23988768pfa.15.1650470364221; Wed, 20 Apr 2022 08:59:24 -0700 (PDT) MIME-Version: 1.0 References: <20220420090433.20003-1-bo.jiao@mediatek.com> In-Reply-To: <20220420090433.20003-1-bo.jiao@mediatek.com> From: Ryder Lee Date: Wed, 20 Apr 2022 08:59:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mt76: mt7915: dump SER stats through debugfs To: Bo Jiao Cc: Felix Fietkau , linux-wireless , Ryder Lee , Sujuan Chen , "lian . chen" , Shayne Chen , Evelyn Tsai , linux-mediatek Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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-wireless@vger.kernel.org On Wed, Apr 20, 2022 at 2:05 AM Bo Jiao wrote: > > From: Ryder Lee > > Grab status of system recovery from firmware. > > Signed-off-by: Bo Jiao > Signed-off-by: Ryder Lee > --- > .../wireless/mediatek/mt76/mt7915/debugfs.c | 48 +++++++++++++++++-- > .../net/wireless/mediatek/mt76/mt7915/mcu.c | 5 +- > .../net/wireless/mediatek/mt76/mt7915/mmio.c | 3 ++ > .../net/wireless/mediatek/mt76/mt7915/regs.h | 18 ++++++- > 4 files changed, 64 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c > index dece0a6..76a6570 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c > @@ -45,7 +45,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_implicit_txbf, mt7915_implicit_txbf_get, > mt7915_implicit_txbf_set, "%lld\n"); > > /* test knob of system layer 1/2 error recovery */ > -static int mt7915_ser_trigger_set(void *data, u64 val) > +static int mt7915_fw_ser_set(void *data, u64 val) > { > enum { > SER_SET_RECOVER_L1 = 1, > @@ -71,8 +71,47 @@ static int mt7915_ser_trigger_set(void *data, u64 val) > return ret; > } > > -DEFINE_DEBUGFS_ATTRIBUTE(fops_ser_trigger, NULL, > - mt7915_ser_trigger_set, "%lld\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(fops_fw_ser, NULL, > + mt7915_fw_ser_set, "%lld\n"); > + > +static int > +mt7915_fw_ser_stats_show(struct seq_file *s, void *data) > +{ > + struct mt7915_dev *dev = s->private; > + int ret; > + > + /* grab firmware SER stats */ > + ret = mt7915_mcu_set_ser(dev, 0, 0, 0); > + if (ret) > + return ret; > + > + msleep(100); > + > + seq_printf(s, "::E R , SER_STATUS = 0x%08x\n", > + MT_SWDEF_SER_STATS); > + seq_printf(s, "::E R , SER_PLE_ERR = 0x%08x\n", > + MT_SWDEF_PLE_STATS); > + seq_printf(s, "::E R , SER_PLE_ERR_1 = 0x%08x\n", > + MT_SWDEF_PLE1_STATS); > + seq_printf(s, "::E R , SER_PLE_ERR_AMSDU = 0x%08x\n", > + MT_SWDEF_PLE_AMSDU_STATS); > + seq_printf(s, "::E R , SER_PSE_ERR = 0x%08x\n", > + MT_SWDEF_PSE_STATS); > + seq_printf(s, "::E R , SER_PSE_ERR_1 = 0x%08x\n", > + MT_SWDEF_PSE1_STATS); > + seq_printf(s, "::E R , SER_LMAC_WISR6_B0 = 0x%08x\n", > + MT_SWDEF_LAMC_WISR6_BN0_STATS); > + seq_printf(s, "::E R , SER_LMAC_WISR6_B1 = 0x%08x\n", > + MT_SWDEF_LAMC_WISR6_BN1_STATS); > + seq_printf(s, "::E R , SER_LMAC_WISR7_B0 = 0x%08x\n", > + MT_SWDEF_LAMC_WISR7_BN0_STATS); > + seq_printf(s, "::E R , SER_LMAC_WISR7_B1 = 0x%08x\n", > + MT_SWDEF_LAMC_WISR7_BN1_STATS); > + > + return 0; > +} > + > +DEFINE_SHOW_ATTRIBUTE(mt7915_fw_ser_stats); I'm thinking we can merge this knob fw_ser_stats into fw_ser to make it more convenient for use. > static int > mt7915_radar_trigger(void *data, u64 val) > @@ -884,6 +923,8 @@ int mt7915_init_debugfs(struct mt7915_phy *phy) > debugfs_create_file("xmit-queues", 0400, dir, phy, > &mt7915_xmit_queues_fops); > debugfs_create_file("tx_stats", 0400, dir, phy, &mt7915_tx_stats_fops); > + debugfs_create_file("fw_ser", 0200, dir, dev, &fops_fw_ser); > + debugfs_create_file("fw_ser_stats", 0400, dir, dev, &mt7915_fw_ser_stats_fops); > debugfs_create_file("fw_debug_wm", 0600, dir, dev, &fops_fw_debug_wm); > debugfs_create_file("fw_debug_wa", 0600, dir, dev, &fops_fw_debug_wa); > debugfs_create_file("fw_debug_bin", 0600, dir, dev, &fops_fw_debug_bin); > @@ -897,7 +938,6 @@ int mt7915_init_debugfs(struct mt7915_phy *phy) > &mt7915_rate_txpower_fops); > debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir, > mt7915_twt_stats); > - debugfs_create_file("ser_trigger", 0200, dir, dev, &fops_ser_trigger); > if (!dev->dbdc_support || phy->band_idx) { > debugfs_create_u32("dfs_hw_pattern", 0400, dir, > &dev->hw_pattern);