From patchwork Thu Dec 6 18:21:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leann Ogasawara X-Patchwork-Id: 204296 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 B7E902C00DB for ; Fri, 7 Dec 2012 05:21:24 +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 1Tgg4P-0003sw-UJ; Thu, 06 Dec 2012 18:21:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tgg4M-0003s7-4K for kernel-team@lists.ubuntu.com; Thu, 06 Dec 2012 18:21:10 +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 1Tgg4L-0004Cu-TE for kernel-team@lists.ubuntu.com; Thu, 06 Dec 2012 18:21:10 +0000 Received: by adamo (Postfix, from userid 1000) id A6231205FC; Thu, 6 Dec 2012 10:21:03 -0800 (PST) From: leann.ogasawara@canonical.com To: kernel-team@lists.ubuntu.com Subject: [Precise][SRU][PATCH 2/2] drm/i915: EBUSY status handling added to i915_gem_fault(). Date: Thu, 6 Dec 2012 10:21:03 -0800 Message-Id: <7732724c87efabff6258732a13a934946bc6b8b1.1354815357.git.leann.ogasawara@canonical.com> 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 dbe4dbe..5950ba3 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1259,6 +1259,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;