All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Ramya Gnanasekar <quic_rgnanase@quicinc.com>
Cc: ath12k@lists.infradead.org,  linux-wireless@vger.kernel.org,
	 Lingbo Kong <quic_lingbok@quicinc.com>
Subject: Re: [PATCH v2 3/5] wifi: ath12k: Fix Pdev id in HTT stats request for WCN7850
Date: Tue, 21 May 2024 10:57:42 +0300	[thread overview]
Message-ID: <87pltfd2bt.fsf@kernel.org> (raw)
In-Reply-To: <20240510050806.514126-4-quic_rgnanase@quicinc.com> (Ramya Gnanasekar's message of "Fri, 10 May 2024 10:38:04 +0530")

Ramya Gnanasekar <quic_rgnanase@quicinc.com> writes:

> From: Lingbo Kong <quic_lingbok@quicinc.com>
>
> Pdev id from mac phy capabilities will be sent as a part of
> HTT stats request to firmware. This causes issue with single pdev
> devices where fimrware does not respond to the stats request
> sent from host.
>
> Single pdev devices firmware expects pdev id as 1 for 5GHz/6GHz
> phy and 2 for 2GHz band. Handle pdev id for single phy device
> while sending HTT stats request message to firmware.
>
> 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: Lingbo Kong <quic_lingbok@quicinc.com>
> Signed-off-by: Ramya Gnanasekar <quic_rgnanase@quicinc.com>

[...]

> @@ -1029,7 +1030,12 @@ ath12k_dp_tx_htt_h2t_ext_stats_req(struct ath12k *ar, u8 type,
>  	memset(cmd, 0, sizeof(*cmd));
>  	cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_EXT_STATS_CFG;
>  
> -	cmd->hdr.pdev_mask = 1 << ar->pdev->pdev_id;
> +	if (ab->hw_params->single_pdev_only)
> +		pdev_id = ath12k_mac_get_target_pdev_id(ar);
> +	else
> +		pdev_id = ar->pdev->pdev_id;

Wouldn't it be cleaner to have the single_pdev_only check in
ath12k_mac_get_target_pdev_id()?

> +struct ath12k_vif *ath12k_mac_get_vif_up(struct ath12k_base *ab)
> +{
> +	struct ath12k *ar;
> +	struct ath12k_pdev *pdev;
> +	struct ath12k_vif *arvif;
> +	int i;
> +
> +	for (i = 0; i < ab->num_radios; i++) {
> +		pdev = &ab->pdevs[i];
> +		ar = pdev->ar;
> +		list_for_each_entry(arvif, &ar->arvifs, list) {
> +			if (arvif->is_up)
> +				return arvif;
> +		}
> +	}
> +
> +	return NULL;
> +}

I'm not seeing any protection here, is that on purpose?

> +u8 ath12k_mac_get_target_pdev_id(struct ath12k *ar)
> +{
> +	struct ath12k_vif *arvif;
> +
> +	arvif = ath12k_mac_get_vif_up(ar->ab);
> +
> +	if (arvif)
> +		return ath12k_mac_get_target_pdev_id_from_vif(arvif);
> +	else
> +		return ar->ab->fw_pdev[0].pdev_id;
> +}

No need to have else after return.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


  parent reply	other threads:[~2024-05-21  7:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  5:08 [PATCH v2 0/5] wifi: ath12k: Add support to enable debugfs_htt_stats Ramya Gnanasekar
2024-05-10  5:08 ` [PATCH v2 1/5] " Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:49   ` Kalle Valo
2024-05-27 10:42     ` Ramya Gnanasekar
2024-05-10  5:08 ` [PATCH v2 2/5] wifi: ath12k: Add htt_stats_dump file ops support Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:53   ` Kalle Valo
2024-05-10  5:08 ` [PATCH v2 3/5] wifi: ath12k: Fix Pdev id in HTT stats request for WCN7850 Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:57   ` Kalle Valo [this message]
2024-05-23 12:34     ` Lingbo Kong
2024-05-23 12:55       ` Kalle Valo
2024-05-23 14:04         ` Lingbo Kong
2024-05-10  5:08 ` [PATCH v2 4/5] wifi: ath12k: Add support to parse requested stats_type Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-10  5:08 ` [PATCH v2 5/5] wifi: ath12k: Dump additional Tx PDEV HTT stats Ramya Gnanasekar
2024-05-10 19:54   ` Jeff Johnson
2024-05-21  8:00   ` Kalle Valo
2024-05-27  9:38     ` Ramya Gnanasekar
2024-05-28 11:06       ` Kalle Valo
2024-05-28 16:48         ` Ramya Gnanasekar
2024-05-31 18:00           ` Kalle Valo
2024-05-31 19:05             ` Ramya Gnanasekar
2024-05-21  7:40 ` [PATCH v2 0/5] wifi: ath12k: Add support to enable debugfs_htt_stats Kalle Valo
2024-05-27 10:44   ` Ramya Gnanasekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pltfd2bt.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_lingbok@quicinc.com \
    --cc=quic_rgnanase@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.