All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, stable@kernel.org
Subject: [PATCH 1/5] io-mapping: ensure io_mapping_map_atomic _is_ atomic
Date: Sat, 17 Sep 2011 20:55:45 +0200	[thread overview]
Message-ID: <1316285749-30130-2-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1316285749-30130-1-git-send-email-daniel.vetter@ffwll.ch>

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.

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

diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 8cdcc2a1..6b3bef1 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -138,12 +138,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

  reply	other threads:[~2011-09-17 19:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 18:55 [PATCH 0/5] Fixup pwrite/pread with gtt mmapped user addresses Daniel Vetter
2011-09-17 18:55 ` Daniel Vetter [this message]
2011-09-17 20:43   ` [PATCH 1/5] io-mapping: ensure io_mapping_map_atomic _is_ atomic Chris Wilson
2011-09-17 18:55 ` [PATCH 2/5] drm/i915: drop KM_USER0 argument to k(un)map_atomic Daniel Vetter
2011-09-17 20:44   ` Chris Wilson
2011-09-23 16:25   ` Daniel Vetter
2011-09-17 18:55 ` [PATCH 3/5] drm/i915: fall through pwrite_gtt_slow to the shmem slow path Daniel Vetter
2011-09-17 20:57   ` Chris Wilson
2011-09-20 11:35     ` Daniel Vetter
2011-10-30  8:35       ` Chris Wilson
2011-09-17 18:55 ` [PATCH 4/5] drm/i915: rewrite shmem_pwrite_slow to use copy_from_user Daniel Vetter
2011-09-17 20:52   ` Daniel Vetter
2011-09-17 21:00   ` Chris Wilson
2011-09-18  8:44     ` Daniel Vetter
2011-09-17 18:55 ` [PATCH 5/5] drm/i915: rewrite shmem_pread_slow to use copy_to_user Daniel Vetter
2011-09-17 21:04   ` Chris Wilson
2011-09-17 23:07 ` [PATCH 0/5] Fixup pwrite/pread with gtt mmapped user addresses Ben Widawsky
2011-10-20 21:14 ` Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316285749-30130-2-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.