From patchwork Sun Oct 20 16:07:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 3073301 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55DB8BF924 for ; Sun, 20 Oct 2013 16:08:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AB1820377 for ; Sun, 20 Oct 2013 16:08:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 29AE82037B for ; Sun, 20 Oct 2013 16:08:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E49EE5E9E for ; Sun, 20 Oct 2013 09:08:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) by gabe.freedesktop.org (Postfix) with ESMTP id C99B7E5E9E for ; Sun, 20 Oct 2013 09:07:52 -0700 (PDT) Received: by mail-qa0-f48.google.com with SMTP id k4so1922122qaq.0 for ; Sun, 20 Oct 2013 09:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=iLx3obPe5+6u6uex6pTlSLE0dhLg+gds5RBcX0v+Rds=; b=bKdFGh1NcYhvJuNwKxlSLOTpFAC9zPMMTD2PMscepj+iYhvmgqFR+8MvWqJ5EhDyJu /1J+IPpFd/fyBm7o2LaZpWFF85te81gYNyZ8lnf8IQbGFcato/irT8soGh2yLpD6h6EF l6VRxzOiKvBbkDn7m4USRZBXVRm1Tyeem2kKXEPSkV05U2aY+FR+aGTWQyxLi3JNLzxB yIDWexXB8gq50O8rq2mYJmaDj1N0ujMM4p26VXoobOKVj7/ebU4CUipFePrun3FVHaei 8vbLNUsu5H6NN84r6UlUtm8lCvpdlm/eERcPsW16AMXifQO/k9GoIhiPYQVa4HmeDqEe ksxg== X-Received: by 10.224.12.145 with SMTP id x17mr2437944qax.110.1382285268386; Sun, 20 Oct 2013 09:07:48 -0700 (PDT) Received: from localhost (pool-108-20-248-111.bstnma.east.verizon.net. [108.20.248.111]) by mx.google.com with ESMTPSA id x1sm28358162qai.6.2013.10.20.09.07.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Oct 2013 09:07:47 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/omap: EBUSY status handling in omap_gem_fault() Date: Sun, 20 Oct 2013 12:07:42 -0400 Message-Id: <1382285262-21299-1-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.3.1 Cc: Kiran X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. See e79e0fe3 Signed-off-by: Rob Clark --- drivers/gpu/drm/omapdrm/omap_gem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 533f6eb..435c6b1 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -542,6 +542,11 @@ fail: 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;