Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313640
b: refs/heads/master
c: c1703e8
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Jul 3, 2012
1 parent 263b836 commit 0329830
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3f271e86e5a440713716bb222e1aa1227994c50
refs/heads/master: c1703e85a7b20ffcefd5360e2542460737ecc15c
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,15 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
long l, limit;
long tcenum_start = tcenum, npages_start = npages;
int ret = 0;
unsigned long flags;

if (npages == 1) {
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction, attrs);
}

local_irq_save(flags); /* to protect tcep and the page behind it */

tcep = __get_cpu_var(tce_page);

/* This is safe to do since interrupts are off when we're called
Expand All @@ -207,6 +210,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
tcep = (u64 *)__get_free_page(GFP_ATOMIC);
/* If allocation fails, fall back to the loop implementation */
if (!tcep) {
local_irq_restore(flags);
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction, attrs);
}
Expand Down Expand Up @@ -240,6 +244,8 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
tcenum += limit;
} while (npages > 0 && !rc);

local_irq_restore(flags);

if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) {
ret = (int)rc;
tce_freemulti_pSeriesLP(tbl, tcenum_start,
Expand Down

0 comments on commit 0329830

Please sign in to comment.