tegrakernel/kernel/kernel-4.9/rt-patches/0086-mm-scatterlist-Do-not-...

50 lines
1.5 KiB
Diff

From e11b70d460260fac71ce7efc575fa72df5579bcb Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 3 Jul 2009 08:44:34 -0500
Subject: [PATCH 086/365] mm/scatterlist: Do not disable irqs on RT
The local_irq_save() is not only used to get things done "fast" but
also to ensure that in case of SG_MITER_ATOMIC we are in "atomic"
context for kmap_atomic(). For -RT it is enough to keep pagefault
disabled (which is currently handled by kmap_atomic()).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
lib/scatterlist.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 00e02ebb3666..4608b8e0891f 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -630,7 +630,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
flush_kernel_dcache_page(miter->page);
if (miter->__flags & SG_MITER_ATOMIC) {
- WARN_ON_ONCE(preemptible());
+ WARN_ON_ONCE(!pagefault_disabled());
kunmap_atomic(miter->addr);
} else
kunmap(miter->page);
@@ -674,7 +674,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
if (!sg_miter_skip(&miter, skip))
return false;
- local_irq_save(flags);
+ local_irq_save_nort(flags);
while (sg_miter_next(&miter) && offset < buflen) {
unsigned int len;
@@ -691,7 +691,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
sg_miter_stop(&miter);
- local_irq_restore(flags);
+ local_irq_restore_nort(flags);
return offset;
}
EXPORT_SYMBOL(sg_copy_buffer);
--
2.28.0