From patchwork Thu Dec 6 18:21:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leann Ogasawara X-Patchwork-Id: 204298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 94A4A2C00B9 for ; Fri, 7 Dec 2012 05:22:12 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tgg5F-0004EW-Op; Thu, 06 Dec 2012 18:22:05 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tgg59-0004CZ-V5 for kernel-team@lists.ubuntu.com; Thu, 06 Dec 2012 18:22:00 +0000 Received: from c-67-171-179-115.hsd1.or.comcast.net ([67.171.179.115] helo=adamo) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Tgg59-0004EI-Od; Thu, 06 Dec 2012 18:21:59 +0000 Received: by adamo (Postfix, from userid 1000) id 8E52D20AA7; Thu, 6 Dec 2012 10:21:54 -0800 (PST) From: leann.ogasawara@canonical.com To: kernel-team@lists.ubuntu.com Subject: [Quantal][SRU][PATCH 1/1] drm/i915: EBUSY status handling added to i915_gem_fault(). Date: Thu, 6 Dec 2012 10:21:54 -0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Dmitry Rogozhkin BugLink: http://bugs.launchpad.net/bugs/1087302 Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS. Note that this fixes i-g-t/tests/gem_threaded_tiled_access. Tested-by: Mika Kuoppala Signed-off-by: Dmitry Rogozhkin Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter (cherry picked from commit e79e0fe380847493266fba557217e2773c61bd1b) Signed-off-by: Leann Ogasawara --- drivers/gpu/drm/i915/i915_gem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index e4d0187..4406603 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1144,6 +1144,11 @@ out: case 0: case -ERESTARTSYS: case -EINTR: + case -EBUSY: + /* + * EBUSY is ok: this just means that another thread + * already did the job. + */ return VM_FAULT_NOPAGE; case -ENOMEM: return VM_FAULT_OOM;