qcn9274 hw2.0 in banana pi r64 - LTSSM read fail

Janusz Dziedzic janusz.dziedzic at gmail.com
Sun Jul 14 22:47:14 PDT 2024


śr., 31 sty 2024 o 18:08 Janusz Dziedzic <janusz.dziedzic at gmail.com> napisał(a):
>
> pon., 29 sty 2024 o 16:09 Janusz Dziedzic <janusz.dziedzic at gmail.com>
> napisał(a):
> >
> > pon., 29 sty 2024 o 14:04 Kalle Valo <kvalo at kernel.org> napisał(a):
> > >
> > > Janusz Dziedzic <janusz.dziedzic at gmail.com> writes:
> > >
> > > > I have this card in bpi-r64 board. Need to hash: ath12k_pci_enable_ltssm()
> > > > While board hang here (next board restart):
> > > >
> > > > val = ath12k_pci_read32(ab, PCIE_PCIE_PARF_LTSSM);
> > > >
> > > > Is it a 12k bug/MTK pci controller bug?
> > > > When hash it works correctly.
> > > >
> > > > root at OpenWrt:~# lspci -nn
> > > > 00:00.0 PCI bridge [0604]: MEDIATEK Corp. Device [14c3:3258]
> > > > 01:00.0 Network controller [0280]: Qualcomm Device [17cb:1109] (rev 01)
> > > > root at OpenWrt:~#
> > >
> > > Sorry, I'm not following you. What do you exactly mean with "hash it"?
> > >
> > Have to remove ath12k_pci_enable_ltssm() call.
> > In other case
> >
> > ioread32(ab->mem + window_start + PCIE_PCIE_PARF_LTSSM) hang the system.
> >
> > window_start was 0
> > PCIE_PCIE_PARF_LTSSM - 0x1e081b0
> > No idea why this ioread32() fail/hang on bpi-r64
> >
> > Did smth like this:
> > static void ath12k_pci_sw_reset(struct ath12k_base *ab, bool power_on)
> > {
> >         if (power_on) {
> >                 //ath12k_pci_enable_ltssm(ab);
> >                 ath12k_pci_clear_all_intrs(ab);
> >                 ath12k_pci_set_wlaon_pwr_ctrl(ab);
> >         }
> >
> > After that works correctly.
> >
> >
> > root at OpenWrt:~# dmesg |grep -e ath -e mhi
> > [  123.056248] ath12k_pci 0000:01:00.0: assign IRQ: got 0
> > [  123.061704] ath12k_pci 0000:01:00.0: BAR 0: assigned [mem
> > 0x20000000-0x201fffff 64bit]
> > [  123.069764] ath12k_pci 0000:01:00.0: enabling device (0000 -> 0002)
> > [  123.076103] ath12k_pci 0000:01:00.0: enabling bus mastering
> > [  123.089329] ath12k_pci 0000:01:00.0: MSI vectors: 1
> > [  123.094226] ath12k_pci 0000:01:00.0: Hardware name: qcn9274 hw2.0
> >
> >    < if ltssm - hang here>
> >
> > [  123.151406] mhi mhi0: Requested to power ON
> > [  123.155622] mhi mhi0: Power on setup success
> > [  123.300815] mhi mhi0: Wait for device to enter SBL or Mission mode
> > [  123.864188] ath12k_pci 0000:01:00.0: qmi dma allocation failed
> > (29360128 B type 1), will try later with small size
> > [  123.893962] ath12k_pci 0000:01:00.0: memory type 10 not supported
> > [  123.905655] ath12k_pci 0000:01:00.0: chip_id 0x0 chip_family 0xb
> > board_id 0xff soc_id 0x401a2200
> > [  123.914441] ath12k_pci 0000:01:00.0: fw_version 0x10098b57
> > fw_build_timestamp 2022-09-19 18:18 fw_build_id
> > QC_IMAGE_VERSION_STRING=WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1
> > [  125.997541] ath12k_pci 0000:01:00.0: leaving PCI ASPM disabled to
> > avoid MHI M2 problems
> > root at OpenWrt:~#
> >
>
> More logs:
> root at OpenWrt:~# insmod ./ath12k.ko debug_mask=0xffffffff
> [   60.936142] ath12k_pci 0000:01:00.0: assign IRQ: got 0
> [   60.941605] ath12k_pci 0000:01:00.0: BAR 0: assigned [mem
> 0x20000000-0x201fffff 64bit]
> [   60.949676] ath12k_pci 0000:01:00.0: enabling device (0000 -> 0002)
> [   60.955987] ath12k_pci 0000:01:00.0: enabling bus mastering
> [   60.961599] ath12k_pci 0000:01:00.0: boot pci_mem 0x00000000063f9f64
> [   60.967957] ath12k_pci 0000:01:00.0: pci probe 17cb:1109 17cb:1109
> [   60.974132] ath12k_pci 0000:01:00.0: ath12k_pci_read32 called with
> offset 0x1B00000
> [   60.981792] ath12k_pci 0000:01:00.0: ath12k_pci_read32 before
> ioread32() (window_start == WINDOW_START) offset 0x1B00000
> window_start 524
> 288
> [   60.994398] ath12k_pci 0000:01:00.0: pci tcsr_soc_hw_version major 2 minor 0
> [   61.001672] mtk-pcie 1a143000.pcie: msi#0 address_hi 0x0 address_lo
> 0x44e5d0c0
> [   61.009028] ath12k_pci 0000:01:00.0: request MSI one vector
> [   61.014594] ath12k_pci 0000:01:00.0: MSI vectors: 1
> [   61.019496] ath12k_pci 0000:01:00.0: msi base data is 0
> [   61.024714] ath12k_pci 0000:01:00.0: Hardware name: qcn9274 hw2.0
> [   61.030813] ath12k_pci 0000:01:00.0: Assign MSI to user: MHI,
> num_vectors: 3, user_base_data: 0, base_vector: 0
> [   61.040901] ath12k_pci 0000:01:00.0: Number of assigned MSI for MHI
> is 3, base vector is 0
> [   61.049700] ath12k_pci 0000:01:00.0: Assign MSI to user: CE,
> num_vectors: 1, user_base_data: 0, base_vector: 0
> [   61.059832] ath12k_pci 0000:01:00.0: Assign MSI to user: DP,
> num_vectors: 1, user_base_data: 0, base_vector: 0
> [   61.069873] ath12k_pci 0000:01:00.0: irq:155 group:0
> [   61.074841] ath12k_pci 0000:01:00.0: irq:155 group:1
> [   61.079811] ath12k_pci 0000:01:00.0: irq:155 group:2
> [   61.084771] ath12k_pci 0000:01:00.0: irq:155 group:3
> [   61.089739] ath12k_pci 0000:01:00.0: irq:155 group:4
> [   61.094701] ath12k_pci 0000:01:00.0: irq:155 group:5
> [   61.099676] ath12k_pci 0000:01:00.0: irq:155 group:6
> [   61.104637] ath12k_pci 0000:01:00.0: irq:155 group:7
> [   61.109613] ath12k_pci 0000:01:00.0: pci after request_irq msi_ep_base_data 0
> [   61.116839] ath12k_pci 0000:01:00.0: ath12k_pci_read32 called with
> offset 0x1E081B0
> [   61.124492] ath12k_pci 0000:01:00.0: ath12k_pci_read32 before
> ioread32() (window_start != WINDOW_START) offset 0x1E081B0
> window_start 0
>
> F0: 102B 0000
> F5: 480A 0031
> F5: 480A 0031
> F3: 0000 0000
> V0: 0000 0000 [0001]
> 00: 0000 0000
> BP: 0400 0041 [0000]
> G0: 1190 0000
> T0: 0000 02ED [000F]
> Jump to BL
>
> NOTICE:  BL2: v2.9.0(release):OpenWrt v2023-10-13-0ea67d76-1 (mt7622-emmc-2ddr)
>
> And from my laptop I see:
> [  814.942643] ath12k_pci 0000:01:00.0: BAR 0: assigned [mem
> 0xf6400000-0xf65fffff 64bit]
> [  814.942944] ath12k_pci 0000:01:00.0: Hardware name: qcn9274 hw2.0
> [  814.968821] ath12k_pci 0000:01:00.0: pci ltssm 0xffffffff
> [  814.968844] ath12k_pci 0000:01:00.0: pci pcie_hot_rst 0xffffffff
>
> So, seems PC in case of ioread32() fail (not mapped) report 0xffffffff
> - while MTK on bpi-r64 just hang.
> Anyway, guess PCIE_PCIE_PARF_LTSSM is not correctly mapped?
> Please check.
>

See the same on banana PI R4/R64 with WCN7850:
 - Qualcomm Technologies, Inc WCN785x Wi-Fi 7(802.11be) 320MHz 2x2
[FastConnect 7800] (rev 01)

Using:
 - Loading modules backported from Linux version v6.9.9-0-g28fdf4518483
 -
root at bpi-r4-92bab365400b:~# dmesg |grep ath12
[   11.053570] ath12k_pci 0001:01:00.0: assign IRQ: got 0
[   11.058877] ath12k_pci 0001:01:00.0: BAR 0: assigned [mem
0x38200000-0x383fffff 64bit]
[   11.066846] ath12k_pci 0001:01:00.0: enabling device (0000 -> 0002)
[   11.073206] ath12k_pci 0001:01:00.0: enabling bus mastering
[   11.220499] ath12k_pci 0001:01:00.0: MSI vectors: 16
[   11.225472] ath12k_pci 0001:01:00.0: Hardware name: wcn7850 hw2.0
[   12.349947] ath12k_pci 0001:01:00.0: qmi dma allocation failed
(7077888 B type 1), will try later with small size
[   12.372349] ath12k_pci 0001:01:00.0: chip_id 0x2 chip_family 0x4
board_id 0x10e soc_id 0x40170200
[   12.381234] ath12k_pci 0001:01:00.0: fw_version 0x100301e1
fw_build_timestamp 2023-12-06 04:05 fw_build_id
QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Any hint which patch could I apply to 6.9.9 to fix this ioread32/iowrite32?

BR
Janusz



More information about the ath12k mailing list