public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucid Duck <lucid_duck@justthetip.ca>
To: nbd@nbd.name
Cc: lorenzo@kernel.org, linux-wireless@vger.kernel.org,
	Lucid Duck <lucid_duck@justthetip.ca>
Subject: Re: [PATCH v2] wifi: mt76: mt7921: fix txpower reporting
Date: Fri, 30 Jan 2026 13:58:39 -0800	[thread overview]
Message-ID: <20260130215839.53270-1-lucid_duck@justthetip.ca> (raw)
In-Reply-To: <20260125222235.36565-1-lucid_duck@justthetip.ca>

On Tue, 27 Jan 2026, Felix Fietkau wrote:
> phy->hw->conf.power_level is the user configured power level, not what
> the hardware is capable of transmitting.
>
> To fix it properly, I think you should determine the maximum rate power
> used in the loop within mt76_connac_mcu_rate_txpower_band (updated with
> each call).

Thanks for the feedback, Felix.

I looked into tracking the max rate power in mt76_connac_mcu_rate_txpower_band()
as you suggested. However, I found that this function is only called from
mt7921_set_sar_specs() during SAR configuration changes - it's not in the
normal connection code path when a user associates with an AP.

As an alternative, this patch updates txpower_cur in mt7921_bss_info_changed()
when BSS_CHANGED_TXPOWER is set. It uses info->txpower from bss_conf as the
primary source, with a fallback to chan->max_reg_power for cases where
bss_conf.txpower isn't populated (which can happen on newer kernels).

If I've misunderstood your suggestion or there's a better approach, I'd be
happy to revise.

Background:

I originally started debugging this driver because hcxdumptool was
crashing repeatedly on my new Alfa AWUS036AXML adapter. The crashes
appeared related to the bogus txpower values being reported (3 dBm or
67 dBm). After applying this patch, hcxdumptool runs without crashing
and txpower values are reported correctly.

Test Results:

Tested on Alfa AWUS036AXML (MT7921AU), kernel 6.18.6:

  Test            Expected    Actual      Status
  --------------  ----------  ----------  ------
  2.4GHz ch1      ~33 dBm     33.00 dBm   PASS
  5GHz ch100      ~27 dBm     27.00 dBm   PASS
  6GHz ch5        ~15 dBm     15.00 dBm   PASS
  Band switching  Updates     Correct     PASS
  Consistency     Stable      5/5         PASS
  hcxdumptool     No crash    8927 pkts   PASS

Regulatory baseline (Canada):
- 2.4GHz: 30 dBm limit + 3 dBm path delta = 33 dBm reported
- 5GHz DFS: 24 dBm limit + 3 dBm path delta = 27 dBm reported
- 6GHz: 12 dBm limit + 3 dBm path delta = 15 dBm reported

Before patch:
  $ iw dev wlan0 info | grep txpower
          txpower 3.00 dBm    # bogus value

After patch:
  $ iw dev wlan0 info | grep txpower
          txpower 33.00 dBm   # matches regulatory limit

Lucid

      parent reply	other threads:[~2026-01-30 22:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-25 22:22 [PATCH] wifi: mt76: connac: fix txpower_cur not being updated Lucid Duck
2026-01-27  1:59 ` Nick
2026-01-27 12:21 ` Felix Fietkau
2026-01-27 16:17   ` Bitterblue Smith
2026-01-27 17:00     ` Felix Fietkau
2026-01-30 21:54 ` [PATCH v2] wifi: mt76: mt7921: fix txpower reporting Lucid Duck
2026-02-10  3:02   ` Nick
2026-02-12  2:46     ` Lucid Duck
2026-03-09 21:50   ` Lucid Duck
2026-03-12  6:38     ` Sean Wang
2026-03-17 17:30       ` [PATCH v3 0/1] wifi: mt76: mt7921: fix txpower reporting from rate power configuration Lucid Duck
2026-03-17 17:30         ` [PATCH v3 1/1] " Lucid Duck
2026-03-17 21:51           ` Lucid Duck
2026-03-19  6:00           ` Sean Wang
2026-03-19 20:38             ` [PATCH v4] " Lucid Duck
2026-03-20  1:17               ` Lucid Duck
2026-03-20  6:34                 ` Greg KH
2026-03-21  8:58               ` Sean Wang
2026-01-30 21:58 ` Lucid Duck [this message]

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=20260130215839.53270-1-lucid_duck@justthetip.ca \
    --to=lucid_duck@justthetip.ca \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /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