Skip to content

Commit

Permalink
mailbox: zynqmp: setup IPI for each valid child node
Browse files Browse the repository at this point in the history
As per zynqmp-ipi bindings, zynqmp IPI node can have multiple child nodes.
Current IPI setup function is set only for first child node. If IPI node
has multiple child nodes in the device-tree, then IPI setup fails for
child nodes other than first child node. In such case kernel will crash.
Fix this crash by registering IPI setup function for each available child
node.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
  • Loading branch information
Tanmay Shah authored and Jassi Brar committed Nov 24, 2024
1 parent b2cf36e commit 98fc87f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mailbox/zynqmp-ipi-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,10 +940,10 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
pdata->num_mboxes = num_mboxes;

mbox = pdata->ipi_mboxes;
mbox->setup_ipi_fn = ipi_fn;

for_each_available_child_of_node(np, nc) {
mbox->pdata = pdata;
mbox->setup_ipi_fn = ipi_fn;

ret = zynqmp_ipi_mbox_probe(mbox, nc);
if (ret) {
of_node_put(nc);
Expand Down

0 comments on commit 98fc87f

Please sign in to comment.