Skip to content

Commit

Permalink
iommu: moving initialization earlier
Browse files Browse the repository at this point in the history
The iommu_init() initializes IOMMU internal structures and data
required for the IOMMU API as iommu_group_alloc().
It is registered as a subsys_initcall now.

One of the IOMMU users is going to be a PCI subsystem on POWER.
It discovers new IOMMU tables during the PCI scan so the logical
place to call iommu_group_alloc() is the moment when a new group
is discovered. However PCI scan is done from subsys_initcall hook
as IOMMU does so PCI hook can be (and is) called before the IOMMU one.

The patch moves IOMMU subsystem initialization one step earlier
to make sure that IOMMU is initialized before PCI scan begins.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
  • Loading branch information
Alexey Kardashevskiy authored and Joerg Roedel committed Jan 10, 2013
1 parent 9931fac commit 097e363
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ static int __init iommu_init(void)

return 0;
}
subsys_initcall(iommu_init);
arch_initcall(iommu_init);

int iommu_domain_get_attr(struct iommu_domain *domain,
enum iommu_attr attr, void *data)
Expand Down

0 comments on commit 097e363

Please sign in to comment.