summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/vio.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2010-09-15 10:05:48 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-10-13 07:19:21 +0200
commit45848e0fc1fce399651b3f480bdeb82cc6d3d15a (patch)
tree72bbf790385b305be750ce0cab4e36ceee07913f /arch/powerpc/kernel/vio.c
parentpowerpc/vio: Use put_device() on device_register failure (diff)
downloadlinux-45848e0fc1fce399651b3f480bdeb82cc6d3d15a.tar.xz
linux-45848e0fc1fce399651b3f480bdeb82cc6d3d15a.zip
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: Milton Miller <miltonm@bga.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r--arch/powerpc/kernel/vio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 72db4b021762..d692989a4318 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -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));
}