Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2004497lqz; Tue, 2 Apr 2024 04:41:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVq2HuxarzbxjznPr2fN6WnJ3rfe//1gxVNz52d5ZK/8E8U5gGfaB00nwI1PnJEewiaNXTeIW6KONkwQ1SDZrLtU0k4QtK/ln7uArI9VA== X-Google-Smtp-Source: AGHT+IFaGgKE35BYg9Lf09e6WAaNMsIEy84grS64aVt0+oVElpMCik3+9MNkZO5SwUdDdAa8/HQ3 X-Received: by 2002:a05:6a20:9152:b0:1a3:a8ff:473b with SMTP id x18-20020a056a20915200b001a3a8ff473bmr18457699pzc.29.1712058079829; Tue, 02 Apr 2024 04:41:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712058079; cv=pass; d=google.com; s=arc-20160816; b=E1rqHnGVwRsUZbc64FEWBX+7SutWGcyfLCooA5ha0N9Lt7+ux9Ntix0A92eyx9+t+c kqWagQqoq3a4iTOqqdxjMycy4rZiwzolOJMZI6Lyd73QkoFf7yMUeKTzmqyEEUg/cBYJ dd/DnGJJHmxZPd4MALYA+7s4DR3iwNpG52XwO+ibqPl1FdftAO0HOl0ic86jxP2QPq9h G14C+eaCcCOm3TjRAZV8HJDPgygOanjbs6xiP2yM25NERZvNPPLpgiPKqZzCfbHusNxN VBU8tvwqscXTGLpd8cmhp+gEzCtoWdwfWQCQqXEfcgn80in4DyZRJ46yVAufzbtuG6GY ZR/A== 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=U+vFOwAcwR/neOv/XJ2p7mGdv+Q8FIEXyKb0RanDEIU=; fh=JkBcMePOSeETsneULyp5vPcxQosY2mMOfbc94iuv0Ec=; b=pY4RJeg+/tza7hTK38gsEzRf+E8eptH/7prRBOfBFRAS3OtH0rDgahdywxxB9tiUGO LsWMWfpM0/QmiUhm+9WJoapO/2l9mHfpWFpzQ2EOBq7ZYXTtAGYZ7JbT4mrZIiAR2xHV tNO8YawdD+qJ7STQLvS9+2P79s/hhZKed/04H76ZdYPI4qnQtCdlxWIuTSZqBrVORttk flVzmI3uHkfI92qcavXUBPaY7j+yAR55fDhoasdWIM/x/iG/wteZV+oZxRK6FoQ+xFN3 peicx2egmxw7SgZzTFwS01l9V6aGpMZIgkgS5Otn708x/9wr+TaWy7En1r38HLGt1v0y IfKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kA0hMDiV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k11-20020aa788cb000000b006ea8148913esi11658061pff.338.2024.04.02.04.41.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kA0hMDiV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5746-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 48F3E28565A for ; Tue, 2 Apr 2024 11:41:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D4F56519D; Tue, 2 Apr 2024 11:41:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kA0hMDiV" 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 575FB2032C for ; Tue, 2 Apr 2024 11:41:16 +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=1712058076; cv=none; b=sjoluAS9R8cgO3C/YBbFUTic3gqJFrqgKs2XYxAq9fwVGcIAczFipAGz5cacdxX3zingZSjVpQVmJMPUrap0rizz/rLh4710PXSk1vaVI+/YwPAuDUEl46BvP8LVU9xZqGyZXA/b+oXg1VH06/TeUCvO/1rUpjW044xQQAxoK+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058076; c=relaxed/simple; bh=gh7Mg3Bq5Y1lBfZpQfzEG8doAdI5MVslWxum7KRfW1Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=iWED0YJnYgYuYa+0Ff0Aew7G6XBZ+B+QcnheBZSYf4aN/Xx/TnmogG4j9VqYk6xsI7bBIgaGXSKzOPuAgMGmHCtwOWlwAP24DAtHoFuyn2AYQtmc7KiFJ5+1bQAX/MJFwbDnZ9/UiAkjqBoF0gi58jbR9HjdHlgyJ8y2xYhJaso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kA0hMDiV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E90A2C433C7; Tue, 2 Apr 2024 11:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712058076; bh=gh7Mg3Bq5Y1lBfZpQfzEG8doAdI5MVslWxum7KRfW1Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kA0hMDiVBdhvyaif04T762uzBHERyKSunf48ukdhDnMD1mQ7QYZ4W3Fwiv/ac47mU RwoqVjYqYUMY+gZDmF3qVPGqf2OpsA8PicG4eN2f2c1zUGis9SzWiy8TgE+M/PRBEX ubWfM4/5qx8Ge6Y4mOHKPG+Dpnprg4prdUvzQT/KWHjqiQ8cAPp632oHt+F20YojOQ nrUh+1bDgPGGOcwXSFQXKwpPopUlcY5ktAUPYvkulkim/jTw6XhStpEf/fEmMxsxDA GYusqqYrwNc/aGt5X+zFWOuXZThrTSB4tcJ7AKc63lfiZ6s34cY1mXF6lGfNuZBovq jhdyURQrljZYQ== From: Kalle Valo To: Jeff Johnson Cc: Pradeep Kumar Chitrapu , , , Muna Sinada Subject: Re: [PATCH v2 07/10] wifi: ath12k: add support for setting fixed HE rate/GI/LTF References: <20240327170910.23975-1-quic_pradeepc@quicinc.com> <20240327170910.23975-8-quic_pradeepc@quicinc.com> Date: Tue, 02 Apr 2024 14:41:12 +0300 In-Reply-To: (Jeff Johnson's message of "Fri, 29 Mar 2024 14:34:41 -0700") Message-ID: <875xx06lgn.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 Jeff Johnson 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 >> Signed-off-by: Muna Sinada >> Signed-off-by: Pradeep Kumar Chitrapu >> --- >> 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