lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <pqe2gpbjbqgb42ioebrd6spodovi52x4rkbox5ptavrclwjkf4@rvli6wklilrj>
Date: Tue, 2 Dec 2025 15:29:24 -0600
From: Bjorn Andersson <andersson@...nel.org>
To: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
Cc: Manivannan Sadhasivam <mani@...nel.org>, 
	Jeff Hugo <jeff.hugo@....qualcomm.com>, Carl Vanderlip <carl.vanderlip@....qualcomm.com>, 
	Oded Gabbay <ogabbay@...nel.org>, Jeff Johnson <jjohnson@...nel.org>, 
	Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org, linux-wireless@...r.kernel.org, 
	ath11k@...ts.infradead.org, ath12k@...ts.infradead.org, netdev@...r.kernel.org, 
	mayank.rana@....qualcomm.com, quic_vbadigan@...cinc.com, vivek.pernamitta@....qualcomm.com
Subject: Re: [PATCH 2/4] bus: mhi: Remove runtime PM callback ops from
 controller interface

On Mon, Dec 01, 2025 at 06:13:18PM +0530, Krishna Chaitanya Chundru wrote:
> Remove the runtime_get and runtime_put function pointers from the
> struct mhi_controller interface and all associated usage across the
> MHI host stack. These callbacks were previously required by MHI drivers
> to abstract runtime PM handling, but are now redundant.
> 
> The MHI core has been updated to directly use standard pm_runtime_*
> APIs, eliminating the need for driver-specific indirection.

Please write your commit messages according to
https://docs.kernel.org/process/submitting-patches.html#describe-your-changes

Start by establishing the purpose of the patch/the problem you're
solving. Then once that's clear you can provide details about the
change.

Regards,
Bjorn

