ath12k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>,
	<ath12k@lists.infradead.org>,  <linux-wireless@vger.kernel.org>,
	 Muna Sinada <quic_msinada@quicinc.com>
Subject: Re: [PATCH v2 07/10] wifi: ath12k: add support for setting fixed HE rate/GI/LTF
Date: Tue, 02 Apr 2024 14:41:12 +0300	[thread overview]
Message-ID: <875xx06lgn.fsf@kernel.org> (raw)
In-Reply-To: <a217c752-65fb-4975-8208-c708a0ceeab8@quicinc.com> (Jeff Johnson's message of "Fri, 29 Mar 2024 14:34:41 -0700")

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 3/27/2024 10:09 AM, Pradeep Kumar Chitrapu wrote:
>> Add support to set fixed HE rate/GI/LTF values using nl80211.
>> Reuse parts of the existing code path already used for HT/VHT
>> to implement the new helpers symmetrically, similar to how
>> HT/VHT is handled.
>> 
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>> 
>> Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
>> Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
>> Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
>> ---
>>  drivers/net/wireless/ath/ath12k/mac.c | 588 ++++++++++++++++++++++++--
>>  drivers/net/wireless/ath/ath12k/wmi.h |  18 +
>>  2 files changed, 562 insertions(+), 44 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath12k/mac.c
>> b/drivers/net/wireless/ath/ath12k/mac.c
>> index 46ef2d63a3de..72232285d2b1 100644
>> --- a/drivers/net/wireless/ath/ath12k/mac.c
>> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> [...]
>> @@ -3888,8 +4130,9 @@ static void ath12k_sta_rc_update_wk(struct work_struct *wk)
>>  	mutex_lock(&ar->conf_mutex);
>>  
>>  	nss = max_t(u32, 1, nss);
>> -	nss = min(nss, max(ath12k_mac_max_ht_nss(ht_mcs_mask),
>> -			   ath12k_mac_max_vht_nss(vht_mcs_mask)));
>> +	nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
>> +			    ath12k_mac_max_vht_nss(vht_mcs_mask),
>> +			    ath12k_mac_max_he_nss(he_mcs_mask)));
>
> When I run this entire series through ath12k-check I'm getting the following
> issue here:
>
> drivers/net/wireless/ath/ath12k/mac.c:4170:15: error: too long token expansion
> drivers/net/wireless/ath/ath12k/mac.c:4170:15: error: too long token expansion
>
> caeed0eb7fb4d (Pradeep Kumar Chitrapu 2024-03-27 10:09:07 -0700 4170)
> nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
>
> I don't see anything wrong with the code.
>
> Even stranger is that when this series is in place, I see this same issue at
> another place:
> drivers/net/wireless/ath/ath12k/mac.c:7903:23: error: too long token expansion
> drivers/net/wireless/ath/ath12k/mac.c:7903:23: error: too long token expansion
>
> But that is actually pre-existing code from the original ath12k driver drop:
> d889913205cf7 (Kalle Valo 2022-11-28 17:09:53 +0200 7903) nss =
> min_t(u32, ar->num_tx_chains,
>
> And the issue is not flagged when this series is not present.
>
> However that same logic also caused the same issue in ath11k, and Kalle fixed
> it there with:
> https://lore.kernel.org/all/20231214161740.1582340-1-kvalo@kernel.org/
>
> And one of the MediaTek drivers encountered a similar issue here:
> https://lore.kernel.org/all/5457b92e41909dd75ab3db7a0e9ec372b917a386.1710858172.git.lorenzo@kernel.org/
>
> So there is definitely a tooling issue here.

IIRC this is due to a statement length limit reached in sparse (or
something like that) and recently max()/min() macros were modified so
that their output is longer than before.

> As a local test I added an intermediate step and now I don't see the issue
> here:
> -       u32 changed, bw, nss, smps, bw_prev;
> +       u32 changed, bw, nss, mac_nss, smps, bw_prev;
> ...
> -       nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
> -                           ath12k_mac_max_vht_nss(vht_mcs_mask),
> -                           ath12k_mac_max_he_nss(he_mcs_mask)));
> +       mac_nss = max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
> +                      ath12k_mac_max_vht_nss(vht_mcs_mask),
> +                      ath12k_mac_max_he_nss(he_mcs_mask));
> +       nss = min(nss, mac_nss);
>
> So let's add something like that in v3 (perhaps pick a better name)

Yeah, that's a good way to workaround the warning.

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

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


  parent reply	other threads:[~2024-04-02 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 17:09 [PATCH v2 00/10] wifi: ath12k: add MU-MIMO and 160 MHz bandwidth support Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 01/10] wifi: mac80211: Add EHT UL MU-MIMO flag in ieee80211_bss_conf Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 02/10] wifi: ath12k: push HE MU-MIMO params from hostapd to hardware Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 03/10] wifi: ath12k: push EHT " Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 04/10] wifi: ath12k: move HE MCS mapper to a separate function Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 05/10] wifi: ath12k: generate rx and tx mcs maps for supported HE mcs Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 06/10] wifi: ath12k: fix TX and RX MCS rate configurations in HE mode Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 07/10] wifi: ath12k: add support for setting fixed HE rate/GI/LTF Pradeep Kumar Chitrapu
2024-03-29 21:34   ` Jeff Johnson
2024-04-01 18:08     ` Pradeep Kumar Chitrapu
2024-04-02 11:41     ` Kalle Valo [this message]
2024-03-27 17:09 ` [PATCH v2 08/10] wifi: ath12k: clean up 80P80 support Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 09/10] wifi: ath12k: add support for 160 MHz bandwidth Pradeep Kumar Chitrapu
2024-03-27 17:09 ` [PATCH v2 10/10] wifi: ath12k: add extended NSS bandwidth support for 160 MHz Pradeep Kumar Chitrapu
2024-03-29 17:45 ` [PATCH v2 00/10] wifi: ath12k: add MU-MIMO and 160 MHz bandwidth support Pradeep Kumar Chitrapu

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=875xx06lgn.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    --cc=quic_msinada@quicinc.com \
    --cc=quic_pradeepc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).