diff options
author | Ramesh Gupta Guntha <grgupta@ti.com> | 2010-06-29 19:36:32 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:19:11 -0400 |
commit | b55ed4674d9d4a2c394e8105fa5bf8d83d770cd3 (patch) | |
tree | eea96b5a2ade71da2cb896fbbc6291cddaf6912f | |
parent | d54c08d8a8a5c5ac06724898172d95616b27825b (diff) |
IOMMU remove clock functions from iommu module
This patch removes the clk_enable/disable functions for
iommu functions, module auto idle should take care
of this.
Signed-off-by: Ramesh Gupta G<grgupta@ti.com>
-rw-r--r-- | arch/arm/plat-omap/iommu.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index 34fc31ee908..5ec694f18cd 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -107,11 +107,7 @@ static int iommu_enable(struct iommu *obj) | |||
107 | if (!arch_iommu) | 107 | if (!arch_iommu) |
108 | return -ENODEV; | 108 | return -ENODEV; |
109 | 109 | ||
110 | clk_enable(obj->clk); | ||
111 | |||
112 | err = arch_iommu->enable(obj); | 110 | err = arch_iommu->enable(obj); |
113 | |||
114 | clk_disable(obj->clk); | ||
115 | return err; | 111 | return err; |
116 | } | 112 | } |
117 | 113 | ||
@@ -119,12 +115,7 @@ static void iommu_disable(struct iommu *obj) | |||
119 | { | 115 | { |
120 | if (!obj) | 116 | if (!obj) |
121 | return; | 117 | return; |
122 | |||
123 | clk_enable(obj->clk); | ||
124 | |||
125 | arch_iommu->disable(obj); | 118 | arch_iommu->disable(obj); |
126 | |||
127 | clk_disable(obj->clk); | ||
128 | } | 119 | } |
129 | 120 | ||
130 | /* | 121 | /* |
@@ -247,8 +238,6 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | |||
247 | if (!obj || !obj->nr_tlb_entries || !e) | 238 | if (!obj || !obj->nr_tlb_entries || !e) |
248 | return -EINVAL; | 239 | return -EINVAL; |
249 | 240 | ||
250 | clk_enable(obj->clk); | ||
251 | |||
252 | iotlb_lock_get(obj, &l); | 241 | iotlb_lock_get(obj, &l); |
253 | if (l.base == obj->nr_tlb_entries) { | 242 | if (l.base == obj->nr_tlb_entries) { |
254 | dev_warn(obj->dev, "%s: preserve entries full\n", __func__); | 243 | dev_warn(obj->dev, "%s: preserve entries full\n", __func__); |
@@ -277,7 +266,6 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | |||
277 | 266 | ||
278 | cr = iotlb_alloc_cr(obj, e); | 267 | cr = iotlb_alloc_cr(obj, e); |
279 | if (IS_ERR(cr)) { | 268 | if (IS_ERR(cr)) { |
280 | clk_disable(obj->clk); | ||
281 | return PTR_ERR(cr); | 269 | return PTR_ERR(cr); |
282 | } | 270 | } |
283 | 271 | ||
@@ -291,7 +279,6 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e) | |||
291 | l.vict = l.base; | 279 | l.vict = l.base; |
292 | iotlb_lock_set(obj, &l); | 280 | iotlb_lock_set(obj, &l); |
293 | out: | 281 | out: |
294 | clk_disable(obj->clk); | ||
295 | return err; | 282 | return err; |
296 | } | 283 | } |
297 | EXPORT_SYMBOL_GPL(load_iotlb_entry); | 284 | EXPORT_SYMBOL_GPL(load_iotlb_entry); |
@@ -308,8 +295,6 @@ void flush_iotlb_page(struct iommu *obj, u32 da) | |||
308 | int i; | 295 | int i; |
309 | struct cr_regs cr; | 296 | struct cr_regs cr; |
310 | 297 | ||
311 | clk_enable(obj->clk); | ||
312 | |||
313 | for_each_iotlb_cr(obj, obj->nr_tlb_entries, i, cr) { | 298 | for_each_iotlb_cr(obj, obj->nr_tlb_entries, i, cr) { |
314 | u32 start; | 299 | u32 start; |
315 | size_t bytes; | 300 | size_t bytes; |
@@ -327,8 +312,6 @@ void flush_iotlb_page(struct iommu *obj, u32 da) | |||
327 | iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); | 312 | iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); |
328 | } | 313 | } |
329 | } | 314 | } |
330 | clk_disable(obj->clk); | ||
331 | |||
332 | if (i == obj->nr_tlb_entries) | 315 | if (i == obj->nr_tlb_entries) |
333 | dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da); | 316 | dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da); |
334 | } | 317 | } |
@@ -362,15 +345,10 @@ void flush_iotlb_all(struct iommu *obj) | |||
362 | { | 345 | { |
363 | struct iotlb_lock l; | 346 | struct iotlb_lock l; |
364 | 347 | ||
365 | clk_enable(obj->clk); | ||
366 | |||
367 | l.base = 0; | 348 | l.base = 0; |
368 | l.vict = 0; | 349 | l.vict = 0; |
369 | iotlb_lock_set(obj, &l); | 350 | iotlb_lock_set(obj, &l); |
370 | |||
371 | iommu_write_reg(obj, 1, MMU_GFLUSH); | 351 | iommu_write_reg(obj, 1, MMU_GFLUSH); |
372 | |||
373 | clk_disable(obj->clk); | ||
374 | } | 352 | } |
375 | EXPORT_SYMBOL_GPL(flush_iotlb_all); | 353 | EXPORT_SYMBOL_GPL(flush_iotlb_all); |
376 | 354 | ||
@@ -385,9 +363,7 @@ EXPORT_SYMBOL_GPL(flush_iotlb_all); | |||
385 | */ | 363 | */ |
386 | void iommu_set_twl(struct iommu *obj, bool on) | 364 | void iommu_set_twl(struct iommu *obj, bool on) |
387 | { | 365 | { |
388 | clk_enable(obj->clk); | ||
389 | arch_iommu->set_twl(obj, on); | 366 | arch_iommu->set_twl(obj, on); |
390 | clk_disable(obj->clk); | ||
391 | } | 367 | } |
392 | EXPORT_SYMBOL_GPL(iommu_set_twl); | 368 | EXPORT_SYMBOL_GPL(iommu_set_twl); |
393 | 369 | ||
@@ -398,12 +374,7 @@ ssize_t iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t bytes) | |||
398 | if (!obj || !buf) | 374 | if (!obj || !buf) |
399 | return -EINVAL; | 375 | return -EINVAL; |
400 | 376 | ||
401 | clk_enable(obj->clk); | ||
402 | |||
403 | bytes = arch_iommu->dump_ctx(obj, buf, bytes); | 377 | bytes = arch_iommu->dump_ctx(obj, buf, bytes); |
404 | |||
405 | clk_disable(obj->clk); | ||
406 | |||
407 | return bytes; | 378 | return bytes; |
408 | } | 379 | } |
409 | EXPORT_SYMBOL_GPL(iommu_dump_ctx); | 380 | EXPORT_SYMBOL_GPL(iommu_dump_ctx); |
@@ -415,9 +386,7 @@ static int __dump_tlb_entries(struct iommu *obj, struct cr_regs *crs, int num) | |||
415 | struct cr_regs tmp; | 386 | struct cr_regs tmp; |
416 | struct cr_regs *p = crs; | 387 | struct cr_regs *p = crs; |
417 | 388 | ||
418 | clk_enable(obj->clk); | ||
419 | iotlb_lock_get(obj, &saved); | 389 | iotlb_lock_get(obj, &saved); |
420 | |||
421 | for_each_iotlb_cr(obj, num, i, tmp) { | 390 | for_each_iotlb_cr(obj, num, i, tmp) { |
422 | if (!iotlb_cr_valid(&tmp)) | 391 | if (!iotlb_cr_valid(&tmp)) |
423 | continue; | 392 | continue; |
@@ -425,8 +394,6 @@ static int __dump_tlb_entries(struct iommu *obj, struct cr_regs *crs, int num) | |||
425 | } | 394 | } |
426 | 395 | ||
427 | iotlb_lock_set(obj, &saved); | 396 | iotlb_lock_set(obj, &saved); |
428 | clk_disable(obj->clk); | ||
429 | |||
430 | return p - crs; | 397 | return p - crs; |
431 | } | 398 | } |
432 | 399 | ||
@@ -790,9 +757,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data) | |||
790 | if (!obj->refcount) | 757 | if (!obj->refcount) |
791 | return IRQ_NONE; | 758 | return IRQ_NONE; |
792 | 759 | ||
793 | clk_enable(obj->clk); | ||
794 | errs = iommu_report_fault(obj, &da); | 760 | errs = iommu_report_fault(obj, &da); |
795 | clk_disable(obj->clk); | ||
796 | if (errs == 0) | 761 | if (errs == 0) |
797 | return IRQ_HANDLED; | 762 | return IRQ_HANDLED; |
798 | 763 | ||
@@ -860,28 +825,23 @@ struct iommu *iommu_get(const char *name) | |||
860 | int err = -ENOMEM; | 825 | int err = -ENOMEM; |
861 | struct device *dev; | 826 | struct device *dev; |
862 | struct iommu *obj; | 827 | struct iommu *obj; |
863 | |||
864 | dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name, | 828 | dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name, |
865 | device_match_by_alias); | 829 | device_match_by_alias); |
866 | if (!dev) | 830 | if (!dev) |
867 | return ERR_PTR(-ENODEV); | 831 | return ERR_PTR(-ENODEV); |
868 | |||
869 | obj = to_iommu(dev); | 832 | obj = to_iommu(dev); |
870 | 833 | ||
871 | mutex_lock(&obj->iommu_lock); | 834 | mutex_lock(&obj->iommu_lock); |
872 | |||
873 | if (obj->refcount++ == 0) { | 835 | if (obj->refcount++ == 0) { |
874 | err = iommu_enable(obj); | 836 | err = iommu_enable(obj); |
875 | if (err) | 837 | if (err) |
876 | goto err_enable; | 838 | goto err_enable; |
877 | flush_iotlb_all(obj); | 839 | flush_iotlb_all(obj); |
878 | } | 840 | } |
879 | |||
880 | if (!try_module_get(obj->owner)) | 841 | if (!try_module_get(obj->owner)) |
881 | goto err_module; | 842 | goto err_module; |
882 | 843 | ||
883 | mutex_unlock(&obj->iommu_lock); | 844 | mutex_unlock(&obj->iommu_lock); |
884 | |||
885 | dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name); | 845 | dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name); |
886 | return obj; | 846 | return obj; |
887 | 847 | ||