Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: bbhatt@codeaurora.org
To: Loic Poulain <loic.poulain@linaro.org>
Cc: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] bus: mhi: Move irq check in controller registration
Date: Tue, 22 Sep 2020 10:00:14 -0700	[thread overview]
Message-ID: <c052dbd8dcc2bd625b300b6c21638e3b@codeaurora.org> (raw)
In-Reply-To: <1600762066-25849-1-git-send-email-loic.poulain@linaro.org>

On 2020-09-22 01:07, Loic Poulain wrote:
> Move irq number check early in mhi_register_controller along
> with other mandatory parameters checking.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>  drivers/bus/mhi/core/init.c | 2 +-
>  drivers/bus/mhi/core/pm.c   | 3 ---
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index ca08437..34f9ae3 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -871,7 +871,7 @@ int mhi_register_controller(struct mhi_controller
> *mhi_cntrl,
> 
>  	if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
>  	    !mhi_cntrl->status_cb || !mhi_cntrl->read_reg ||
> -	    !mhi_cntrl->write_reg)
> +	    !mhi_cntrl->write_reg || !mhi_cntrl->nr_irqs)
>  		return -EINVAL;
> 
>  	ret = parse_config(mhi_cntrl, config);
> diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
> index 3de7b16..07efdbc 100644
> --- a/drivers/bus/mhi/core/pm.c
> +++ b/drivers/bus/mhi/core/pm.c
> @@ -918,9 +918,6 @@ int mhi_async_power_up(struct mhi_controller 
> *mhi_cntrl)
> 
>  	dev_info(dev, "Requested to power ON\n");
> 
> -	if (mhi_cntrl->nr_irqs < 1)
> -		return -EINVAL;
> -
>  	/* Supply default wake routines if not provided by controller driver 
> */
>  	if (!mhi_cntrl->wake_get || !mhi_cntrl->wake_put ||
>  	    !mhi_cntrl->wake_toggle) {
Hi Loic,

Can you please add a Suggested-by: Bhaumik Bhatt <bbhatt@codeaurora.org> 
tag with my name?

Also, I made this patch myself too but you can submit it. It'd be nice 
to add some more
details in the commit text.

Mine goes like this:

bus: mhi: core: Check for IRQ availability during registration

     Current design allows a controller to register with MHI successfully
     without the need to have any IRQs available for use. If no IRQs are
     available, power up requests to MHI can fail after a successful
     registration with MHI. Improve the design by checking for the number
     of IRQs available sooner within the mhi_regsiter_controller() API as
     it is required to be specified by the controller.

Thanks,
Bhaumik

  reply	other threads:[~2020-09-22 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  8:07 [PATCH] bus: mhi: Move irq check in controller registration Loic Poulain
2020-09-22 17:00 ` bbhatt [this message]
2020-09-22 17:33   ` Loic Poulain
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c052dbd8dcc2bd625b300b6c21638e3b@codeaurora.org \
    --to=bbhatt@codeaurora.org \
    --cc=hemantk@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=manivannan.sadhasivam@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox