linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Tanmay Shah <tanmay.shah@amd.com>
Cc: michal.simek@amd.com, andersson@kernel.org,
	jaswinder.singh@linaro.org, ben.levinsky@amd.com,
	shubhrajyoti.datta@amd.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH v5 1/5] mailbox: zynqmp: fix counts of child nodes
Date: Mon, 13 Mar 2023 13:38:44 -0600	[thread overview]
Message-ID: <20230313193844.GA2071975@p14s> (raw)
In-Reply-To: <20230311012407.1292118-2-tanmay.shah@amd.com>

On Fri, Mar 10, 2023 at 05:24:04PM -0800, Tanmay Shah wrote:
> If child mailbox node status is disabled it causes
> crash in interrupt handler. Fix this by assigning
> only available child node during driver probe.
> 
> Fixes: 4981b82ba2ff ("mailbox: ZynqMP IPI mailbox controller")
> Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
> ---
> 
> Changes in v5:
>   - mailbox node count should not be 0 for driver to probe
> 
>  drivers/mailbox/zynqmp-ipi-mailbox.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c
> index a4c8d23c76e2..ae47fbac38d2 100644
> --- a/drivers/mailbox/zynqmp-ipi-mailbox.c
> +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c
> @@ -634,7 +634,12 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
>  	struct zynqmp_ipi_mbox *mbox;
>  	int num_mboxes, ret = -EINVAL;
>  
> -	num_mboxes = of_get_child_count(np);
> +	num_mboxes = of_get_available_child_count(np);
> +	if (num_mboxes == 0) {
> +		dev_err(dev, "mailbox nodes not available\n");
> +		return -EINVAL;
> +	}
> +

This patchset looks good now.  I'll queue it once I get an ack from Michal.

Thanks,
Mathieu

>  	pdata = devm_kzalloc(dev, struct_size(pdata, ipi_mboxes, num_mboxes),
>  			     GFP_KERNEL);
>  	if (!pdata)
> -- 
> 2.25.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-03-13 19:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11  1:24 [PATCH v5 0/5] drivers: remoteproc: xilinx: add mailbox support Tanmay Shah
2023-03-11  1:24 ` [PATCH v5 1/5] mailbox: zynqmp: fix counts of child nodes Tanmay Shah
2023-03-13  9:30   ` Michal Simek
2023-03-13 19:38   ` Mathieu Poirier [this message]
2023-03-14  7:26     ` Michal Simek
2023-03-11  1:24 ` [PATCH v5 2/5] mailbox: zynqmp: fix IPI isr handling Tanmay Shah
2023-03-11  1:24 ` [PATCH v5 3/5] mailbox: zynqmp: fix typo in IPI documentation Tanmay Shah
2023-03-11  1:24 ` [PATCH v5 4/5] drivers: remoteproc: xilinx: fix carveout names Tanmay Shah
2023-03-11  1:24 ` [PATCH v5 5/5] remoteproc: xilinx: add mailbox channels for rpmsg Tanmay Shah
2023-03-14 19:29 ` [PATCH v5 0/5] drivers: remoteproc: xilinx: add mailbox support Mathieu Poirier

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=20230313193844.GA2071975@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=andersson@kernel.org \
    --cc=ben.levinsky@amd.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=shubhrajyoti.datta@amd.com \
    --cc=tanmay.shah@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).