Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45848e0f authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Benjamin Herrenschmidt
Browse files

powerpc/viobus: Free TCE table on device release



Release the TCE table as the XXX suggests, except on FW_FEATURE_ISERIES,
where the tables are allocated globally and reused.

Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent edea8f6f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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));
}