Skip to content

Commit

Permalink
powerpc/viobus: Free TCE table on device release
Browse files Browse the repository at this point in the history
Release the TCE table as the XXX suggests, except on FW_FEATURE_ISERIES,
where the tables are allocated globally and reused.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Nishanth Aravamudan authored and Benjamin Herrenschmidt committed Oct 13, 2010
1 parent edea8f6 commit 45848e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/kernel/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,12 @@ EXPORT_SYMBOL(vio_unregister_driver);
/* vio_dev refcount hit 0 */
static void __devinit vio_dev_release(struct device *dev)
{
/* XXX should free TCE table */
struct iommu_table *tbl = get_iommu_table_base(dev);

/* iSeries uses a common table for all vio devices */
if (!firmware_has_feature(FW_FEATURE_ISERIES) && tbl)
iommu_free_table(tbl, dev->of_node ?
dev->of_node->full_name : dev_name(dev));
of_node_put(dev->of_node);
kfree(to_vio_dev(dev));
}
Expand Down

0 comments on commit 45848e0

Please sign in to comment.