1. 11 10月, 2021 1 次提交
    • B
      ath11k: Handle MSI enablement during rmmod and SSR · 96527d52
      Baochen Qiang 提交于
      When doing "rmmod ath11k_pci", ath11k performs global SOC reset
      and MHI reset, where 0 address access is captured by IOMMU. See
      log below:
      
      ...
      [  133.953860] ath11k_pci 0000:02:00.0: setting mhi state: DEINIT(1)
      [  133.959714] ath11k_pci 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
      [  133.973854] ath11k_pci 0000:02:00.0: MHISTATUS 0xff04
      [  133.974095] ath11k_pci 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
      ...
      
      This issue is also observed in SSR process, cause a similar
      sequence as above is performed.
      
      Such an invalid access occurs because, during rmmod or SSR, MSI
      address is cleared but HW MSI functionality not disabled, thus HW
      target is able to raise an MSI transaction with 0 as MSI address.
      
      So it can be fixed by simply disabling MSI before reset. For SSR,
      since MSI functionality is still needed after target is brought
      back, we need to reenable it.
      
      Also change naming of some interfaces related.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
      Signed-off-by: NBaochen Qiang <bqiang@codeaurora.org>
      Signed-off-by: NJouni Malinen <jouni@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20210913180246.193388-5-jouni@codeaurora.org
      96527d52
  2. 28 9月, 2021 1 次提交
  3. 02 7月, 2021 1 次提交
    • C
      ath: switch from 'pci_' to 'dma_' API · 923a1346
      Christophe JAILLET 提交于
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below.
      
      While at it, some 'dma_set_mask()/dma_set_coherent_mask()' have been
      updated to a much less verbose 'dma_set_mask_and_coherent()'.
      
      @@ @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@ @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@ @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@ @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/9150bd6cde9ad592aff8ee3ad94dffa90b004e89.1624720959.git.christophe.jaillet@wanadoo.fr
      923a1346
  4. 19 6月, 2021 1 次提交
  5. 12 6月, 2021 2 次提交
  6. 17 2月, 2021 8 次提交
  7. 12 2月, 2021 1 次提交
  8. 18 12月, 2020 2 次提交
  9. 17 12月, 2020 1 次提交
  10. 12 12月, 2020 7 次提交
  11. 09 12月, 2020 1 次提交
  12. 08 12月, 2020 2 次提交
  13. 07 11月, 2020 1 次提交
  14. 02 10月, 2020 4 次提交
    • C
      ath11k: enable shadow register configuration and access · e838c14a
      Carl Huang 提交于
      To enable shadow register access, host needs to pass shadow
      register configuration to firmware via qmi message. Host also
      needs to update ring's HP or TP address to shadow register
      address. The write operation to shadow register will be
      forwarded to target register by hardware automatically, and
      the write operation to shadow register is permitted even
      when the target is in power save or sleep mode.
      
      Update the shadow config whenever power up happens.
      
      This feature is controlled by hw parameter supports_shadow_regs which is only
      enabled for QCA6390.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: NCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1601544890-13450-3-git-send-email-kvalo@codeaurora.org
      e838c14a
    • C
      ath11k: read and write registers below unwindowed address · a05bd851
      Carl Huang 提交于
      For QCA6390, host can read and write registers below unwindowed
      address directly without programming the window register. For
      registers below bar0 + 4k - 32, host can read and write regardless
      of the power save state. Shadow registers are located below
      bar0 + 4K - 32.
      
      Before MHI power up, there is no need to wakeup MHI so ini_done is
      added to indicate it.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: NCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1601544890-13450-2-git-send-email-kvalo@codeaurora.org
      a05bd851
    • C
      ath11k: pci: fix rmmod crash · 6fbd8898
      Carl Huang 提交于
      For QCA6390 we first need to call free_irq() and only then disable_msi(). Otherwise a
      kernel BUG below will happen. Also free core, hal_srng and ce resources during
      ath11k_pci_remove().
      
      [ 1089.425506] ------------[ cut here ]------------
      [ 1089.425510] kernel BUG at drivers/pci/msi.c:375!
      [ 1089.425514] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC PTI
      [ 1089.425517] CPU: 1 PID: 20539 Comm: rmmod Not tainted 5.9.0-rc5-wt-ath+ #198
      [ 1089.425519] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0049.2018.0801.1601 08/01/2018
      [ 1089.425523] RIP: 0010:free_msi_irqs+0x184/0x1b0
      [ 1089.425526] Code: 14 85 c0 0f 84 cc fe ff ff 31 ed eb 0f 83 c5 01 39 6b 14 0f 86 bc fe ff ff 8b 7b 10 01 ef e8 c3 01 bf ff 48 83 78 70 00 74 e3 <0f> 0b 49 8d b5 b0 00 00 0
      [ 1089.425528] RSP: 0018:ffffb128c0cf7dd0 EFLAGS: 00010282
      [ 1089.425530] RAX: ffff947d67549000 RBX: ffff947cd2d25200 RCX: 0000000000000000
      [ 1089.425532] RDX: ffff947d94a6f928 RSI: ffff947d94a6fa18 RDI: 0000000000000099
      [ 1089.425533] RBP: 0000000000000000 R08: ffff947d67549000 R09: ffffffff86670050
      [ 1089.425535] R10: 0000000000000000 R11: 0000000000000000 R12: ffff947d96c194f0
      [ 1089.425537] R13: ffff947d96c19000 R14: 0000000000000000 R15: ffffffffc0225250
      [ 1089.425539] FS:  00007f97c44ed700(0000) GS:ffff947d9c200000(0000) knlGS:0000000000000000
      [ 1089.425541] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1089.425543] CR2: 00007f97c408d701 CR3: 0000000192bc0006 CR4: 00000000003706e0
      [ 1089.425544] Call Trace:
      [ 1089.425549]  ath11k_pci_remove+0x2b/0x90 [ath11k_pci]
      [ 1089.425553]  pci_device_remove+0x36/0x90
      [ 1089.425556]  __device_release_driver+0x16c/0x220
      [ 1089.425559]  driver_detach+0xcf/0x110
      [ 1089.425561]  bus_remove_driver+0x4d/0xa2
      [ 1089.425564]  pci_unregister_driver+0x25/0xa0
      [ 1089.425568]  __do_sys_delete_module+0x163/0x240
      [ 1089.425571]  ? trace_hardirqs_on+0x1c/0x100
      [ 1089.425575]  do_syscall_64+0x33/0x40
      [ 1089.425577]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [ 1089.425579] RIP: 0033:0x7f97c401d9e7
      [ 1089.425581] Code: 73 01 c3 48 8b 0d b1 c4 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c
      [ 1089.425583] RSP: 002b:00007fff1e0fb728 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [ 1089.425585] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97c401d9e7
      [ 1089.425587] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005585aad022e8
      [ 1089.425589] RBP: 00005585aad02280 R08: 0000000000000000 R09: 1999999999999999
      [ 1089.425591] R10: 0000000000000883 R11: 0000000000000206 R12: 00007fff1e0fb940
      [ 1089.425592] R13: 00007fff1e0fd917 R14: 0000000000000000 R15: 00005585aad02280
      [ 1089.425596] Modules linked in: ath11k_pci(-) ath11k qmi_helpers qrtr_mhi mhi qrtr ns nvme nvme_core [last unloaded: mhi]
      [ 1089.425603] ---[ end trace 2a81926cc0708a38 ]---
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: NCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1601463073-12106-3-git-send-email-kvalo@codeaurora.org
      6fbd8898
    • K
      ath11k: pci: check TCSR_SOC_HW_VERSION · 18ac1665
      Kalle Valo 提交于
      There are different versions of QCA6390. Check TCSR_SOC_HW_VERSION to make sure
      that the device is hw2.0, all the rest are unsupported.
      
      This needs to be checked after ath11k_pci_claim() so move the whole switch choosing hw_ver.
      
      Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1601399736-3210-5-git-send-email-kvalo@codeaurora.org
      18ac1665
  15. 11 9月, 2020 1 次提交
  16. 31 8月, 2020 1 次提交
  17. 18 8月, 2020 5 次提交