Skip to content

Commit

Permalink
irqchip/gic-v3-its-platform-msi: Fix msi-parent parsing loop
Browse files Browse the repository at this point in the history
While parsing the msi-parent property to chase up the IRQ domain
a given device belongs to, the index into the msi-parent tuple should
be incremented to ensure all properties entries are taken into account.

Current code missed the index update so the parsing loop does not work
in case multiple msi-parent phandles are present and may turn into
an infinite loop in of_pmsi_get_dev_id() if phandle at index 0 does
not correspond to the domain we are actually looking-up.

Fix the code by updating the phandle index at each iteration in
of_pmsi_get_dev_id().

Fixes: deac7fc ("irqchip/gic-v3-its: Parse new version of msi-parent property")
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
Lorenzo Pieralisi authored and Marc Zyngier committed Aug 10, 2017
1 parent fdf6e7a commit a008873
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/irqchip/irq-gic-v3-its-platform-msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev,
*dev_id = args.args[0];
break;
}
index++;
} while (!ret);

return ret;
Expand Down

0 comments on commit a008873

Please sign in to comment.