From patchwork Thu Nov 17 02:57:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9433443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1516660469 for ; Thu, 17 Nov 2016 02:57:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 074BC2919B for ; Thu, 17 Nov 2016 02:57:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE24D2921F; Thu, 17 Nov 2016 02:57:47 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 523262919B for ; Thu, 17 Nov 2016 02:57:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD4E96E24D; Thu, 17 Nov 2016 02:57:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BBED6E252 for ; Thu, 17 Nov 2016 02:57:40 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id 144so10821082pfv.0 for ; Wed, 16 Nov 2016 18:57:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+sSn//J3yueUd/ZsR9gzzCJDWp1zmGmQILYGbNuUgeg=; b=KFRiNLk7x61GEHLuWrS4Cf3+w947DqeE6pj4yHzlZrgIpPwWkjVuzzX+/8VM/ykB7v vSP5ptal1myLP9Bqn9ot/nGr/6wNNTwSXLMcXDAu9jITn8hHmayTZGxo2nf42dHFubWC +C1p9FvwCk/7M72NDKNr1I+dzLtloOzj4lQjqb0LvEW+3TLhdJQSJF+sknbuwYCwH34L MFRLixqRCEBy/gg08TgdbzBx295UNs5c5aWYQn4TCUQ5zHdZtx7jNoZ6ysqjeOwhuYbq LFZFMhcP2lDhQVm54FKqWl+yuG5CYoZXg6EUXQIKOGCnW7aebzcEreD9UXMQDwKA9Dx9 Usyg== X-Gm-Message-State: ABUngvdENBCwMGMUrhQLJLP7TODXXK4WpkPt7fBgK6PRFkWhP3iwl7UCspa3JY6v5TGtZg== X-Received: by 10.98.0.143 with SMTP id 137mr1326125pfa.183.1479351459837; Wed, 16 Nov 2016 18:57:39 -0800 (PST) Received: from jade.nodan1.kt.home.ne.jp (202-72-64-164.koalanet.ne.jp. [202.72.64.164]) by smtp.gmail.com with ESMTPSA id l11sm1051219pfb.28.2016.11.16.18.57.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Nov 2016 18:57:38 -0800 (PST) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH] dma-buf/sync_file: enable signaling even with poll(.timeout=0) Date: Thu, 17 Nov 2016 11:57:30 +0900 Message-Id: <1479351450-3415-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 Cc: Gustavo Padovan X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan This reverts commit ecebca79f6976ddaddfd054d699272515869ea28. Do not enable fence callback on poll() when using fence_array causes the fence_array to not signal. For now we will revert the change and enable signaling everytime time poll is called with timeout=0 as well. Cc: Chris Wilson Signed-off-by: Gustavo Padovan --- drivers/dma-buf/sync_file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 69d8ef9..6d802f2 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -308,8 +308,7 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait) poll_wait(file, &sync_file->wq, wait); - if (!poll_does_not_wait(wait) && - !test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) { + if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) { if (dma_fence_add_callback(sync_file->fence, &sync_file->cb, fence_check_cb_func) < 0) wake_up_all(&sync_file->wq);