FAILED: patch "[PATCH] wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling" failed to apply to 7.0-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 7.0-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.0.y
git checkout FETCH_HEAD
git cherry-pick -x 56154fef47d104effa9f29ed3db4f805cbc0d640
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026043040-tissue-nuptials-8136@gregkh' --subject-prefix 'PATCH 7.0.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 56154fef47d104effa9f29ed3db4f805cbc0d640 Mon Sep 17 00:00:00 2001
From: Sean Wang <[email protected]>
Date: Tue, 10 Mar 2026 19:28:25 -0500
Subject: [PATCH] wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling
mt7925u uses different reset/status registers from mt7921u. Reusing the mt7921u register set causes the WFSYS reset to fail.
Add a chip-specific descriptor in mt792xu_wfsys_reset() to select the correct registers and fix mt7925u failing to initialize after a warm reboot.
drivers/net/wireless/mediatek/mt76/mt792x_regs.h +4 -0
@@ -392,6 +392,10 @@#define MT_CBTOP_RGU_WF_SUBSYS_RST MT_CBTOP_RGU(0x600)#define MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH BIT(0) +#define MT7925_CBTOP_RGU_WF_SUBSYS_RST 0x70028600 +#define MT7925_WFSYS_INIT_DONE_ADDR 0x184c1604 +#define MT7925_WFSYS_INIT_DONE 0x00001d1e +#define MT_HW_BOUND 0x70010020#define MT_HW_CHIPID 0x70010200#define MT_HW_REV 0x70010204
drivers/net/wireless/mediatek/mt76/mt792x_usb.c +12 -1
@@ -224,6 +224,15 @@ static const struct mt792xu_wfsys_desc mt7921_wfsys_desc = { .need_status_sel = true, }; +static const struct mt792xu_wfsys_desc mt7925_wfsys_desc = { + .rst_reg =MT7925_CBTOP_RGU_WF_SUBSYS_RST , + .done_reg =MT7925_WFSYS_INIT_DONE_ADDR , + .done_mask =U32_MAX , + .done_val =MT7925_WFSYS_INIT_DONE , + .delay_ms =20 , + .need_status_sel = false, +}; +int mt792xu_dma_init (struct mt792x_dev *dev,bool resume) {int err;
@@ -254,7 +263,9 @@ EXPORT_SYMBOL_GPL(mt792xu_dma_init);int mt792xu_wfsys_reset (struct mt792x_dev *dev) { -const struct mt792xu_wfsys_desc *desc = &mt7921_wfsys_desc; +const struct mt792xu_wfsys_desc *desc =is_mt7925 (&dev->mt76) ? + &mt7925_wfsys_desc : + &mt7921_wfsys_desc;u32 val;int i;
Sasha Levin
maintainerPATCH 1/2 wifi: mt76: mt792x: describe USB WFSYS reset with a descriptor
From: Sean Wang <[email protected]>
[ Upstream commit e6f48512c1ceebcd1ce6bb83df3b3d56a261507d ]
Prepare mt792xu_wfsys_reset() for chips that share the same USB WFSYS reset flow but use different register definitions.
This is a pure refactor of the current mt7921u path and keeps the reset sequence unchanged.
Stable-dep-of: 56154fef47d1 ("wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling")
--- .../net/wireless/mediatek/mt76/mt792x_usb.c | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-)
drivers/net/wireless/mediatek/mt76/mt792x_usb.c +32 -8
@@ -206,6 +206,24 @@ static void mt792xu_epctl_rst_opt(struct mt792x_dev *dev, bool reset)mt792xu_uhw_wr (&dev->mt76,MT_SSUSB_EPCTL_CSR_EP_RST_OPT , val); } +struct mt792xu_wfsys_desc { +u32 rst_reg; +u32 done_reg; +u32 done_mask; +u32 done_val; +u32 delay_ms; +bool need_status_sel; +}; + +static const struct mt792xu_wfsys_desc mt7921_wfsys_desc = { + .rst_reg =MT_CBTOP_RGU_WF_SUBSYS_RST , + .done_reg =MT_UDMA_CONN_INFRA_STATUS , + .done_mask =MT_UDMA_CONN_WFSYS_INIT_DONE , + .done_val =MT_UDMA_CONN_WFSYS_INIT_DONE , + .delay_ms =0 , + .need_status_sel = true, +}; +int mt792xu_dma_init (struct mt792x_dev *dev,bool resume) {int err;
@@ -236,25 +254,31 @@ EXPORT_SYMBOL_GPL(mt792xu_dma_init);int mt792xu_wfsys_reset (struct mt792x_dev *dev) { +const struct mt792xu_wfsys_desc *desc = &mt7921_wfsys_desc;u32 val;int i;mt792xu_epctl_rst_opt (dev, false); - val =mt792xu_uhw_rr (&dev->mt76,MT_CBTOP_RGU_WF_SUBSYS_RST ); + val =mt792xu_uhw_rr (&dev->mt76, desc->rst_reg); val |=MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH ; -mt792xu_uhw_wr (&dev->mt76,MT_CBTOP_RGU_WF_SUBSYS_RST , val); +mt792xu_uhw_wr (&dev->mt76, desc->rst_reg, val); -usleep_range (10 ,20 ); +if (desc->delay_ms) +msleep (desc->delay_ms); +else +usleep_range (10 ,20 ); - val =mt792xu_uhw_rr (&dev->mt76,MT_CBTOP_RGU_WF_SUBSYS_RST ); + val =mt792xu_uhw_rr (&dev->mt76, desc->rst_reg); val &= ~MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH ; -mt792xu_uhw_wr (&dev->mt76,MT_CBTOP_RGU_WF_SUBSYS_RST , val); +mt792xu_uhw_wr (&dev->mt76, desc->rst_reg, val); + +if (desc->need_status_sel) +mt792xu_uhw_wr (&dev->mt76,MT_UDMA_CONN_INFRA_STATUS_SEL ,0 ); -mt792xu_uhw_wr (&dev->mt76,MT_UDMA_CONN_INFRA_STATUS_SEL ,0 );for (i =0 ; i < MT792x_WFSYS_INIT_RETRY_COUNT; i++) { - val =mt792xu_uhw_rr (&dev->mt76,MT_UDMA_CONN_INFRA_STATUS ); -if (val &MT_UDMA_CONN_WFSYS_INIT_DONE ) + val =mt792xu_uhw_rr (&dev->mt76, desc->done_reg); +if ((val & desc->done_mask) == desc->done_val)break ;msleep (100 );
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling
From: Sean Wang <[email protected]>
[ Upstream commit 56154fef47d104effa9f29ed3db4f805cbc0d640 ]
mt7925u uses different reset/status registers from mt7921u. Reusing the mt7921u register set causes the WFSYS reset to fail.
Add a chip-specific descriptor in mt792xu_wfsys_reset() to select the correct registers and fix mt7925u failing to initialize after a warm reboot.
--- drivers/net/wireless/mediatek/mt76/mt792x_regs.h | 4 ++++ drivers/net/wireless/mediatek/mt76/mt792x_usb.c | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt792x_regs.h +4 -0
@@ -390,6 +390,10 @@#define MT_CBTOP_RGU_WF_SUBSYS_RST MT_CBTOP_RGU(0x600)#define MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH BIT(0) +#define MT7925_CBTOP_RGU_WF_SUBSYS_RST 0x70028600 +#define MT7925_WFSYS_INIT_DONE_ADDR 0x184c1604 +#define MT7925_WFSYS_INIT_DONE 0x00001d1e +#define MT_HW_BOUND 0x70010020#define MT_HW_CHIPID 0x70010200#define MT_HW_REV 0x70010204
drivers/net/wireless/mediatek/mt76/mt792x_usb.c +12 -1
@@ -224,6 +224,15 @@ static const struct mt792xu_wfsys_desc mt7921_wfsys_desc = { .need_status_sel = true, }; +static const struct mt792xu_wfsys_desc mt7925_wfsys_desc = { + .rst_reg =MT7925_CBTOP_RGU_WF_SUBSYS_RST , + .done_reg =MT7925_WFSYS_INIT_DONE_ADDR , + .done_mask =U32_MAX , + .done_val =MT7925_WFSYS_INIT_DONE , + .delay_ms =20 , + .need_status_sel = false, +}; +int mt792xu_dma_init (struct mt792x_dev *dev,bool resume) {int err;
@@ -254,7 +263,9 @@ EXPORT_SYMBOL_GPL(mt792xu_dma_init);int mt792xu_wfsys_reset (struct mt792x_dev *dev) { -const struct mt792xu_wfsys_desc *desc = &mt7921_wfsys_desc; +const struct mt792xu_wfsys_desc *desc =is_mt7925 (&dev->mt76) ? + &mt7925_wfsys_desc : + &mt7921_wfsys_desc;u32 val;int i;
Signature · 1 line
2.53.0