1. 23 Apr, 2024 12 commits
    • Lingbo Kong's avatar
      wifi: ath12k: ACPI TAS support · 576771c9
      Lingbo Kong authored
      Currently, ath12k does not support Time-Average-SAR (TAS). In order to enable
      TAS read the tables from ACPI and send them to the firmware using
      WMI_PDEV_SET_BIOS_INTERFACE_CMDID command. Besides, ath12k registers an ACPI
      event callback so that ACPI can notify ath12k to get the updated SAR power
      table and sends it to the firmware when the device state is changed.
      
      ACPI is only enabled for WCN7850 using struct ath12k_hw_params::acpi_guid
      field. Most likely QCN9274 will never support ACPI as the chip is not used in
      laptops.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarLingbo Kong <quic_lingbok@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240422033054.979-2-quic_lingbok@quicinc.com
      576771c9
    • Baochen Qiang's avatar
      wifi: ath12k: change supports_suspend to true for WCN7850 · 2b002845
      Baochen Qiang authored
      Now that all things are ready, enable supports_suspend to
      make suspend/resume work for WCN7850. Don't touch other
      chips because they don't support suspend.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-11-quic_bqiang@quicinc.com
      2b002845
    • Baochen Qiang's avatar
      wifi: ath12k: support suspend/resume · 8d5f4da8
      Baochen Qiang authored
      Now that all infrastructure is in place and ath12k is fixed to handle all the
      corner cases, power down the ath12k firmware during suspend and power it back
      up during resume.
      
      For suspend, two conditions needs to be satisfied:
      
      1. since MHI channel unprepare would be done in late suspend stage,
         ath12k needs to get all QMI-dependent things done before that stage.
      2. and because unprepare MHI channels requires a working MHI stack,
         ath12k is not allowed to call mhi_power_down() until that finishes.
      
      So the original suspend callback is separated into two parts: the first part
      handles all QMI-dependent things in suspend callback; while the second part
      powers down MHI in suspend_late callback. This is valid because kernel calls
      ath12k's suspend callback before calling all suspend_late callbacks, making
      the first condition satisfied. And because MHI devices are children of ath12k
      device (ab->dev), kernel guarantees that ath12k's suspend_late callback is
      called after QRTR's suspend_late callback, this satisfies the second condition.
      
      Above analysis also applies to resume process. so the original resume
      callback is separated into two parts: the first part powers up MHI stack
      in resume_early callback, this guarantees MHI stack is working when
      QRTR tries to prepare MHI channels (kernel calls QRTR's resume_early callback
      after ath12k's resume_early callback, due to the child-father relationship);
      the second part waits for the completion of restart, which would succeed
      since MHI channels are ready for use by QMI.
      
      Another notable change is in power down path, we tell mhi_power_down() to not
      to destroy MHI devices, making it possible for QRTR to help unprepare/prepare
      MHI channels, and finally get us rid of the potential probe-defer issue when
      resume.
      
      Also change related code due to interface changes.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-10-quic_bqiang@quicinc.com
      8d5f4da8
    • Baochen Qiang's avatar
      wifi: ath12k: avoid stopping mac80211 queues in ath12k_core_restart() · 2652f6b4
      Baochen Qiang authored
      Currently when resume ath12k_core_restart() calls
      ath12k_core_pre_reconfigure_recovery() where mac80211 queues are
      stopped by calling ieee80211_stop_queues(). Then in
      ath12k_mac_op_reconfig_complete() those queues are not started
      because ieee80211_wake_queues() is skipped due to the check on
      reconfig_type. The result is that mac80211
      could not deliver any frame to ath12k to send out, finally making
      connection fail.
      
      [84473.104249] PM: suspend exit
      [84479.372397] wlan0: no VHT 160 MHz capability on 5 GHz, limiting to 80 MHz
      [84479.372401] wlan0: determined local STA to be EHT, BW limited to 80 MHz
      [84479.372416] wlan0: determined AP 00:03:7f:12:b7:b7 to be HE
      [84479.372420] wlan0: connecting with HE mode, max bandwidth 80 MHz
      [84479.580348] wlan0: authenticate with 00:03:7f:12:b7:b7 (local address=00:03:7f:37:11:53)
      [84479.580351] wlan0: send auth to 00:03:7f:12:b7:b7 (try 1/3)
      [84480.698993] wlan0: send auth to 00:03:7f:12:b7:b7 (try 2/3)
      [84481.816505] wlan0: send auth to 00:03:7f:12:b7:b7 (try 3/3)
      [84482.810966] wlan0: authentication with 00:03:7f:12:b7:b7 timed out
      
      Actually we don't need to stop/start queues during suspend/resume,
      so remove ath12k_core_pre_reconfigure_recovery() from ath12k_core_restart().
      This won't cause any regression because currently the only chance
      ath12k_core_restart() gets called is in reset case, where ab->is_reset
      is set so that function will never be executed.
      
      Also remove ath12k_core_post_reconfigure_recovery() because it is
      not needed in suspend/resume case. This is also valid due to above
      analysis.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-9-quic_bqiang@quicinc.com
      2652f6b4
    • Baochen Qiang's avatar
      wifi: ath12k: no need to handle pktlog during suspend/resume · b1c9992c
      Baochen Qiang authored
      Currently pktlog is stopped in suspend callback and started in
      resume callback, and in either scenarios it's basically to
      delete/modify ab->mon_reap_timer and to purge related rings.
      For WCN7850 it's pointless because pktlog is not enabled: both
      ab->mon_reap_timer and those rings are not initialized.
      
      So remove pktlog handling in suspend/resume callbacks. And
      further, remove these two functions and related callee because
      no one is calling them.
      
      Other chips are not affected because now only WCN7850 supports
      suspend/resume.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-8-quic_bqiang@quicinc.com
      b1c9992c
    • Baochen Qiang's avatar
      wifi: ath12k: flush all packets before suspend · 692921ea
      Baochen Qiang authored
      In order to send out all packets before going to suspend, current code
      adds a 500ms delay as a workaround. It is a rough estimate and may not
      work.
      
      Fix this by checking packet counters, if counters become zero, then all
      packets are sent out or dropped.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-7-quic_bqiang@quicinc.com
      692921ea
    • Baochen Qiang's avatar
      wifi: ath12k: decrease MHI channel buffer length to 8KB · 7b3d4eb2
      Baochen Qiang authored
      Currently buf_len field of ath12k_mhi_config_wcn7850 is assigned
      with 0, making MHI use a default size, 64KB, to allocate channel
      buffers. This is likely to fail in some scenarios where system
      memory is highly fragmented and memory compaction or reclaim is
      not allowed.
      
      For now we haven't get any failure report on this in ath12k, but
      there indeed is one such case in ath11k [1].
      
      Actually those buffers are used only by QMI target -> host communication.
      And for WCN7850, the largest packet size for that is less than 6KB. So
      change buf_len field to 8KB, which results in order 1 allocation if page
      size is 4KB. In this way, we can at least save some memory, and as well
      as decrease the possibility of allocation failure in those scenarios.
      
      [1] https://lore.kernel.org/ath11k/96481a45-3547-4d23-ad34-3a8f1d90c1cd@suse.cz/
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-6-quic_bqiang@quicinc.com
      7b3d4eb2
    • Baochen Qiang's avatar
      wifi: ath12k: fix warning on DMA ring capabilities event · 1623bf78
      Baochen Qiang authored
      We are seeing below warning in both reset and suspend/resume scenarios:
      
      [ 4153.776040] ath12k_pci 0000:04:00.0: Already processed, so ignoring dma ring caps
      
      This is because ab->num_db_cap is not cleared in
      ath12k_wmi_free_dbring_caps(), so clear it to avoid such
      warnings.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-5-quic_bqiang@quicinc.com
      1623bf78
    • Baochen Qiang's avatar
      wifi: ath12k: do not dump SRNG statistics during resume · 8591b2ba
      Baochen Qiang authored
      Both the firmware reset feature and the power management
      suspend/resume feature share common power-down and power-up
      functionality. One aspect of the power-up functionality is
      the handling of the ATH12K_QMI_EVENT_FW_INIT_DONE event.
      When this event is received, a call is made to
      ath12k_hal_dump_srng_stats(), with the purpose to collect
      information that may be useful in debugging the cause of a
      firmware reset.
      
      Unfortunately, since this functionality is shared between
      both the firmware reset path and the power management
      resume path, the kernel log is flooded with messages during
      resume. Since these messages are not useful during resume,
      and in fact can be confusing and can increase the time it
      takes to resume, update the logic to only call
      ath12k_hal_dump_srng_stats() during firmware reset.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-4-quic_bqiang@quicinc.com
      8591b2ba
    • Baochen Qiang's avatar
      wifi: ath12k: remove MHI LOOPBACK channels · b8b50a48
      Baochen Qiang authored
      There is no driver to match these two channels, so
      remove them. This fixes warnings from MHI subsystem during suspend:
      
      mhi mhi0_LOOPBACK: 1: Failed to reset channel, still resetting
      mhi mhi0_LOOPBACK: 0: Failed to reset channel, still resetting
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-3-quic_bqiang@quicinc.com
      b8b50a48
    • Baochen Qiang's avatar
      wifi: ath12k: rearrange IRQ enable/disable in reset path · c7b2da3c
      Baochen Qiang authored
      For non-WoW suspend/resume, ath12k host powers down whole hardware
      when suspend and powers up it when resume, the code path it goes
      through is very like the ath12k reset logic.
      
      In order to reuse that logic, rearrange IRQ handling in the reset
      path.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240412060620.27519-2-quic_bqiang@quicinc.com
      c7b2da3c
    • Baochen Qiang's avatar
      wifi: ath12k: fix kernel crash during resume · 303c0178
      Baochen Qiang authored
      Currently during resume, QMI target memory is not properly handled, resulting
      in kernel crash in case DMA remap is not supported:
      
      BUG: Bad page state in process kworker/u16:54  pfn:36e80
      page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36e80
      page dumped because: nonzero _refcount
      Call Trace:
       bad_page
       free_page_is_bad_report
       __free_pages_ok
       __free_pages
       dma_direct_free
       dma_free_attrs
       ath12k_qmi_free_target_mem_chunk
       ath12k_qmi_msg_mem_request_cb
      
      The reason is:
      Once ath12k module is loaded, firmware sends memory request to host. In case
      DMA remap not supported, ath12k refuses the first request due to failure in
      allocating with large segment size:
      
      ath12k_pci 0000:04:00.0: qmi firmware request memory request
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 7077888
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 8454144
      ath12k_pci 0000:04:00.0: qmi dma allocation failed (7077888 B type 1), will try later with small size
      ath12k_pci 0000:04:00.0: qmi delays mem_request 2
      ath12k_pci 0000:04:00.0: qmi firmware request memory request
      
      Later firmware comes back with more but small segments and allocation
      succeeds:
      
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 262144
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288
      ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 65536
      ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288
      
      Now ath12k is working. If suspend is triggered, firmware will be reloaded
      during resume. As same as before, firmware requests two large segments at
      first. In ath12k_qmi_msg_mem_request_cb() segment count and size are
      assigned:
      
      	ab->qmi.mem_seg_count == 2
      	ab->qmi.target_mem[0].size == 7077888
      	ab->qmi.target_mem[1].size == 8454144
      
      Then allocation failed like before and ath12k_qmi_free_target_mem_chunk()
      is called to free all allocated segments. Note the first segment is skipped
      because its v.addr is cleared due to allocation failure:
      
      	chunk->v.addr = dma_alloc_coherent()
      
      Also note that this leaks that segment because it has not been freed.
      
      While freeing the second segment, a size of 8454144 is passed to
      dma_free_coherent(). However remember that this segment is allocated at
      the first time firmware is loaded, before suspend. So its real size is
      524288, much smaller than 8454144. As a result kernel found we are freeing
      some memory which is in use and thus crashed.
      
      So one possible fix would be to free those segments during suspend. This
      works because with them freed, ath12k_qmi_free_target_mem_chunk() does
      nothing: all segment addresses are NULL so dma_free_coherent() is not called.
      
      But note that ath11k has similar logic but never hits this issue. Reviewing
      code there shows the luck comes from QMI memory reuse logic. So the decision
      is to port it to ath12k. Like in ath11k, the crash is avoided by adding
      prev_size to target_mem_chunk structure and caching real segment size in it,
      then prev_size instead of current size is passed to dma_free_coherent(),
      no unexpected memory is freed now.
      
      Also reuse m3 buffer.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240419034034.2842-1-quic_bqiang@quicinc.com
      303c0178
  2. 22 Apr, 2024 5 commits
  3. 18 Apr, 2024 6 commits
  4. 16 Apr, 2024 2 commits
  5. 10 Apr, 2024 12 commits
  6. 09 Apr, 2024 3 commits
    • Karthikeyan Periyasamy's avatar
      wifi: ath12k: correct the capital word typo · df1f2b94
      Karthikeyan Periyasamy authored
      Rename the "ATH12k" word to "ATH12K" for consistent capitalization in the
      word.
      Signed-off-by: default avatarKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
      Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240405144524.1157122-1-quic_periyasa@quicinc.com
      df1f2b94
    • Baochen Qiang's avatar
      wifi: ath11k: support hibernation · 166a490f
      Baochen Qiang authored
      Now that all infrastructure is in place and ath11k is fixed to handle all the
      corner cases, power down the ath11k firmware during suspend and power it back
      up during resume. This fixes the problem when using hibernation with ath11k PCI
      devices.
      
      For suspend, two conditions needs to be satisfied:
              1. since MHI channel unprepare would be done in late suspend stage,
                 ath11k needs to get all QMI-dependent things done before that stage.
              2. and because unprepare MHI channels requires a working MHI stack,
                 ath11k is not allowed to call mhi_power_down() until that finishes.
      So the original suspend callback is separated into two parts: the first part
      handles all QMI-dependent things in suspend callback; while the second part
      powers down MHI in suspend_late callback. This is valid because kernel calls
      ath11k's suspend callback before all suspend_late callbacks, making the first
      condition happy. And because MHI devices are children of ath11k device
      (ab->dev), kernel guarantees that ath11k's suspend_late callback is called
      after QRTR's suspend_late callback, this satisfies the second condition.
      
      Above analysis also applies to resume process. so the original resume
      callback is separated into two parts: the first part powers up MHI stack
      in resume_early callback, this guarantees MHI stack is working when
      QRTR tries to prepare MHI channels (kernel calls QRTR's resume_early callback
      after ath11k's resume_early callback, due to the child-father relationship);
      the second part waits for the completion of restart, which won't fail now
      since MHI channels are ready for use by QMI.
      
      Another notable change is in power down path, we tell mhi_power_down() to not
      to destroy MHI devices, making it possible for QRTR to help unprepare/prepare
      MHI channels, and finally get us rid of the probe-defer issue when resume.
      
      Also change related code due to interface changes.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
      Tested-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240305021320.3367-4-quic_bqiang@quicinc.com
      166a490f
    • Baochen Qiang's avatar
      net: qrtr: support suspend/hibernation · e0cd1185
      Baochen Qiang authored
      MHI devices may not be destroyed during suspend/hibernation, so need
      to unprepare/prepare MHI channels throughout the transition, this is
      done by adding suspend/resume callbacks.
      
      The suspend callback is called in the late suspend stage, this means
      MHI channels are still alive at suspend stage, and that makes it
      possible for an MHI controller driver to communicate with others over
      those channels at suspend stage. While the resume callback is called
      in the early resume stage, for a similar reason.
      
      Also note that we won't do unprepare/prepare when MHI device is in
      suspend state because it's pointless if MHI is only meant to go through
      a suspend/resume transition, instead of a complete power cycle.
      
      Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      Reviewed-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20240305021320.3367-3-quic_bqiang@quicinc.com
      e0cd1185