Commit 94e2cc4d authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Alex Williamson

iommu/iova: Use raw_cpu_ptr() instead of get_cpu_ptr() for ->fq

get_cpu_ptr() disabled preemption and returns the ->fq object of the
current CPU. raw_cpu_ptr() does the same except that it not disable
preemption which means the scheduler can move it to another CPU after it
obtained the per-CPU object.
In this case this is not bad because the data structure itself is
protected with a spin_lock. This change shouldn't matter however on RT
it does because the sleeping lock can't be accessed with disabled
preemption.

Cc: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Reported-by: vinadhy@gmail.com
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent a5934725
...@@ -542,7 +542,7 @@ void queue_iova(struct iova_domain *iovad, ...@@ -542,7 +542,7 @@ void queue_iova(struct iova_domain *iovad,
unsigned long pfn, unsigned long pages, unsigned long pfn, unsigned long pages,
unsigned long data) unsigned long data)
{ {
struct iova_fq *fq = get_cpu_ptr(iovad->fq); struct iova_fq *fq = raw_cpu_ptr(iovad->fq);
unsigned long flags; unsigned long flags;
unsigned idx; unsigned idx;
...@@ -572,8 +572,6 @@ void queue_iova(struct iova_domain *iovad, ...@@ -572,8 +572,6 @@ void queue_iova(struct iova_domain *iovad,
if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0) if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0)
mod_timer(&iovad->fq_timer, mod_timer(&iovad->fq_timer,
jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT)); jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT));
put_cpu_ptr(iovad->fq);
} }
EXPORT_SYMBOL_GPL(queue_iova); EXPORT_SYMBOL_GPL(queue_iova);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment