Skip to contentSkip to conversation

FAILED: patch "[PATCH] mailbox: zynqmp: Fix counts of child nodes" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message May 7, 2023

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x f72f805e72882c361e2a612c64a6e549f3da7152
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023050704-eclair-amusing-4187@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..

Possible dependencies:

f72f805e7288 ("mailbox: zynqmp: Fix counts of child nodes") 043f85ce81cb ("mailbox: zynq: Switch to flexible array to simplify code")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From f72f805e72882c361e2a612c64a6e549f3da7152 Mon Sep 17 00:00:00 2001
From: Tanmay Shah <[email protected]>
Date: Fri, 10 Mar 2023 17:24:04 -0800
Subject: [PATCH] mailbox: zynqmp: Fix counts of child nodes

If child mailbox node status is disabled it causes crash in interrupt handler. Fix this by assigning only available child node during driver probe.

drivers/mailbox/zynqmp-ipi-mailbox.c +6 -1
index a4c8d23c76e2..ae47fbac38d2 100644
@@ -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;
+	}
+
 	pdata = devm_kzalloc(dev, struct_size(pdata, ipi_mboxes, num_mboxes),
 			     GFP_KERNEL);
 	if (!pdata)