diff options
author | Muli Ben-Yehuda <muli@il.ibm.com> | 2007-10-17 12:04:39 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:16:41 -0400 |
commit | bc3c6058bc8f9845ae73f6dc727570778f103858 (patch) | |
tree | 70193e9fd76a348d6aedc7a96d235e801e8ee192 /arch/x86/kernel/pci-calgary_64.c | |
parent | 3c215b6680b347593705e010688e80400d772763 (diff) |
x86: calgary get rid of translate_phb
Now that we check for translation enabled/disabled based on the presence
of the IOMMU translation table, we can get rid of translate_phb.
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/pci-calgary_64.c')
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index ef05cc32a3a9..5098f58063a5 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -228,12 +228,6 @@ static inline int translation_enabled(struct iommu_table *tbl) | |||
228 | return (tbl != NULL); | 228 | return (tbl != NULL); |
229 | } | 229 | } |
230 | 230 | ||
231 | static inline int translate_phb(struct pci_dev* dev) | ||
232 | { | ||
233 | int disabled = bus_info[dev->bus->number].translation_disabled; | ||
234 | return !disabled; | ||
235 | } | ||
236 | |||
237 | static void iommu_range_reserve(struct iommu_table *tbl, | 231 | static void iommu_range_reserve(struct iommu_table *tbl, |
238 | unsigned long start_addr, unsigned int npages) | 232 | unsigned long start_addr, unsigned int npages) |
239 | { | 233 | { |
@@ -394,7 +388,7 @@ static void calgary_unmap_sg(struct device *dev, | |||
394 | struct scatterlist *s; | 388 | struct scatterlist *s; |
395 | int i; | 389 | int i; |
396 | 390 | ||
397 | if (!translate_enabled(tbl)) | 391 | if (!translation_enabled(tbl)) |
398 | return; | 392 | return; |
399 | 393 | ||
400 | for_each_sg(sglist, s, nelems, i) { | 394 | for_each_sg(sglist, s, nelems, i) { |
@@ -1200,7 +1194,7 @@ static int __init calgary_init(void) | |||
1200 | { | 1194 | { |
1201 | int ret; | 1195 | int ret; |
1202 | struct pci_dev *dev = NULL; | 1196 | struct pci_dev *dev = NULL; |
1203 | void *tce_space; | 1197 | struct calgary_bus_info *info; |
1204 | 1198 | ||
1205 | ret = calgary_locate_bbars(); | 1199 | ret = calgary_locate_bbars(); |
1206 | if (ret) | 1200 | if (ret) |
@@ -1212,12 +1206,14 @@ static int __init calgary_init(void) | |||
1212 | break; | 1206 | break; |
1213 | if (!is_cal_pci_dev(dev->device)) | 1207 | if (!is_cal_pci_dev(dev->device)) |
1214 | continue; | 1208 | continue; |
1215 | if (!translate_phb(dev)) { | 1209 | |
1210 | info = &bus_info[dev->bus->number]; | ||
1211 | if (info->translation_disabled) { | ||
1216 | calgary_init_one_nontraslated(dev); | 1212 | calgary_init_one_nontraslated(dev); |
1217 | continue; | 1213 | continue; |
1218 | } | 1214 | } |
1219 | tce_space = bus_info[dev->bus->number].tce_space; | 1215 | |
1220 | if (!tce_space && !translate_empty_slots) | 1216 | if (!info->tce_space && !translate_empty_slots) |
1221 | continue; | 1217 | continue; |
1222 | 1218 | ||
1223 | ret = calgary_init_one(dev); | 1219 | ret = calgary_init_one(dev); |
@@ -1235,11 +1231,13 @@ error: | |||
1235 | break; | 1231 | break; |
1236 | if (!is_cal_pci_dev(dev->device)) | 1232 | if (!is_cal_pci_dev(dev->device)) |
1237 | continue; | 1233 | continue; |
1238 | if (!translate_phb(dev)) { | 1234 | |
1235 | info = &bus_info[dev->bus->number]; | ||
1236 | if (info->translation_disabled) { | ||
1239 | pci_dev_put(dev); | 1237 | pci_dev_put(dev); |
1240 | continue; | 1238 | continue; |
1241 | } | 1239 | } |
1242 | if (!bus_info[dev->bus->number].tce_space && !translate_empty_slots) | 1240 | if (!info->tce_space && !translate_empty_slots) |
1243 | continue; | 1241 | continue; |
1244 | 1242 | ||
1245 | calgary_disable_translation(dev); | 1243 | calgary_disable_translation(dev); |
@@ -1552,7 +1550,7 @@ static void __init calgary_fixup_one_tce_space(struct pci_dev *dev) | |||
1552 | static int __init calgary_fixup_tce_spaces(void) | 1550 | static int __init calgary_fixup_tce_spaces(void) |
1553 | { | 1551 | { |
1554 | struct pci_dev *dev = NULL; | 1552 | struct pci_dev *dev = NULL; |
1555 | void *tce_space; | 1553 | struct calgary_bus_info *info; |
1556 | 1554 | ||
1557 | if (no_iommu || swiotlb || !calgary_detected) | 1555 | if (no_iommu || swiotlb || !calgary_detected) |
1558 | return -ENODEV; | 1556 | return -ENODEV; |
@@ -1565,11 +1563,12 @@ static int __init calgary_fixup_tce_spaces(void) | |||
1565 | break; | 1563 | break; |
1566 | if (!is_cal_pci_dev(dev->device)) | 1564 | if (!is_cal_pci_dev(dev->device)) |
1567 | continue; | 1565 | continue; |
1568 | if (!translate_phb(dev)) | 1566 | |
1567 | info = &bus_info[dev->bus->number]; | ||
1568 | if (info->translation_disabled) | ||
1569 | continue; | 1569 | continue; |
1570 | 1570 | ||
1571 | tce_space = bus_info[dev->bus->number].tce_space; | 1571 | if (!info->tce_space) |
1572 | if (!tce_space) | ||
1573 | continue; | 1572 | continue; |
1574 | 1573 | ||
1575 | calgary_fixup_one_tce_space(dev); | 1574 | calgary_fixup_one_tce_space(dev); |