Re: [PATCH 04/11] Revert "bus: mhi: host: Remove mhi_poll() API"

Manivannan Sadhasivam <[email protected]>
Newsgroups dev.linux.lists.mhi,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <vfslj4vfs6mw57upbrfsxalznr3mjtfplc43ba3x37lr5mqtqp@njk7viqmh5dv>
On Thu, Dec 11, 2025 at 01:37:36PM +0530, Sivareddy Surasani wrote:
> From: Vivek Pernamitta <[email protected]>
> 
> Revert commit 5da094ac80cd ("bus: mhi: host: Remove mhi_poll() API")
> 
> Add mhi_poll() API. New hardware channel clients use mhi_poll() to manage
> their own completion events instead of relying on the MHI core driver for
> notifications.
> 

Sorry, this is not at all a poll API. poll API is supposed to be polling for an
event until that event occured. But this API just reads the ring buffer when
called.

- Mani

> Signed-off-by: Vivek Pernamitta <[email protected]>
> Signed-off-by: Sivareddy Surasani <[email protected]>
> ---
>  drivers/bus/mhi/host/main.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> index 7beb848ca5c1..5d50f6ebf6f9 100644
> --- a/drivers/bus/mhi/host/main.c
> +++ b/drivers/bus/mhi/host/main.c
> @@ -1858,3 +1858,18 @@ int mhi_get_channel_doorbell_offset(struct mhi_controller *mhi_cntrl, u32 *chdb_
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(mhi_get_channel_doorbell_offset);
> +
> +int mhi_poll(struct mhi_device *mhi_dev, u32 budget)
> +{
> +	struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
> +	struct mhi_chan *mhi_chan = mhi_dev->dl_chan;
> +	struct mhi_event *mhi_event = &mhi_cntrl->mhi_event[mhi_chan->er_index];
> +	int ret;
> +
> +	spin_lock_bh(&mhi_event->lock);
> +	ret = mhi_event->process_event(mhi_cntrl, mhi_event, budget);
> +	spin_unlock_bh(&mhi_event->lock);
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(mhi_poll);
> 
> -- 
> 2.34.1
> 

-- 
மணிவண்ணன் சதாசிவம்
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.