Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2921255lqo; Tue, 21 May 2024 00:54:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV162S+ZdgqDaBYLf5uU/kvce9Lzm7z+WEr4EN7zW2doyaduA15oYRiJLuiKR/GKhy+aPu8llkeQBl7avXuHIbgoDv6UXwtk6G7ioo0Vw== X-Google-Smtp-Source: AGHT+IFJCSAxFcUu9kjvqQHs5biiNqhtaqV4OlrFbznMUD4BnWDM4U9r1eksYcxYQ8EKeRan49c0 X-Received: by 2002:a05:6122:3c91:b0:4d3:45a2:ae53 with SMTP id 71dfb90a1353d-4df8838b136mr24925998e0c.16.1716278044494; Tue, 21 May 2024 00:54:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716278044; cv=pass; d=google.com; s=arc-20160816; b=YUcYWp7t6nHhFRaBd3p7iHyjTyEAVo2Y1NuwcH6e1HK2kdGRRwLm41VWu/3PsoGJit 3QzhkE+B0bEVC1pi834kntDC27uaFQipje5tZLyfLxCX1hJQsL4Zf/AnvuAWXY+K++uf jSTTD7CuYH/5McirczUWpLHvDLxMaLk1FLZhbmyYPhigZ4J4IKxYKfJNkiu+ayN1VU4B Mb9HB1RkPCRbzgOaQx2G3dX6f/pdDnW8m1NAtiFBLhCVFIgvjAalCzhnN+oARktmwU4P K75sUznUKHT3PG1oOoxbVev4ZhB6jvGX3iZEU0XHjh3MrnfVKwmT8mYW4DkvfNLygZaE 10yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=kTxB8D4oRbHgus1TGCmKjcQOZw8ddb85M/Tm8Q3vHGE=; fh=A7OfgHaee/FkrIX0pQzxdl5cv7BEN0yVGEblzOUO1QY=; b=saYzjopEnnUnVC3vu88Tq1rtccjm4l3aqtK4B7UtNUvlG5VHDfxDH2k8tMRGGHEtxM 5EIdWWs+ts54U3oV7DdghBJvhZMQda77oAui4NDX2koYPG9NvQSRR/hdB0IWxV54eqoc LSCIjKhbFwbyQcaMc4laYJm8urKt1w5E9Urhmq3JgDivCHy7gzlIZWcEFBempHyO5hrB n4PrHC1BrG5S2w7l2Ke10cXygbDC8vkomRU3pyrkMHFgGgoDJ5swMirHqPeMnoha2irN a/j0KXevZzxgkag6MknH51rkrtoSvRbhVIZMy5Q/J8LCwc2TeFgd9QaP1YQQXQXqtTOZ 7Ciw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OqJAPeK2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7873-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf33f18fsi526427785a.511.2024.05.21.00.54.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 00:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OqJAPeK2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7873-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 29DD91C20A3B for ; Tue, 21 May 2024 07:54:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1247E46522; Tue, 21 May 2024 07:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OqJAPeK2" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1DAC1DA53 for ; Tue, 21 May 2024 07:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716278042; cv=none; b=X0T4HbomQQQ+qfgSjqRRHW46z91XGrQGPBt0l55O76Canp8N2C6l6lR/8LLlau01I8SjQlg2Dbe/YElNWh9RVHWFs4ss4MJ+HzcK0gsR9dX1OlBwAJo3gmzL/0SgVeqQaCd+bW9SilAT3zlWbUTO1BdkMq11i+5pFsOrHp/g6m4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716278042; c=relaxed/simple; bh=d30O1iXiP/3oLi5EUYET0mR7EIn9+D7O3ZNh0bGwZfE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=DeLReAFkXr9LpkrelvnD8t0Z+Y3by2u3l6hQUyhY+PAwH7HB/5tJb6VZdLsOymZH4eg7KRGE+qHrvQD/lb+zJiMg0DJW663CMp5L9BDcl6RG0t0DR6X+99/L/1qHVXRsM/lVFzYLuMfPvjo1+kFIx8GdEownRKp/0PNfr0WaeCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OqJAPeK2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8DB1C2BD11; Tue, 21 May 2024 07:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716278041; bh=d30O1iXiP/3oLi5EUYET0mR7EIn9+D7O3ZNh0bGwZfE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=OqJAPeK2RX0K1Jlk924blA+4kRTR0WGfI+b08xWL1ESb3NEQnoMsQUmL8yAY0EUPI chgCP8z9z9D9EO6yRCcJ9viWlI2evxidXxfIAmUcIR1pCHXpnckmXesxGOD1nk02N3 w3YIq8amga80Asqg335cC9juPKJYK5z1CnVhAAqP/m3cXa6vb2dQ8n0b3zf/aDXXhw 6x3L4JksH5d9nN+odVtT4SxNUi/Z2eq981qH0viXDEHTQKo4tenChWDWbsJeAn1mSW aWVuOjIIwCnVTkpy7+TQ7JhUS+mxnip6TgaoYhN7zXgqLS/GS6kQi+WahEwhIWprhK gFL9fOo5VnpkA== From: Kalle Valo To: Ramya Gnanasekar Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, Dinesh Karthikeyan Subject: Re: [PATCH v2 2/5] wifi: ath12k: Add htt_stats_dump file ops support References: <20240510050806.514126-1-quic_rgnanase@quicinc.com> <20240510050806.514126-3-quic_rgnanase@quicinc.com> Date: Tue, 21 May 2024 10:53:59 +0300 In-Reply-To: <20240510050806.514126-3-quic_rgnanase@quicinc.com> (Ramya Gnanasekar's message of "Fri, 10 May 2024 10:38:03 +0530") Message-ID: <87ttird2i0.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Ramya Gnanasekar writes: > From: Dinesh Karthikeyan > > Add dump_htt_stats file operation to dump the stats value requested > for the requested stats_type. > Stats sent from firmware will be cumulative. Hence add debugfs to reset > the requested stats type. > > Example with one ath12k device: > > ath12k > `-- pci-0000:06:00.0 > |-- mac0 > `-- htt_stats > |-- htt_stats_type > |-- htt_stats_reset > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 > > Signed-off-by: Dinesh Karthikeyan > Co-developed-by: Ramya Gnanasekar > Signed-off-by: Ramya Gnanasekar > --- > drivers/net/wireless/ath/ath12k/core.h | 2 + > .../wireless/ath/ath12k/debugfs_htt_stats.c | 202 ++++++++++++++++++ > .../wireless/ath/ath12k/debugfs_htt_stats.h | 30 +++ > 3 files changed, 234 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h > index 3919bc828620..77c0842e5ab0 100644 > --- a/drivers/net/wireless/ath/ath12k/core.h > +++ b/drivers/net/wireless/ath/ath12k/core.h > @@ -477,6 +477,8 @@ struct ath12k_fw_stats { > struct ath12k_dbg_htt_stats { > enum ath12k_dbg_htt_ext_stats_type type; > u32 cfg_param[4]; > + u8 reset; > + struct debug_htt_stats_req *stats_req; Please document with a code comment how these are protected > /* protects shared stats req buffer */ > spinlock_t lock; I'm guessing "stats req buffer" refers to struct ath12k_dbg_htt_stats::stats_req. But at least in ath12k_release_htt_stats() you are using conf_mutex for protection: static int ath12k_release_htt_stats(struct inode *inode, struct file *file) { struct ath12k *ar = inode->i_private; mutex_lock(&ar->conf_mutex); kfree(file->private_data); ar->debug.htt_stats.stats_req = NULL; mutex_unlock(&ar->conf_mutex); return 0; } > +static int ath12k_debugfs_htt_stats_req(struct ath12k *ar) > +{ > + struct debug_htt_stats_req *stats_req = ar->debug.htt_stats.stats_req; > + enum ath12k_dbg_htt_ext_stats_type type = stats_req->type; > + u64 cookie; > + int ret, pdev_id = ar->pdev->pdev_id; > + struct htt_ext_stats_cfg_params cfg_params = { 0 }; > + > + init_completion(&stats_req->htt_stats_rcvd); > + > + stats_req->done = false; > + stats_req->pdev_id = pdev_id; The locking design is not clear for me yet but I suspect this function needs: lockdep_assert_held(&ar->conf_mutex); -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches