[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0e630740-6913-0fb0-3ba1-1afc0aa61669@quicinc.com>
Date: Tue, 21 Feb 2023 08:52:57 -0700
From: Jeffrey Hugo <quic_jhugo@...cinc.com>
To: Vivek Pernamitta <quic_vpernami@...cinc.com>, <mhi@...ts.linux.dev>
CC: <quic_qianyu@...cinc.com>, <manivannan.sadhasivam@...aro.org>,
"Manivannan Sadhasivam" <mani@...nel.org>,
Alex Elder <elder@...aro.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
Hemant Kumar <hemantk@...eaurora.org>,
Bhaumik Bhatt <bbhatt@...eaurora.org>,
Paul Davey <paul.davey@...iedtelesis.co.nz>,
"open list:MHI BUS" <linux-arm-msm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V1] bus: mhi: host: Avoid ringing EV DB if there is no
elements to process
On 2/21/2023 3:15 AM, Vivek Pernamitta wrote:
> Avoid ringing Event DB if there is no elements to process.
> As mhi_poll function can be called by mhi client drivers
> which will call process_event, which will ring DB even if
> there no ring elements to process.
>
> Signed-off-by: Vivek Pernamitta <quic_vpernami@...cinc.com>
> ---
> drivers/bus/mhi/host/main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> index df0fbfe..8bf8394 100644
> --- a/drivers/bus/mhi/host/main.c
> +++ b/drivers/bus/mhi/host/main.c
> @@ -1031,7 +1031,9 @@ int mhi_process_data_event_ring(struct mhi_controller *mhi_cntrl,
> count++;
> }
> read_lock_bh(&mhi_cntrl->pm_lock);
> - if (likely(MHI_DB_ACCESS_VALID(mhi_cntrl)))
> +
> + /* Ring EV DB only if there is any pending element to process */
> + if (likely(MHI_DB_ACCESS_VALID(mhi_cntrl)) && count)
> mhi_ring_er_db(mhi_event);
> read_unlock_bh(&mhi_cntrl->pm_lock);
>
Seems like this optimization also applies to mhi_process_ctrl_ev_ring().
Why not update that as well?
Powered by blists - more mailing lists