From patchwork Tue Oct 30 01:32:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10660415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECB1A14DE for ; Tue, 30 Oct 2018 01:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA6F42961A for ; Tue, 30 Oct 2018 01:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBB0B29636; Tue, 30 Oct 2018 01:32:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7FF622961A for ; Tue, 30 Oct 2018 01:32:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA43489762; Tue, 30 Oct 2018 01:32:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id EDB2189762 for ; Tue, 30 Oct 2018 01:32:45 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id s3-v6so4770987pga.12 for ; Mon, 29 Oct 2018 18:32:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=g39jmXd8ZMSSDCvQSvdDyjwSUpRex7ra8yBANYLllYc=; b=RqqBhh0pixlCybwO76OXlESqxcl+ZdX+WVlu5aBNPKzwnC6CTH5NM/0AeVUm81IBOr Eay6y0YRksCHqJib2Z0G9R6q6NRWUZHCOZzswJfGx4ASHnp3Yi7hpAuf5zI9/AN8XIb7 mmc5SkaQDCrrb5xc47z3MxIRXvaKHPHcJBvwjjJEF4q0yih5zCJfbH4KH1Upo6QLYtaV be5o3jESEeeb9TMgEXwWncTd6dWj+5Vhqlrce80ciOw+8QCaVnYd5Ps47jLCCBGDhras PNDs5SrUSZxlHqaxujBEoUWaiG/OK+Nqzm9Oh/TP66vMdfvtQbDgBGda6Esk9wILZZm6 7SSg== X-Gm-Message-State: AGRZ1gLyIuFTA7DI4EDpi1JsZNN30F6nGUyoSAx83sCmQl0gOvFHAcTf lkwKeXHMeTmg+KQg3rS9YMzn/HvIAxk= X-Google-Smtp-Source: AJdET5fNtRP5K6YNEoGcNGaWF1Is482w2bRG/RnCUOVotqHn+t8Rsq5WiS5tc/qd9VQDRceXeIDFDw== X-Received: by 2002:a62:8a0d:: with SMTP id y13-v6mr826774pfd.142.1540863165297; Mon, 29 Oct 2018 18:32:45 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:c9f6:e96:6490:6ba0]) by smtp.gmail.com with ESMTPSA id q26-v6sm27811732pfi.165.2018.10.29.18.32.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Oct 2018 18:32:44 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH] udmabuf: set read/write flag when exporting Date: Mon, 29 Oct 2018 18:32:37 -0700 Message-Id: <20181030013237.58933-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.16.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kraxel@redhat.com, Gurchetan Singh MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Otherwise, mmap fails when done with PROT_WRITE. --- drivers/dma-buf/udmabuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 5b44ef226904..fc359ca4503d 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -184,6 +184,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, exp_info.ops = &udmabuf_ops; exp_info.size = ubuf->pagecount << PAGE_SHIFT; exp_info.priv = ubuf; + exp_info.flags = O_RDWR; buf = dma_buf_export(&exp_info); if (IS_ERR(buf)) {