diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2017-09-21 11:21:40 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2017-11-06 13:24:35 -0500 |
commit | 94e2cc4dba39efbb63e84cd4f7243627c16ceac5 (patch) | |
tree | 175fe887e65dc3029129904b2130ace1b23ebb70 /drivers | |
parent | a593472591a5cf2d91244bc3f319c9dd91119343 (diff) |
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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/iova.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 84bda3a4dafc..466aaa8ba841 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c | |||
@@ -542,7 +542,7 @@ void queue_iova(struct iova_domain *iovad, | |||
542 | unsigned long pfn, unsigned long pages, | 542 | unsigned long pfn, unsigned long pages, |
543 | unsigned long data) | 543 | unsigned long data) |
544 | { | 544 | { |
545 | struct iova_fq *fq = get_cpu_ptr(iovad->fq); | 545 | struct iova_fq *fq = raw_cpu_ptr(iovad->fq); |
546 | unsigned long flags; | 546 | unsigned long flags; |
547 | unsigned idx; | 547 | unsigned idx; |
548 | 548 | ||
@@ -572,8 +572,6 @@ void queue_iova(struct iova_domain *iovad, | |||
572 | if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0) | 572 | if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0) |
573 | mod_timer(&iovad->fq_timer, | 573 | mod_timer(&iovad->fq_timer, |
574 | jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT)); | 574 | jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT)); |
575 | |||
576 | put_cpu_ptr(iovad->fq); | ||
577 | } | 575 | } |
578 | EXPORT_SYMBOL_GPL(queue_iova); | 576 | EXPORT_SYMBOL_GPL(queue_iova); |
579 | 577 | ||