From patchwork Sun Oct 20 16:10:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 3073431 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 180CBBF924 for ; Sun, 20 Oct 2013 16:17:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E7B12020A for ; Sun, 20 Oct 2013 16:17:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 29A36201CE for ; Sun, 20 Oct 2013 16:17:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DEC7E7129 for ; Sun, 20 Oct 2013 09:17:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) by gabe.freedesktop.org (Postfix) with ESMTP id D4BE6E627A for ; Sun, 20 Oct 2013 09:11:22 -0700 (PDT) Received: by mail-qc0-f176.google.com with SMTP id s19so2436657qcw.7 for ; Sun, 20 Oct 2013 09:11:22 -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:in-reply-to:references; bh=aKY7fzQAh1x95TYY85ERk6/F7UYg/rTsZ3XN1Ww/kFA=; b=aGW2fGKgQP9WcPn108svo2sJPKZYKgZa39RLLNujbOzcNZRxsTXtTbDbGbb08wvfr2 wCbRWgFmqHsdWNnliFW+PX3p1NbxusqZB6kLnTqwN6wpbnWvsieWIzzqTDkF5PoGFs46 ESH9md+O+uIg3mGbTUU96vj9xunMCT+u+pQMlL4saE4FWng0mKarCMIL9ba+TK1gqWqi c4kxqi/rrfGpVTpudnssj2Q8hVkZDism65u0BBC0aGu7F31vi5fW7tXTfGGnF6GJaMQP Ia+dyQH/HekAfOFF5TiCDFwghk1nsLYTKmfcDW5CoAEpsP4BD7qp7qh+Vzqa2W+isyQ7 hqTA== X-Received: by 10.224.37.198 with SMTP id y6mr2856324qad.104.1382285482504; Sun, 20 Oct 2013 09:11:22 -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 n7sm28422750qai.1.2013.10.20.09.11.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Oct 2013 09:11:22 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/msm: EBUSY status handling in msm_gem_fault() Date: Sun, 20 Oct 2013 12:10:59 -0400 Message-Id: <1382285459-21490-7-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382285459-21490-1-git-send-email-robdclark@gmail.com> References: <1382285459-21490-1-git-send-email-robdclark@gmail.com> Cc: linux-arm-msm@vger.kernel.org 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/msm/msm_gem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 291939d..e587d25 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -178,6 +178,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;