mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Michael Pfeifroth <micpf@westermo.com>,
	Jeff Johnson <jjohnson@kernel.org>, Kalle Valo <kvalo@kernel.org>
Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: ath12k: fix chain-mask shift on 64-bit big-endian
Date: Thu, 17 Sep 2026 11:07:51 +0800	[thread overview]
Message-ID: <670a6d6d-2d95-41b2-b64a-997a39d4f320@oss.qualcomm.com> (raw)
In-Reply-To: <aqqoAVbsVu574FwT@mpf-ESPRIMO-P9012>



On 9/16/2026 10:30 PM, Michael Pfeifroth wrote:
> ath12k_pull_mac_phy_cap_svc_ready_ext() derives the tx/rx chain-mask shift
> with find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32).
> 
> pdev_cap->{tx,rx}_chain_mask are u32, but find_first_bit() treats the
> pointer as an array of unsigned long. On 64-bit big-endian, unsigned long
> is 8 bytes, so the u32 value ends up in the high 32 bits of the word while
> find_first_bit(..., 32) only scans the low 32 bits, i.e. the adjacent
> struct member. rx_chain_mask_shift is therefore computed as 32,
> ath12k_mac_setup_ht_vht_cap() evaluates cfg_rx_chainmask >> 32 == 0, and
> the driver advertises a VHT RX-MCS map with all streams "not supported".
> mac80211 then rejects the VHT capability ("Ignoring VHT IE ... due to
> invalid rx_mcs_map"), so the link only comes up as HT40 and never
> negotiates 80/160 MHz. tx_chain_mask_shift happens to scan a zero word and
> stays 0, so only the RX side is affected.
> 
> Use __ffs() on the mask value instead of pointing find_first_bit() at the
> u32's storage. __ffs() takes its argument by value, so the shift is
> computed correctly regardless of word size or endianness. The chain masks
> are always non-zero here, so __ffs() is well defined.
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Cc: stable@vger.kernel.org
> Signed-off-by: Michael Pfeifroth <micpf@westermo.com>

ath11k has the same issue, interested to fix it as well?

anyway:

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>



      reply	other threads:[~2026-09-17  3:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 14:30 Michael Pfeifroth
2026-09-17  3:07 ` Baochen Qiang [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=670a6d6d-2d95-41b2-b64a-997a39d4f320@oss.qualcomm.com \
    --to=baochen.qiang@oss.qualcomm.com \
    --cc=ath12k@lists.infradead.org \
    --cc=jjohnson@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=micpf@westermo.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

all inboxes | Powered by JetHome®