> 
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
> ---
>  drivers/accel/qaic/mhi_controller.c   | 11 -----------
>  drivers/bus/mhi/host/pci_generic.c    | 24 +++---------------------
>  drivers/net/wireless/ath/ath11k/mhi.c | 10 ----------
>  drivers/net/wireless/ath/ath12k/mhi.c | 11 -----------
>  include/linux/mhi.h                   |  4 ----
>  5 files changed, 3 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/accel/qaic/mhi_controller.c b/drivers/accel/qaic/mhi_controller.c
> index 13a14c6c61689fa4af47dade6d62b3cb1a148354..319344be658b38656f6e85e92be4b5473f43c897 100644
> --- a/drivers/accel/qaic/mhi_controller.c
> +++ b/drivers/accel/qaic/mhi_controller.c
> @@ -820,15 +820,6 @@ static void mhi_write_reg(struct mhi_controller *mhi_cntrl, void __iomem *addr,
>  	writel_relaxed(val, addr);
>  }
>  
> -static int mhi_runtime_get(struct mhi_controller *mhi_cntrl)
> -{
> -	return 0;
> -}
> -
> -static void mhi_runtime_put(struct mhi_controller *mhi_cntrl)
> -{
> -}
> -
>  static void mhi_status_cb(struct mhi_controller *mhi_cntrl, enum mhi_callback reason)
>  {
>  	struct qaic_device *qdev = pci_get_drvdata(to_pci_dev(mhi_cntrl->cntrl_dev));
> @@ -889,8 +880,6 @@ struct mhi_controller *qaic_mhi_register_controller(struct pci_dev *pci_dev, voi
>  	mhi_cntrl->iova_start = 0;
>  	mhi_cntrl->iova_stop = PHYS_ADDR_MAX - 1;
>  	mhi_cntrl->status_cb = mhi_status_cb;
> -	mhi_cntrl->runtime_get = mhi_runtime_get;
> -	mhi_cntrl->runtime_put = mhi_runtime_put;
>  	mhi_cntrl->read_reg = mhi_read_reg;
>  	mhi_cntrl->write_reg = mhi_write_reg;
>  	mhi_cntrl->regs = mhi_bar;
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index b188bbf7de042d8b9aa0dde1217d2c86558c3caf..7036b1654c550a79e53fb449b944d67b68aad677 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -1173,23 +1173,6 @@ static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
>  	return 0;
>  }
>  
> -static int mhi_pci_runtime_get(struct mhi_controller *mhi_cntrl)
> -{
> -	/* The runtime_get() MHI callback means:
> -	 *    Do whatever is requested to leave M3.
> -	 */
> -	return pm_runtime_get(mhi_cntrl->cntrl_dev);
> -}
> -
> -static void mhi_pci_runtime_put(struct mhi_controller *mhi_cntrl)
> -{
> -	/* The runtime_put() MHI callback means:
> -	 *    Device can be moved in M3 state.
> -	 */
> -	pm_runtime_mark_last_busy(mhi_cntrl->cntrl_dev);
> -	pm_runtime_put(mhi_cntrl->cntrl_dev);
> -}
> -
>  static void mhi_pci_recovery_work(struct work_struct *work)
>  {
>  	struct mhi_pci_device *mhi_pdev = container_of(work, struct mhi_pci_device,
> @@ -1277,7 +1260,7 @@ static int mhi_pci_generic_edl_trigger(struct mhi_controller *mhi_cntrl)
>  	}
>  
>  	pm_wakeup_event(&mhi_cntrl->mhi_dev->dev, 0);
> -	mhi_cntrl->runtime_get(mhi_cntrl);
> +	pm_runtime_get(mhi_cntrl->cntrl_dev);
>  
>  	ret = mhi_get_channel_doorbell_offset(mhi_cntrl, &val);
>  	if (ret)
> @@ -1291,7 +1274,8 @@ static int mhi_pci_generic_edl_trigger(struct mhi_controller *mhi_cntrl)
>  	mhi_soc_reset(mhi_cntrl);
>  
>  err_get_chdb:
> -	mhi_cntrl->runtime_put(mhi_cntrl);
> +	pm_runtime_mark_last_busy(mhi_cntrl->cntrl_dev);
> +	pm_runtime_put(mhi_cntrl->cntrl_dev);
>  	mhi_device_put(mhi_cntrl->mhi_dev);
>  
>  	return ret;
> @@ -1338,8 +1322,6 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	mhi_cntrl->read_reg = mhi_pci_read_reg;
>  	mhi_cntrl->write_reg = mhi_pci_write_reg;
>  	mhi_cntrl->status_cb = mhi_pci_status_cb;
> -	mhi_cntrl->runtime_get = mhi_pci_runtime_get;
> -	mhi_cntrl->runtime_put = mhi_pci_runtime_put;
>  	mhi_cntrl->mru = info->mru_default;
>  	mhi_cntrl->name = info->name;
>  
> diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
> index acd76e9392d31192aca6776319ef0829a1c69628..18bac9e4bc35bffabef05171b88bd5515e7df925 100644
> --- a/drivers/net/wireless/ath/ath11k/mhi.c
> +++ b/drivers/net/wireless/ath/ath11k/mhi.c
> @@ -230,14 +230,6 @@ static int ath11k_mhi_get_msi(struct ath11k_pci *ab_pci)
>  	return 0;
>  }
>  
> -static int ath11k_mhi_op_runtime_get(struct mhi_controller *mhi_cntrl)
> -{
> -	return 0;
> -}
> -
> -static void ath11k_mhi_op_runtime_put(struct mhi_controller *mhi_cntrl)
> -{
> -}
>  
>  static char *ath11k_mhi_op_callback_to_str(enum mhi_callback reason)
>  {
> @@ -384,8 +376,6 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	mhi_ctrl->sbl_size = SZ_512K;
>  	mhi_ctrl->seg_len = SZ_512K;
>  	mhi_ctrl->fbc_download = true;
> -	mhi_ctrl->runtime_get = ath11k_mhi_op_runtime_get;
> -	mhi_ctrl->runtime_put = ath11k_mhi_op_runtime_put;
>  	mhi_ctrl->status_cb = ath11k_mhi_op_status_cb;
>  	mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
>  	mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
> diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/ath/ath12k/mhi.c
> index 08f44baf182a5e34651e8c117fe279942f8ad8f4..99d8d9a8944cefa2561cd47d83bbeb53ef13044d 100644
> --- a/drivers/net/wireless/ath/ath12k/mhi.c
> +++ b/drivers/net/wireless/ath/ath12k/mhi.c
> @@ -230,15 +230,6 @@ static int ath12k_mhi_get_msi(struct ath12k_pci *ab_pci)
>  	return 0;
>  }
>  
> -static int ath12k_mhi_op_runtime_get(struct mhi_controller *mhi_cntrl)
> -{
> -	return 0;
> -}
> -
> -static void ath12k_mhi_op_runtime_put(struct mhi_controller *mhi_cntrl)
> -{
> -}
> -
>  static char *ath12k_mhi_op_callback_to_str(enum mhi_callback reason)
>  {
>  	switch (reason) {
> @@ -386,8 +377,6 @@ int ath12k_mhi_register(struct ath12k_pci *ab_pci)
>  	mhi_ctrl->sbl_size = SZ_512K;
>  	mhi_ctrl->seg_len = SZ_512K;
>  	mhi_ctrl->fbc_download = true;
> -	mhi_ctrl->runtime_get = ath12k_mhi_op_runtime_get;
> -	mhi_ctrl->runtime_put = ath12k_mhi_op_runtime_put;
>  	mhi_ctrl->status_cb = ath12k_mhi_op_status_cb;
>  	mhi_ctrl->read_reg = ath12k_mhi_op_read_reg;
>  	mhi_ctrl->write_reg = ath12k_mhi_op_write_reg;
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index dd372b0123a6da5107b807ff8fe940c567eb2030..312e5c4b9cf8a46ffb20e2afc70441a11ecf659c 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -347,8 +347,6 @@ struct mhi_controller_config {
>   * @wake_get: CB function to assert device wake (optional)
>   * @wake_put: CB function to de-assert device wake (optional)
>   * @wake_toggle: CB function to assert and de-assert device wake (optional)
> - * @runtime_get: CB function to controller runtime resume (required)
> - * @runtime_put: CB function to decrement pm usage (required)
>   * @map_single: CB function to create TRE buffer
>   * @unmap_single: CB function to destroy TRE buffer
>   * @read_reg: Read a MHI register via the physical link (required)
> @@ -427,8 +425,6 @@ struct mhi_controller {
>  	void (*wake_get)(struct mhi_controller *mhi_cntrl, bool override);
>  	void (*wake_put)(struct mhi_controller *mhi_cntrl, bool override);
>  	void (*wake_toggle)(struct mhi_controller *mhi_cntrl);
> -	int (*runtime_get)(struct mhi_controller *mhi_cntrl);
> -	void (*runtime_put)(struct mhi_controller *mhi_cntrl);
>  	int (*map_single)(struct mhi_controller *mhi_cntrl,
>  			  struct mhi_buf_info *buf);
>  	void (*unmap_single)(struct mhi_controller *mhi_cntrl,
> 
> -- 
> 2.34.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