Skip to content

Commit

Permalink
iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have…
Browse files Browse the repository at this point in the history
… IPMMU-VMSA

This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in
a multiplatform configuration and IPMMU-VMSA driver is enabled.

Cc: <stable@vger.kernel.org> # v3.20+
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Dmitry Osipenko authored and Joerg Roedel committed Jul 27, 2018
1 parent 15021d3 commit 5c5c874
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/iommu/ipmmu-vmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,12 +1108,19 @@ static struct platform_driver ipmmu_driver = {

static int __init ipmmu_init(void)
{
struct device_node *np;
static bool setup_done;
int ret;

if (setup_done)
return 0;

np = of_find_matching_node(NULL, ipmmu_of_ids);
if (!np)
return 0;

of_node_put(np);

ret = platform_driver_register(&ipmmu_driver);
if (ret < 0)
return ret;
Expand Down

0 comments on commit 5c5c874

Please sign in to comment.