Skip to content

Commit

Permalink
powerpc/kernel: Avoid preemption check in iommu_range_alloc()
Browse files Browse the repository at this point in the history
Replace the __this_cpu_read() with raw_cpu_read() in
iommu_range_alloc(). Otherwise we get a warning about using
__this_cpu_read() in preemptible code:

  BUG: using __this_cpu_read() in preemptible
  caller is iommu_range_alloc+0xa8/0x3d0

Preemption doesn't need to be disabled since according to the comment
any CPU can safely use any IOMMU pool.

Signed-off-by: Victor Aoqui <victora@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Victor Aoqui authored and Michael Ellerman committed Aug 1, 2017
1 parent 24be85a commit 75f327c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static unsigned long iommu_range_alloc(struct device *dev,
* We don't need to disable preemption here because any CPU can
* safely use any IOMMU pool.
*/
pool_nr = __this_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1);
pool_nr = raw_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1);

if (largealloc)
pool = &(tbl->large_pool);
Expand Down

0 comments on commit 75f327c

Please sign in to comment.