From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH mt76 06/15] wifi: mt76: mt7996: do not attach hif2 WED when the main WED attach failed
Date: Mon, 27 Jul 2026 15:04:25 +0000 [thread overview]
Message-ID: <20260727150434.1778520-6-nbd@nbd.name> (raw)
In-Reply-To: <20260727150434.1778520-1-nbd@nbd.name>
If the WED attach for the primary PCIe function fails, the probe path
still attached wed_hif2 for the secondary function, leaving the device
in an inconsistent half-WED configuration that crashes later. The hif2
call also re-enabled hwrro_mode, which the failed primary attach had
just turned off.
Skip the hif2 WED setup when the primary WED device is not active.
Fixes: 83eafc9251d6 ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
index 0d7521d06981..ba064324a7cc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
@@ -490,6 +490,9 @@ int mt7996_mmio_wed_init(struct mt7996_dev *dev, void *pdev_ptr,
if (!wed_enable)
return 0;
+ if (hif2 && !mtk_wed_device_active(&dev->mt76.mmio.wed))
+ return 0;
+
dev->mt76.hwrro_mode = is_mt7996(&dev->mt76) ? MT76_HWRRO_V3
: MT76_HWRRO_V3_1;
--
2.53.0
next prev parent reply other threads:[~2026-07-27 15:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 15:04 [PATCH mt76 01/15] wifi: mt76: mt7996: fix MIB TX aggregation counter registers for mt7990 Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 02/15] wifi: mt76: mt7915: fix double hif2 init on the non-WED path Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 03/15] wifi: mt76: mt7915: fix ext PHY use-after-free on register error path Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 04/15] wifi: mt76: mt7915: release hif2 reference on probe IRQ failure Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 05/15] wifi: mt76: mt7996: fix reg addr remap when addr is 0 Felix Fietkau
2026-07-27 15:04 ` Felix Fietkau [this message]
2026-07-27 15:04 ` [PATCH mt76 07/15] wifi: mt76: mt7996: do not leave state behind after a failed WED attach Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 08/15] wifi: mt76: mt7915: fix chainmask handling for non-dbdc phys on band 1 Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 09/15] wifi: mt76: mt7915: report RX chain signal for all RX paths Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 10/15] wifi: mt76: mt7996: remove repeater muar config Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 11/15] wifi: mt76: fix queue assignment for disassoc packets Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 12/15] wifi: mt76: mt7996: reject iTWT setup requests from MLD stations Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 13/15] wifi: mt76: mt7915: update SKU power limits after changing antennas Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 14/15] wifi: mt76: mt7996: add scan dwell time hw cap Felix Fietkau
2026-07-27 15:04 ` [PATCH mt76 15/15] wifi: mt76: mt7925: fix infinite loop in UNI event TLV parsing Felix Fietkau
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=20260727150434.1778520-6-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=linux-wireless@vger.kernel.org \
/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