Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp269188pxa; Fri, 31 Jul 2020 11:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPd6LtZwNuQSZV5PovJ8dYlAkJuaoxMKCQBL/y2yMll/jPSQTE0fATX1vZqJbkOIBeMQ0q X-Received: by 2002:aa7:dd5a:: with SMTP id o26mr5297566edw.197.1596220156495; Fri, 31 Jul 2020 11:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596220156; cv=none; d=google.com; s=arc-20160816; b=fq2+EWv8AYNtqC+YlLkAzcfUMvwhLLV6vebGnp4yrOU3lfbz0MSYDiNI5SYE0Q4Y98 xbTyLN+G4oEKboL2FI8WLuN0QdmkWLLMCwPYjJaMFJ5gEg9yG4oKTdCkf3xoNXtGZhr+ Qk5fFcNUGjmExR7Mno4KBIJKquIcQpm6P0MQ/bLqu+Jg6zXtpBuxjK1YC2Ln7Rs/mHmX g51H3fLLdZJD3fbP2G/ndIUjANuouHxg8VOwD2mtMwVE4BOrE4x1/bk5pvSh8p4ihvp0 SeJN0EwaRCnmshYb2eridJVrWW65sgBXYGDWS/tCgprStlJI6YCM8GzW6WfejFj+/ck0 x8fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=vjQiGVYzJ12zA+igqujOYlOj1OL8iIPU8CB8EiC7eQw=; b=lnRbD/6ynyNe7yWrMYYiydkWPVGzpmejF5zjnvI8KrJUVvdnrzFVl7Rgm0/ioPMRuA 2D5n7JJyyWYdyfqmYldugSEmHBZIOuTkfZqeM0nY0RDoUxUriEFLJgVvqQAPBgnY+Rxz gtMNPrlhmqjVOBfxBCzC+NSOh6lTZ+LsoniWfKDOHVXjUGIutqndr1f2jyV1Pg6mmboB Cx+g1hSZVPvYfQJHbzNHW+onLHB3hnkuco6ZnjDs6fKpEUtguh++2KCoecZioG3FaSbO 2SngYEfHlsSrx613DUFjdwZTpmIbA8pm1C5Wu6RAIa7ncTuQsDpzi8gYvQHjWWzsyZHc VZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="V/ERma/e"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si5318053ejm.324.2020.07.31.11.28.52; Fri, 31 Jul 2020 11:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="V/ERma/e"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387872AbgGaS2J (ORCPT + 99 others); Fri, 31 Jul 2020 14:28:09 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:26226 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387846AbgGaS2J (ORCPT ); Fri, 31 Jul 2020 14:28:09 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596220088; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=vjQiGVYzJ12zA+igqujOYlOj1OL8iIPU8CB8EiC7eQw=; b=V/ERma/eflF4cCYF/veW1VrBM0/yRWp+aNYdootEugzfboNLLnuJlGjpSxcbYznYFTcCMaLn tkiM3T3UIvg84FISExYZdIHIULTIH11RFvAJRpfEhpliQzN5UADsSJVLaz5gm65sxJt33w/2 HGsVp7ZGmjJVl+9xERKq/s4jCCo= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 5f2462a2eb556d49a65354bc (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 31 Jul 2020 18:27:46 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DC2F0C433A0; Fri, 31 Jul 2020 18:27:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pillair-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id 875B1C433A1; Fri, 31 Jul 2020 18:27:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 875B1C433A1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Rakesh Pillai Subject: [PATCH v2 3/3] ath10k: Add debugfs support to enable event history Date: Fri, 31 Jul 2020 23:57:22 +0530 Message-Id: <1596220042-2778-4-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596220042-2778-1-git-send-email-pillair@codeaurora.org> References: <1596220042-2778-1-git-send-email-pillair@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add the support to enable/disable the recording of debug events history. The enable/disable of the history from debugfs will not make any affect if its not enabled via module parameter. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/debug.c | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 5d08652..6785fae 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -610,6 +610,59 @@ static const struct file_operations fops_simulate_fw_crash = { .llseek = default_llseek, }; +static ssize_t ath10k_read_history_enable(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) +{ + const char buf[] = + "To enable recording of certain event history, write to this file with the enable mask\n" + "BIT(0): Enable Reg Access history\n" + " - Register write events\n" + " - Register read events\n" + "BIT(1): Enable CE events history\n" + " - ATH10K_IRQ_TRIGGER event\n" + " - ATH10K_NAPI_POLL event\n" + " - ATH10K_CE_SERVICE event\n" + " - ATH10K_NAPI_COMPLETE event\n" + " - ATH10K_NAPI_RESCHED event\n" + " - ATH10K_IRQ_SUMMARY event\n" + "BIT(2): Enable WMI CMD history\n" + " - WMI CMD event\n" + " - WMI CMD TX completion event\n" + "BIT(3): Enable WMI events history\n" + " - WMI Events event\n"; + + return simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf)); +} + +static ssize_t ath10k_write_history_enable(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + u32 history_enable_mask; + int i, ret; + + ret = kstrtou32_from_user(user_buf, count, 0, &history_enable_mask); + if (ret) + return ret; + + for (i = 0; i < ATH10K_HISTORY_MAX; i++) + if (history_enable_mask & BIT(i)) + set_bit(i, &ath10k_history_enable_mask); + else + clear_bit(i, &ath10k_history_enable_mask); + + return count; +} + +static const struct file_operations fops_history_enable = { + .read = ath10k_read_history_enable, + .write = ath10k_write_history_enable, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + static ssize_t ath10k_read_chip_id(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { @@ -2658,6 +2711,9 @@ int ath10k_debug_register(struct ath10k *ar) debugfs_create_file("reset_htt_stats", 0200, ar->debug.debugfs_phy, ar, &fops_reset_htt_stats); + debugfs_create_file("history_enable", 0644, ar->debug.debugfs_phy, ar, + &fops_history_enable); + return 0; } -- 2.7.4