From patchwork Wed Oct 3 14:15:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 1541671 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id E67283FD9C for ; Wed, 3 Oct 2012 14:15:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4DFDA02C8 for ; Wed, 3 Oct 2012 07:15:38 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 4196B9E997 for ; Wed, 3 Oct 2012 07:15:29 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 03 Oct 2012 07:15:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,528,1344236400"; d="scan'208";a="219130010" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.92]) by orsmga002.jf.intel.com with ESMTP; 03 Oct 2012 07:15:27 -0700 Received: by rosetta (Postfix, from userid 1000) id 773E56416B8; Wed, 3 Oct 2012 17:15:27 +0300 (EEST) From: mika.kuoppala@intel.com To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Oct 2012 17:15:26 +0300 Message-Id: <1349273727-14362-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349270822-29740-1-git-send-email-mika.kuoppala@intel.com> References: <1349270822-29740-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault(). X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Dmitry Rogozhkin 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. Tested-by: Mika Kuoppala Signed-off-by: Dmitry Rogozhkin Reviewed-by: Chris Wilson --- 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 274d25d..2b14716 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1158,6 +1158,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;