Re: [PATCH v2 2/2] bus: mhi: host: pci_generic: Add pm_runtime_forbid() in remove callback

Manivannan Sadhasivam <[email protected]> Fri, 6 Mar 2026 13:12:57 +0530
Newsgroups dev.linux.lists.mhi,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel
Message-ID <3wjtmsjf6yxuhbtwjlg3tyxqfs4bjdktb4koxvdx26ljfxuwnu@3zvmme3palbi>
On Tue, Mar 03, 2026 at 01:02:14AM -0800, Qiang Yu wrote:
> Add pm_runtime_forbid() to balance the pm_runtime_allow() call made
> during probe. Without this, the device remains in runtime PM allowed
> state after driver removal.
> 
> Fixes: 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems")
> Signed-off-by: Qiang Yu <[email protected]>
> ---
>  drivers/bus/mhi/host/pci_generic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 0395a8ea52b0e874209ca56cd20ed04419038cdb..b6b21d0f3388d61b771062b8077f836a6bf8f9f8 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -1459,6 +1459,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
>  		mhi_soc_reset(mhi_cntrl);
>  
>  	mhi_unregister_controller(mhi_cntrl);
> +	pm_runtime_forbid(&pdev->dev);

I moved this to the start of mhi_pci_remove() while applying.

- Mani

-- 
மணிவண்ணன் சதாசிவம்