All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] io-mapping: ensure io_mapping_map_atomic _is_ atomic
@ 2011-09-28  9:57 Daniel Vetter
  2011-09-28  9:57 ` [PATCH 2/2] drm/i915: properly prefault for pread/pwrite Daniel Vetter
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Vetter @ 2011-09-28  9:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, stable

For the !HAVE_ATOMIC_IOMAP case the stub functions did not call
pagefault_disable/_enable. The i915 driver relies on the map
actually being atomic, otherwise it can deadlock with it's own
pagefault handler in the gtt pwrite fastpath.

This is exercised by gem_mmap_gtt from the intel-gpu-toosl gem
testsuite.

v2: Chris Wilson noted the lack of an include.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38115
Cc: stable@kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 include/linux/io-mapping.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 8cdcc2a1..1feeb52 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -117,6 +117,8 @@ io_mapping_unmap(void __iomem *vaddr)
 
 #else
 
+#include <linux/uaccess.h>
+
 /* this struct isn't actually defined anywhere */
 struct io_mapping;
 
@@ -138,12 +140,14 @@ static inline void __iomem *
 io_mapping_map_atomic_wc(struct io_mapping *mapping,
 			 unsigned long offset)
 {
+	pagefault_disable();
 	return ((char __force __iomem *) mapping) + offset;
 }
 
 static inline void
 io_mapping_unmap_atomic(void __iomem *vaddr)
 {
+	pagefault_enable();
 }
 
 /* Non-atomic map/unmap */
-- 
1.7.6.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-11-18 17:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28  9:57 [PATCH 1/2] io-mapping: ensure io_mapping_map_atomic _is_ atomic Daniel Vetter
2011-09-28  9:57 ` [PATCH 2/2] drm/i915: properly prefault for pread/pwrite Daniel Vetter
2011-09-28 11:24   ` Chris Wilson
2011-10-23 10:18     ` Daniel Vetter
2011-10-23 10:19       ` Daniel Vetter
2011-10-23 19:23       ` Keith Packard
2011-10-23 22:11         ` Daniel Vetter
2011-11-03 21:06           ` [Intel-gfx] " Keith Packard
2011-11-03 21:06             ` Keith Packard
2011-11-03 22:10             ` [Intel-gfx] " Daniel Vetter
2011-11-03 22:10               ` Daniel Vetter
2011-11-17 20:52   ` Keith Packard
2011-11-18  9:12     ` Daniel Vetter
2011-11-18 17:42       ` Keith Packard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.