From patchwork Tue Aug 15 13:06:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9901853 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3C21602C9 for ; Tue, 15 Aug 2017 13:07:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E61B71FF54 for ; Tue, 15 Aug 2017 13:07:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAFD526E46; Tue, 15 Aug 2017 13:07:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 375CC1FF54 for ; Tue, 15 Aug 2017 13:07:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751628AbdHONHJ (ORCPT ); Tue, 15 Aug 2017 09:07:09 -0400 Received: from mail-by2nam03on0068.outbound.protection.outlook.com ([104.47.42.68]:39264 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbdHONHH (ORCPT ); Tue, 15 Aug 2017 09:07:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l7fmU/utJD8wnT4hxSnK6mQGM2q0Rz27XcejtVG4jME=; b=z336msh9ymOvYwZrQWRMlJpUySRwxmf3WeRvps8JwyNNJhvEat2Tlf2d1r2BmyKDXX1uYYvm/DahClKOrSeYbUPk4jPSO/yU1THWlx+8w38LRzssf0eCuXnaCkJfQdmytK0meJLbLABe5+6szB6z9nccFaVeuuF7dcZ5S3cC0Jk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.12; Tue, 15 Aug 2017 13:07:04 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 7/9] qtnfmac: introduce counter for Rx underflow events Date: Tue, 15 Aug 2017 16:06:37 +0300 Message-Id: <20170815130638.31718-8-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170815130638.31718-1-sergey.matyukevich.os@quantenna.com> References: <20170815130638.31718-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM5PR0602CA0021.eurprd06.prod.outlook.com (10.175.46.159) To BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b6492a2-906d-4c24-9af2-08d4e3de86d1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BLUPR05MB1924; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1924; 3:td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ziAOGh4/t41L/7clURbgpPS+rtxdNjOSvOBezSwnfipwqLQnuv0pP2y92TeMupBORz8vRyoo2hx5yijF8APKG5JKSoMnvnUpVswo3GZwr01+pAKMcPZ06IxbYW8lAlcfNP6cIpgpk7Bh6ZAi0oBd6BXbVp8+Woz5497BVG8oSFDetyEi80hd4aNqaedAJ9DPOSba5cbiqNUDQMRpnQRH1aT5r9mW36QT4cjBfFNRONgXWfTWcxmkHr7lOJV9qAXJXXK49EzY//7FdvY5dODViZ9EdjzMWKDfH5pV6wEQgtqDtpd5km1Ynb5Zw8dn/88vDJLkDfeFtwgQBsxlArx; 4:6NtdneI7vdfEmudFRldLkS/yN7311DOyh1p/4tFgg+jVjhboIndsEsypm/Eu8kyW9vShTKZIpbsmE3Q0n40dTKKOf0Y3XEb3aal8GC36hxpg391sbRecqVbluovKV1vOztLN9evNnmWzxdMoCaz/aP5NxWIjKnO2w73xow+R0IzPbyNp38NzrNXdKP6xXwxjvkFMPXP3dUh1jb0BkDE+s3QBLAjKcmMa2ZVker+rUU/RsnQNAxyNj1vAYj2pCdQt X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB1924; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB1924; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39830400002)(189002)(199003)(86362001)(478600001)(4326008)(305945005)(25786009)(101416001)(2906002)(47776003)(7736002)(66066001)(81156014)(81166006)(8676002)(50226002)(103116003)(189998001)(50986999)(69596002)(76176999)(97736004)(50466002)(2361001)(2351001)(33646002)(6486002)(1076002)(48376002)(106356001)(105586002)(36756003)(5660300001)(68736007)(53936002)(110136004)(107886003)(42186005)(6666003)(7350300001)(2950100002)(5003940100001)(6116002)(53416004)(6916009)(3846002)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1924; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1924; 23:GSGSCYde3fQHQmVAzOgHx878ZJ1ZOisRUczTBJN24?= =?us-ascii?Q?iWvooguODCr1h2oLnHXuKbl9xuI/rnvKLGwS1Rsa7sJb31qVbt3X7Sirsanr?= =?us-ascii?Q?J0mhe0NJ8Jm7sx2swEaHAsVADpRbG2siq3v6mxomvXCXGsiXfpAOBRjw0xQa?= =?us-ascii?Q?Gbo0nddVFcIxQNDkIa65GGE9NY40jk5LWvfBsncawD+wdCOuORPHrRLnfGM0?= =?us-ascii?Q?kJGDHaT67pfVXNyQlyHvwSg6XewNQJbH830U+Ku821pP8zX/XGiOFuj+8Z4d?= =?us-ascii?Q?gMiRDdus6wZD4yQ3zk21oxolFRGFmJg1agf9nKIA9wjyFDP6wUNQtC+rliCB?= =?us-ascii?Q?FExYcfgsl+UHDy2MqqJ3vE5k+dD+xOIiOeZK6gjvrCfdLjFv1dwH+Yyw9QWc?= =?us-ascii?Q?G07gYq+ohN2exaSHmxTxdb6O0RluchXerB+Gi7zMHhcI17AtbFqKcjNcCkD/?= =?us-ascii?Q?KjcGumksnZ0P9VP+ZqidhfSbqJnUJHow2zFgLGzpG6T0tt/f63AXbqyWTQgo?= =?us-ascii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+eVH+ePQ/8FdThSTp0lWw75dHG8mU/uQIzdvhECPVSMQ5C9HCoSx7C9VC4glahpBV5TibPlFRL24dbJ0k4DTm8srzE92U3KSxp5CYrIrNlRah4cIB+CmhgN6RpfmVnCLctD/4xIyNCLj2vs85LXFNbldRv+xrCMk7Uwm229a1x6J5ve4fmtZTnECVW6jYDKTx2bthIB7oomFtt3QgA==; 5:44ZaTcI6vMxMWP+6jm4ULGkWstnDy8fuEnZeEZmMqzlOggTz4g3ny0oNRG4F4isjN+8DrqTN9HADujY/tqMpz5CzPk0mSYmaxCYFU498PJ2SlfqSesTHFXEtZnBiZWIfLeoknOkVfB9iT9NXMaBkuw==; 24:qbarsctTa1dbQMC3Al/8Vlj2uBz/FnfNX1D5AEn/4mGSAM4GwyyHcx/CCW4S40bidjn6woz0HA3TRFFxENviWmqkdCoJbiikR6Ku1ERNyYo=; 7:jszOXr1f4Z3HMH6Y1i87KIcjJGhJNFxGoKsoDWfmc1w3rAf7bR+qhoOXWVCW9F2BTHTh/WXllpobnP8WU7+NgJJCdwSt52giJCzUwOWFYV3dTIMqGhfGvdqeWBSZlvRWVKcGim5OwBxTpVW/jw9xbLsDxDE0laf2ePzmeX3bl69osuGtKrH0IVoDAWqiMFhvrdoDnQGfVkV82dtu7ot/cNkCXV9ajxYXD0J/WOb1j/g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 13:07:04.3335 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1924 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce counter for Rx underflow events. Export this counter via debugfs. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 16 ++++++++++++++-- .../net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h | 1 + drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h | 1 + .../wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index f8207ab25576..72730aff2a41 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -686,14 +686,21 @@ static irqreturn_t qtnf_interrupt(int irq, void *data) if (!(status & priv->pcie_irq_mask)) goto irq_done; - if (status & PCIE_HDP_INT_RX_BITS) { + if (status & PCIE_HDP_INT_RX_BITS) priv->pcie_irq_rx_count++; + + if (status & PCIE_HDP_INT_TX_BITS) + priv->pcie_irq_tx_count++; + + if (status & PCIE_HDP_INT_HHBM_UF) + priv->pcie_irq_uf_count++; + + if (status & PCIE_HDP_INT_RX_BITS) { qtnf_dis_rxdone_irq(priv); napi_schedule(&bus->mux_napi); } if (status & PCIE_HDP_INT_TX_BITS) { - priv->pcie_irq_tx_count++; qtnf_dis_txdone_irq(priv); tasklet_hi_schedule(&priv->reclaim_tq); } @@ -1104,6 +1111,10 @@ static int qtnf_dbg_irq_stats(struct seq_file *s, void *data) status = reg & PCIE_HDP_INT_RX_BITS; seq_printf(s, "pcie_irq_rx_status(%s)\n", (status == PCIE_HDP_INT_RX_BITS) ? "EN" : "DIS"); + seq_printf(s, "pcie_irq_uf_count(%u)\n", priv->pcie_irq_uf_count); + status = reg & PCIE_HDP_INT_HHBM_UF; + seq_printf(s, "pcie_irq_hhbm_uf_status(%s)\n", + (status == PCIE_HDP_INT_HHBM_UF) ? "EN" : "DIS"); return 0; } @@ -1189,6 +1200,7 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) pcie_priv->pcie_irq_count = 0; pcie_priv->pcie_irq_rx_count = 0; pcie_priv->pcie_irq_tx_count = 0; + pcie_priv->pcie_irq_uf_count = 0; pcie_priv->tx_reclaim_done = 0; pcie_priv->tx_reclaim_req = 0; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h index 1b37914299e9..698e42132ed4 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h @@ -78,6 +78,7 @@ struct qtnf_pcie_bus_priv { u32 pcie_irq_count; u32 pcie_irq_rx_count; u32 pcie_irq_tx_count; + u32 pcie_irq_uf_count; u32 tx_full_count; u32 tx_done_count; u32 tx_reclaim_done; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h index e00d508fbcf0..667f5ec457e3 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h @@ -50,6 +50,7 @@ #define PCIE_HDP_INT_RX_BITS (0 \ | PCIE_HDP_INT_EP_TXDMA \ | PCIE_HDP_INT_EP_TXEMPTY \ + | PCIE_HDP_INT_HHBM_UF \ ) #define PCIE_HDP_INT_TX_BITS (0 \ diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h index 78715b8a8ef9..69696f118769 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h @@ -333,6 +333,7 @@ #define PCIE_HDP_INT_RX_LEN_ERR (BIT(2)) #define PCIE_HDP_INT_RX_HDR_LEN_ERR (BIT(3)) #define PCIE_HDP_INT_EP_TXDMA (BIT(12)) +#define PCIE_HDP_INT_HHBM_UF (BIT(13)) #define PCIE_HDP_INT_EP_TXEMPTY (BIT(15)) #define PCIE_HDP_INT_IPC (BIT(29))