aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/io-mapping.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-09-28 05:57:23 -0400
committerKeith Packard <keithp@keithp.com>2011-10-20 18:26:17 -0400
commit24dd85ff723f142093f44244764b9b5c152235b8 (patch)
tree142aaa2cf68b307e584ed1ba9f40a951ae46828c /include/linux/io-mapping.h
parent8ffc02468145ac92b1b88896e0f18bd7bcd52591 (diff)
io-mapping: ensure io_mapping_map_atomic _is_ atomic
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> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include/linux/io-mapping.h')
-rw-r--r--include/linux/io-mapping.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 8cdcc2a199ad..1feeb5263565 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -117,6 +117,8 @@ io_mapping_unmap(void __iomem *vaddr)
117 117
118#else 118#else
119 119
120#include <linux/uaccess.h>
121
120/* this struct isn't actually defined anywhere */ 122/* this struct isn't actually defined anywhere */
121struct io_mapping; 123struct io_mapping;
122 124
@@ -138,12 +140,14 @@ static inline void __iomem *
138io_mapping_map_atomic_wc(struct io_mapping *mapping, 140io_mapping_map_atomic_wc(struct io_mapping *mapping,
139 unsigned long offset) 141 unsigned long offset)
140{ 142{
143 pagefault_disable();
141 return ((char __force __iomem *) mapping) + offset; 144 return ((char __force __iomem *) mapping) + offset;
142} 145}
143 146
144static inline void 147static inline void
145io_mapping_unmap_atomic(void __iomem *vaddr) 148io_mapping_unmap_atomic(void __iomem *vaddr)
146{ 149{
150 pagefault_enable();
147} 151}
148 152
149/* Non-atomic map/unmap */ 153/* Non-atomic map/unmap */