Lorenzo Bianconi and Felix Fietkau
8d5c456be1
mt76: move token utilities in mt76 common module
...
Move token management in mt76 common module since it is shared between
mt7615, mt7915 and mt7921 drivers
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-04-21 14:30:19 +02:00
Sean Wang and Felix Fietkau
3c19f569cc
mt76: mt7921: fix possible invalid register access
...
Disable the interrupt and synchronze for the pending irq handlers to ensure
the irq tasklet is not being scheduled after the suspend to avoid the
possible invalid register access acts when the host pcie controller is
suspended.
[17932.910534] mt7921e 0000:01:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 21375 usecs
[17932.910590] pcieport 0000:00:00.0: calling pci_pm_suspend+0x0/0x22c @ 18565, parent: pci0000:00
[17932.910602] pcieport 0000:00:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 8 usecs
[17932.910671] mtk-pcie 11230000.pcie: calling platform_pm_suspend+0x0/0x60 @ 22783, parent: soc
[17932.910674] mtk-pcie 11230000.pcie: platform_pm_suspend+0x0/0x60 returned 0 after 0 usecs
...
17933.615352] x1 : 00000000000d4200 x0 : ffffff8269ca2300
[17933.620666] Call trace:
[17933.623127] mt76_mmio_rr+0x28/0xf0 [mt76]
[17933.627234] mt7921_rr+0x38/0x44 [mt7921e]
[17933.631339] mt7921_irq_tasklet+0x54/0x1d8 [mt7921e]
[17933.636309] tasklet_action_common+0x12c/0x16c
[17933.640754] tasklet_action+0x24/0x2c
[17933.644418] __do_softirq+0x16c/0x344
[17933.648082] irq_exit+0xa8/0xac
[17933.651224] scheduler_ipi+0xd4/0x148
[17933.654890] handle_IPI+0x164/0x2d4
[17933.658379] gic_handle_irq+0x140/0x178
[17933.662216] el1_irq+0xb8/0x180
[17933.665361] cpuidle_enter_state+0xf8/0x204
[17933.669544] cpuidle_enter+0x38/0x4c
[17933.673122] do_idle+0x1a4/0x2a8
[17933.676352] cpu_startup_entry+0x24/0x28
[17933.680276] rest_init+0xd4/0xe0
[17933.683508] arch_call_rest_init+0x10/0x18
[17933.687606] start_kernel+0x340/0x3b4
[17933.691279] Code: aa0003f5 d503201f f953eaa8 8b344108 (b9400113)
[17933.697373] ---[ end trace a24b8e26ffbda3c5 ]---
[17933.767846] Kernel panic - not syncing: Fatal exception in interrupt
Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-04-21 14:30:19 +02:00
Sean Wang and Felix Fietkau
0dbb16ef39
mt76: mt7921: enable deep sleep when the device suspends
...
Enable the deep sleep mode in suspend handler to reduce the power
consumption further.
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-04-21 14:30:19 +02:00
Lorenzo Bianconi and Felix Fietkau
45e0eefffe
mt76: mt7921: enable sw interrupts
...
Enable sw interrupts in order to wake the device from deep sleep
receiving packets
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-04-21 13:49:02 +02:00
Sean Wang and Felix Fietkau
54f52771a0
mt76: mt7921: fix kernel crash when the firmware fails to download
...
Fix kernel crash when the firmware is missing or fails to download.
[ 9.444758] kernel BUG at drivers/pci/msi.c:375!
[ 9.449363] Internal error: Oops - BUG: 0 [#1 ] PREEMPT SMP
[ 9.501033] pstate: a0400009 (NzCv daif +PAN -UAO)
[ 9.505814] pc : free_msi_irqs+0x180/0x184
[ 9.509897] lr : free_msi_irqs+0x40/0x184
[ 9.513893] sp : ffffffc015193870
[ 9.517194] x29: ffffffc015193870 x28: 00000000f0e94fa2
[ 9.522492] x27: 0000000000000acd x26: 000000000000009a
[ 9.527790] x25: ffffffc0152cee58 x24: ffffffdbb383e0d8
[ 9.533087] x23: ffffffdbb38628d0 x22: 0000000000040200
[ 9.538384] x21: ffffff8cf7de7318 x20: ffffff8cd65a2480
[ 9.543681] x19: ffffff8cf7de7000 x18: 0000000000000000
[ 9.548979] x17: ffffff8cf9ca03b4 x16: ffffffdc13ad9a34
[ 9.554277] x15: 0000000000000000 x14: 0000000000080800
[ 9.559575] x13: ffffff8cd65a2980 x12: 0000000000000000
[ 9.564873] x11: ffffff8cfa45d820 x10: ffffff8cfa45d6d0
[ 9.570171] x9 : 0000000000000040 x8 : ffffff8ccef1b780
[ 9.575469] x7 : aaaaaaaaaaaaaaaa x6 : 0000000000000000
[ 9.580766] x5 : ffffffdc13824900 x4 : ffffff8ccefe0000
[ 9.586063] x3 : 0000000000000000 x2 : 0000000000000000
[ 9.591362] x1 : 0000000000000125 x0 : ffffff8ccefe0000
[ 9.596660] Call trace:
[ 9.599095] free_msi_irqs+0x180/0x184
[ 9.602831] pci_disable_msi+0x100/0x130
[ 9.606740] pci_free_irq_vectors+0x24/0x30
[ 9.610915] mt7921_pci_probe+0xbc/0x250 [mt7921e]
[ 9.615693] pci_device_probe+0xd4/0x14c
[ 9.619604] really_probe+0x134/0x2ec
[ 9.623252] driver_probe_device+0x64/0xfc
[ 9.627335] device_driver_attach+0x4c/0x6c
[ 9.631506] __driver_attach+0xac/0xc0
[ 9.635243] bus_for_each_dev+0x8c/0xd4
[ 9.639066] driver_attach+0x2c/0x38
[ 9.642628] bus_add_driver+0xfc/0x1d0
[ 9.646365] driver_register+0x64/0xf8
[ 9.650101] __pci_register_driver+0x6c/0x7c
[ 9.654360] init_module+0x28/0xfdc [mt7921e]
[ 9.658704] do_one_initcall+0x13c/0x2d0
[ 9.662615] do_init_module+0x58/0x1e8
[ 9.666351] load_module+0xd80/0xeb4
[ 9.669912] __arm64_sys_finit_module+0xa8/0xe0
[ 9.674430] el0_svc_common+0xa4/0x16c
[ 9.678168] el0_svc_compat_handler+0x2c/0x40
[ 9.682511] el0_svc_compat+0x8/0x10
[ 9.686076] Code: a94257f6 f9400bf7 a8c47bfd d65f03c0 (d4210000)
[ 9.692155] ---[ end trace 7621f966afbf0a29 ]---
[ 9.697385] Kernel panic - not syncing: Fatal exception
[ 9.702599] SMP: stopping secondary CPUs
[ 9.706549] Kernel Offset: 0x1c03600000 from 0xffffffc010000000
[ 9.712456] PHYS_OFFSET: 0xfffffff440000000
[ 9.716625] CPU features: 0x080026,2a80aa18
[ 9.720795] Memory Limit: none
Fixes: 5c14a5f944b (""mt76: mt7921: introduce mt7921e support)
Reported-by: Claire Chang <[email protected] >
Co-developed-by: YN Chen <[email protected] >
Signed-off-by: YN Chen <[email protected] >
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-04-07 10:55:33 +02:00
Lorenzo Bianconi and Felix Fietkau
be1ab3b9ae
mt76: mt7921: fix typo in mt7921_pci_resume
...
Return proper error code from mt7921_mcu_drv_pmctrl in mt7921_pci_resume
routine.
Fixes: 8db9c79f230d6 ("mt76: mt7921: fix suspend/resume sequence")
Signed-off-by: Lorenzo Bianconi <[email protected] >
2021-04-01 21:27:47 +02:00
Sean Wang and Felix Fietkau
fd2a51ea9d
mt76: mt7921: fix the base of PCIe interrupt
...
Should use 0x10000 as the base to operate PCIe interrupt according
to the vendor reference driver.
Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Co-developed-by: YN Chen <[email protected] >
Signed-off-by: YN Chen <[email protected] >
Signed-off-by: Sean Wang <[email protected] >
Tested-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-03-14 23:38:18 +01:00
Sean Wang and Felix Fietkau
8a2e22fcbf
mt76: mt7921: fix suspend/resume sequence
...
Any pcie access should happen in pci D0 state and we should give ownership
back to the device at the end of the suspend procedure.
Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-03-12 13:27:33 +01:00
Ryder Lee and Felix Fietkau
c7d98fc358
mt76: use PCI_VENDOR_ID_MEDIATEK to avoid open coded
...
Use PCI standard defines.
Signed-off-by: Ryder Lee <[email protected] >
Acked-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-02-14 11:34:10 +01:00
Lorenzo Bianconi and Felix Fietkau
0d95c6ad17
mt76: mt7921: enable MSI interrupts
...
Enable MSI interrupts for mt7921 driver
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00
Sean Wang and Felix Fietkau
f8d1ec5e6e
mt76: mt7921: introduce Runtime PM support
...
Introduce runtime PM to mt7921 driver
Co-developed-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00
Lorenzo Bianconi and Felix Fietkau
1ccf6a9c60
mt76: mt7921: rely on mt76_connac_mcu module for suspend and WoW support
...
Rely on mt76_connac_mcu module for suspend and WoW support and remove
duplicated code
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00
Lorenzo Bianconi and Felix Fietkau
2beb9c9530
mt76: mt7921: rely on mt76_connac_mcu common library
...
Rely on mt76_connac_mcu common library and remove duplicated code
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00
Sean Wang and Felix Fietkau
71f9f09ee9
mt76: mt7921: introduce PM support
...
Introduce suspend/resume and WoW (Wake-on-WoWLAN) support to mt7921
driver to allow remote wakeu-up from the suspend state.
Co-developed-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Co-developed-by: Soul Huang <[email protected] >
Signed-off-by: Soul Huang <[email protected] >
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00
Sean Wang and Felix Fietkau
39d6f4851b
mt76: mt7921: introduce mt7921e support
...
Introduce support for mt7921e 802.11ax (Wi-Fi 6) 2x2:2SS chipset.
Co-developed-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Co-developed-by: Soul Huang <[email protected] >
Signed-off-by: Soul Huang <[email protected] >
Signed-off-by: Sean Wang <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2021-01-29 18:18:44 +01:00