summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>2026-07-10 13:51:20 +0200
committerManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>2026-07-30 07:19:50 +0200
commit753aa72545ce0b2503eca784f35062d0bf5418d7 (patch)
tree925a4f0d24703d0e1d4b8aa38d88615659b90ec8 /include/linux
parent24f4423cbc89548def2b05ae86de6175086dbf94 (diff)
bus: mhi: host: Add support for devices with no M3 state
MHI bus transitions the device into M3 state during suspend and back to M0 state during resume. But due to hardware issues, some devices do not support M3 state. To support these devices properly, MHI bus needs to skip transitioning the device to M3 during suspend and back to M0 during resume. For this purpose, introduce the 'mhi_cntrl->no_m3' flag and allow it to be set by the MHI controller drivers. Once set, this flag lets the MHI bus skip transitioning the device to M3/M0 during suspend/resume. But, simply skipping suspend/resume for such devices is not sufficient, as it leaves the MHI host in M0 state with device access enabled. Client drivers that do not implement PM callbacks (for instance, the non-freezable rx_refill worker in mhi_net driver) could then keep ringing channel doorbells and issue MMIO to the device even after the controller driver has disabled it and moved it to D3 during its own suspend, resulting in access to a powered down device. So instead of skipping the entire suspend/resume operation, run the full host suspend/resume sequence but without the device-side M state handshake. During suspend, only transition the host to M3 without sending the MHICTRL M3 command or waiting for the device M3 event. During resume, bring the host back to M0 through mhi_pm_m0_transition() without sending the MHICTRL M0 command. With the host in M3, all device access is gated by MHI_DB_ACCESS_VALID() and MHI_REG_ACCESS_VALID(), so any transfer queued by the clients during suspend is deferred until resume, where mhi_pm_m0_transition() rings the pending doorbells. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mhi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index fb3ba639f4f8..0d60058bf5ae 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -374,6 +374,7 @@ struct mhi_controller_config {
* @bounce_buf: Use of bounce buffer
* @fbc_download: MHI host needs to do complete image transfer (optional)
* @wake_set: Device wakeup set flag
+ * @no_m3: Device doesn't support M3 state
* @irq_flags: irq flags passed to request_irq (optional)
* @mru: the default MRU for the MHI device
*
@@ -459,6 +460,7 @@ struct mhi_controller {
bool bounce_buf;
bool fbc_download;
bool wake_set;
+ bool no_m3;
unsigned long irq_flags;
u32 mru;
};