mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] wifi: ath: simplify copying a peer's PPE thresholds
@ 2026-11-06 18:48 Christopher Griffin via B4 Relay
  2026-11-06 18:48 ` [PATCH 1/2] wifi: ath11k: " Christopher Griffin via B4 Relay
  2026-11-06 18:48 ` [PATCH 2/2] wifi: ath12k: " Christopher Griffin via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Christopher Griffin via B4 Relay @ 2026-11-06 18:48 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Rameshkumar Sundaram, Baochen Qiang, linux-wireless, ath11k,
	ath12k, linux-kernel, Jeff Johnson, Christopher Griffin

Rameshkumar suggested this while reviewing the PPE threshold bit-order
fix [1]: the loop that copies a peer's PPE thresholds into the WMI
layout shifts each bit in from the top, where it can put it in place.
ath11k and ath12k carry the same loop, so one patch each. No functional
change; the patches don't depend on the bit-order series.

The patches, this letter and the equivalence test were written with
Claude, an AI coding assistant.

[1] https://lore.kernel.org/all/b60c4c56-483b-406e-92ab-643b0fdf2dc8@oss.qualcomm.com/

---
Christopher Griffin (2):
      wifi: ath11k: simplify copying a peer's PPE thresholds
      wifi: ath12k: simplify copying a peer's PPE thresholds

 drivers/net/wireless/ath/ath11k/mac.c | 3 +--
 drivers/net/wireless/ath/ath12k/mac.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
---
base-commit: 5c8eab13e391aaabd5a1ad58f3ee4bb10ce7573e
change-id: 20261106-ath-peer-ppe-thres-loop-ce5c2b2e68e1

Best regards,
--  
Christopher Griffin <christophergriffin05@gmail.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] wifi: ath11k: simplify copying a peer's PPE thresholds
  2026-11-06 18:48 [PATCH 0/2] wifi: ath: simplify copying a peer's PPE thresholds Christopher Griffin via B4 Relay
@ 2026-11-06 18:48 ` Christopher Griffin via B4 Relay
  2026-11-06 18:48 ` [PATCH 2/2] wifi: ath12k: " Christopher Griffin via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Griffin via B4 Relay @ 2026-11-06 18:48 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Rameshkumar Sundaram, Baochen Qiang, linux-wireless, ath11k,
	ath12k, linux-kernel, Jeff Johnson, Christopher Griffin

From: Christopher Griffin <christophergriffin05@gmail.com>

ath11k_peer_assoc_h_he() copies each 6-bit PPE threshold of a peer's HE
capabilities into the WMI layout one bit at a time, shifting it in from
the top: val >>= 1, then the new bit at bit 5, six times over. After the
sixth bit, bit i of the field sits at bit i of val, so put it there
directly.

No functional change: a userspace copy of both loops gives the same
ppet16_ppet8_ru3_ru0 for every 6-bit value in every RU slot and for 2.5
million random threshold fields. Compile-tested with W=1.

The change, this message and the test were written with Claude, an AI
coding assistant.

Suggested-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://lore.kernel.org/all/b60c4c56-483b-406e-92ab-643b0fdf2dc8@oss.qualcomm.com/
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 1a237adaa37d1..d7ae9e8747233 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -2496,9 +2496,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
 				if ((arg->peer_ppet.ru_bit_mask & BIT(ru)) == 0)
 					continue;
 				for (i = 0; i < 6; i++) {
-					val >>= 1;
 					val |= ((he_cap->ppe_thres[bit / 8] >>
-						 (bit % 8)) & 0x1) << 5;
+						 (bit % 8)) & 0x1) << i;
 					bit++;
 				}
 				arg->peer_ppet.ppet16_ppet8_ru3_ru0[nss] |=

-- 
2.43.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] wifi: ath12k: simplify copying a peer's PPE thresholds
  2026-11-06 18:48 [PATCH 0/2] wifi: ath: simplify copying a peer's PPE thresholds Christopher Griffin via B4 Relay
  2026-11-06 18:48 ` [PATCH 1/2] wifi: ath11k: " Christopher Griffin via B4 Relay
@ 2026-11-06 18:48 ` Christopher Griffin via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Griffin via B4 Relay @ 2026-11-06 18:48 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Rameshkumar Sundaram, Baochen Qiang, linux-wireless, ath11k,
	ath12k, linux-kernel, Jeff Johnson, Christopher Griffin

From: Christopher Griffin <christophergriffin05@gmail.com>

ath12k_peer_assoc_h_he() copies each 6-bit PPE threshold of a peer's HE
capabilities into the WMI layout one bit at a time, shifting it in from
the top: val >>= 1, then the new bit at bit 5, six times over. After the
sixth bit, bit i of the field sits at bit i of val, so put it there
directly.

No functional change: a userspace copy of both loops gives the same
ppet16_ppet8_ru3_ru0 for every 6-bit value in every RU slot and for 2.5
million random threshold fields. Compile-tested with W=1.

The change, this message and the test were written with Claude, an AI
coding assistant.

Suggested-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://lore.kernel.org/all/b60c4c56-483b-406e-92ab-643b0fdf2dc8@oss.qualcomm.com/
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 9fd3841f71b71..12dfac1d3b42c 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2731,9 +2731,8 @@ static void ath12k_peer_assoc_h_he(struct ath12k *ar,
 				if ((arg->peer_ppet.ru_bit_mask & BIT(ru)) == 0)
 					continue;
 				for (i = 0; i < 6; i++) {
-					val >>= 1;
 					val |= ((he_cap->ppe_thres[bit / 8] >>
-						 (bit % 8)) & 0x1) << 5;
+						 (bit % 8)) & 0x1) << i;
 					bit++;
 				}
 				arg->peer_ppet.ppet16_ppet8_ru3_ru0[nss] |=

-- 
2.43.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-06 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 18:48 [PATCH 0/2] wifi: ath: simplify copying a peer's PPE thresholds Christopher Griffin via B4 Relay
2026-11-06 18:48 ` [PATCH 1/2] wifi: ath11k: " Christopher Griffin via B4 Relay
2026-11-06 18:48 ` [PATCH 2/2] wifi: ath12k: " Christopher Griffin via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®