From patchwork Tue Oct 30 17:36:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10661331 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 161541734 for ; Tue, 30 Oct 2018 17:37:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED6EC2A8A8 for ; Tue, 30 Oct 2018 17:37:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF9252A9A9; Tue, 30 Oct 2018 17:37:21 +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 994942A8A8 for ; Tue, 30 Oct 2018 17:37:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E9E46E145; Tue, 30 Oct 2018 17:37:20 +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 207C56E145 for ; Tue, 30 Oct 2018 17:37:19 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id q5-v6so2306781pgv.0 for ; Tue, 30 Oct 2018 10:37:19 -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:in-reply-to :references; bh=9TrjR5u7umRMFJANXEkKIAozEZcbFTTxTcMkfePfiTk=; b=OoYW/A2z2hWsNeH//ofGS3WzdK7YBS6moSptHIYHMPRQajZ1qzlyrMSLHqJLuaIXCf FuoLAi1eSjySarat8ed2MnIsGr5an+NpTXnxh9WmI0iRlRjfwO13I0aP6Yc1urgm8ABg i8hwSnHRKLHdksojCC+I3spBsMPdeDy6cMyKdW3VNMmDACC8ZesmuAVIheXEw3q4pLRI wU4Ibrp81B5NbDuB//iUWYiKmzDcY977w6LqdWjhLZb5fRDU5Ub04P+atJUfyHEKiJsy 1uIYMlXW14seTZbwOmzTnAX/HR6lLVMyfnr9dOLwX1Ln13WBmkpgYL/I8Vlr6tfLeiiX cFtQ== X-Gm-Message-State: AGRZ1gIxMfXM41rimRU1T4iJk6KN38jmFiSbR20b5S99eYZkDyJA1X0u X/NuYPNNjaKpPZOGHGBlidyPada0Uz8= X-Google-Smtp-Source: AJdET5dXfNJ/217Bb+eW/F+oOAzedThSTuAuPBm21eS4XgqF8k6mENjKuWNpuGKbMEW41fw46tMz0w== X-Received: by 2002:a63:6ec4:: with SMTP id j187-v6mr19219257pgc.3.1540921038240; Tue, 30 Oct 2018 10:37:18 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:c9f6:e96:6490:6ba0]) by smtp.gmail.com with ESMTPSA id l2-v6sm24183281pgp.20.2018.10.30.10.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Oct 2018 10:37:17 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH] udmabuf: set read/write flag when exporting Date: Tue, 30 Oct 2018 10:36:59 -0700 Message-Id: <20181030173659.975-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181030061932.tdwbeiujv6o7li4o@sirius.home.kraxel.org> References: <20181030061932.tdwbeiujv6o7li4o@sirius.home.kraxel.org> 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: 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. Signed-off-by: Gurchetan Singh --- 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)) {