The current MHI runtime PM design is flawed, as the MHI core attempts to
manage power references internally via mhi_queue() and related paths.
This is problematic because the controller drivers do not have the
knowledge of the client PM status due to the broken PM topology. So when
they runtime suspend the controller, the client drivers could no longer
function.
To address this, in the new design, the client drivers reports their own
runtime PM status now and the PM framework makes sure that the parent
(controller driver) and other components up in the chain remain active.
This leverages the standard parent-child PM relationship.
Since MHI creates a mhi_dev device without an associated driver, we
explicitly enable runtime PM on it and mark it with
pm_runtime_no_callbacks() to indicate the PM core that no callbacks
exist for this device. This is only needed for MHI controller, since
the controller driver uses the bus device just like PCI device.
NOTE: As we have dependecies with other subsystems, Mani can you take
these series through MHI tree if other maintainers give a ack for this
series. To all the maintainers please ack to this series after reviewing
so that Mani can take this through MHI branch.
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
Changes in v2:
- Rewrite commit messages (Bjorn Andersson)
- Remove autosuspend and use normal runtime get/put API's as there is
already autosuspend in controller driver which waits significant time.
- Add pm_runtime_get()/get_sync() error handling.
- Add rumtime pm for wwan and qrtr.
- Link to v1: https://lore.kernel.org/r/20251201-mhi_runtimepm-v1-0-fab94399ca75@oss.qualcomm.com
---
Krishna Chaitanya Chundru (6):
bus: mhi: Replace controller runtime_get/put callbacks with direct PM runtime APIs
bus: mhi: Drop controller runtime PM callback indirection
net: mhi_net: Hold runtime PM during active data path operations
net: qrtr: Hold runtime PM during active data path operations
net: wwan: Hold runtime PM during active data path operations
bus: mhi: host: Fix runtime PM ownership between clients and controller
drivers/accel/qaic/mhi_controller.c | 11 -------
drivers/bus/mhi/host/init.c | 4 ++-
drivers/bus/mhi/host/internal.h | 7 ++--
drivers/bus/mhi/host/main.c | 21 ++----------
drivers/bus/mhi/host/pci_generic.c | 24 ++------------
drivers/bus/mhi/host/pm.c | 18 +++++------
drivers/net/mhi_net.c | 39 +++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/mhi.c | 10 ------
drivers/net/wireless/ath/ath12k/mhi.c | 11 -------
drivers/net/wwan/mhi_wwan_ctrl.c | 60 ++++++++++++++++++++++++++++++++++-
drivers/net/wwan/mhi_wwan_mbim.c | 44 ++++++++++++++++++++++++-
include/linux/mhi.h | 4 ---
net/qrtr/mhi.c | 57 +++++++++++++++++++++++++++++++--
13 files changed, 216 insertions(+), 94 deletions(-)
---
base-commit: a293ec25d59dd96309058c70df5a4dd0f889a1e4
change-id: 20251128-mhi_runtimepm-f7aed52cc557
Best regards,
--
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>