Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: ath9k_htc: fix the byte count of a full RMW buffer flush
@ 2026-08-28 16:14 Nerijus Bendžiūnas
  0 siblings, 0 replies; only message in thread
From: Nerijus Bendžiūnas @ 2026-08-28 16:14 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, linux-wireless
  Cc: Kalle Valo, Oleksij Rempel, linux-kernel

ath9k_reg_rmw_buffer() sizes the WMI command with struct register_write
when it sends a buffer that has filled up, but the buffer holds struct
register_rmw entries, which are 12 bytes rather than 8. The firmware is
handed 120 bytes instead of 180 and applies only the first ten of the
fifteen queued read-modify-writes, silently dropping the rest.
ath9k_reg_rmw_flush() right below it already uses the correct type.

No caller is known to queue the full fifteen entries today, the closest
being ath9k_hw_4k_set_gain() at fourteen, so this is a latent bug rather
than an observed failure.

Fixes: 8badb50cfab6 ("ath9k_htc: add new WMI_REG_RMW_CMDID command")
Cc: stable@vger.kernel.org
Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 6de78ae85726..0b49d2cc99f0 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -405,7 +405,7 @@ static void ath9k_reg_rmw_buffer(void *hw_priv,
 	if (priv->wmi->multi_rmw_idx == MAX_RMW_CMD_NUMBER) {
 		r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID,
 			  (u8 *) &priv->wmi->multi_rmw,
-			  sizeof(struct register_write) * priv->wmi->multi_rmw_idx,
+			  sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx,
 			  (u8 *) &rsp_status, sizeof(rsp_status),
 			  100);
 		if (unlikely(r)) {
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-28 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 16:14 [PATCH] wifi: ath9k_htc: fix the byte count of a full RMW buffer flush Nerijus Bendžiūnas

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