Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8462172ybl; Thu, 16 Jan 2020 17:19:59 -0800 (PST) X-Google-Smtp-Source: APXvYqw3G7R/F6222xHhHROnBURTk6hzP9Wc03JT0YMHxfkhE1P5XoWeNsQg27f7tevWBfRY/p8v X-Received: by 2002:a05:6808:3c2:: with SMTP id o2mr1664818oie.45.1579223999801; Thu, 16 Jan 2020 17:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579223999; cv=none; d=google.com; s=arc-20160816; b=dBUH2HUVv3esOVJUjWPLcymTBLOSD5FNdP8EclPHLsuWd+ovb6ZV+Kf/9l3rS2VvaP DYTyTGjhdHUqLg+6zygvfFzV6K8g95bKsVkfaOtP+qVWF6RpAgKonCMaqVVp9RyCd7ZU 2K1bV/3uS3yVNQ3aW4hWbYle0qAgqdkl/XDMO/1Nv28tHyXLrvjTbpj1hX/sEUQRNWOF ujrIOdLyiiT/+4pq3DatNPSK1PaRXdnZJq4S0Vs826+Lv/j7tGGrSNDZrMrvFMTo6WUd JG6pZuMPuEY+t3lhtg5G/Ckig6j3NRBYsi0cAUnpKItpIatSOcyVfHq6qL89G3QU4TlV 0JvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ruSsRBZ6uBE9CWbZdGtxpMryzL4J/ngUL6zfcBYfaHE=; b=xOrUcTnXdSB3jpPKA53u3Mnuf4kLdCkFCU3Ha6nFsyzA4aFQIdIB6b/abg++GdmWiX 50fgO9mwA1HmAD/jmk9VX0xkDXEfa0uPMd61LxTxCV3J4fXtlAxzFUb2OlMm6EX8u5AA VNVdZ7Y/aZVrKO+UtGmJmgHcVX7Lifdvkwq5k76gQXDZpYbha7LavnD5TKJeZnddvm4P FKOqgesTo7I7xVrji2HI+LW8+BoxxSg5DEMYYf7IssKeKRuR88Y69tSOLsH7oX7OEWvq LNcUzj7OQsKHWj0rozp3Z/6gST6fW04yjWM77bw0AAXDcWqKTL4R0MvsW1eD4lnDiJds D7wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8n7NxMG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si12958796oif.211.2020.01.16.17.19.47; Thu, 16 Jan 2020 17:19:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8n7NxMG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgAPXYo (ORCPT + 99 others); Thu, 16 Jan 2020 18:24:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:53864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388054AbgAPXYl (ORCPT ); Thu, 16 Jan 2020 18:24:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BC6A20748; Thu, 16 Jan 2020 23:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217081; bh=r+x76sD36E+bLkWQym59zq8FtZSERquePm26s+owZXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8n7NxMG0RVxMEEZdcHGVsB1/59SseMV8yxszAP0Y829K8GITdaB4gHv7xaIbOKMj 9zvlO/C3lMObibELEgfjVw1UsVk32xjB3ivANZqBALDNkdNsxWKSkQCkhZkMhmlva1 D1sSsgAF39ecpue4Liy0oO463LJogIxtKGhdGn3I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gerd Hoffmann , Daniel Vetter , Chia-I Wu , Sasha Levin Subject: [PATCH 5.4 124/203] Revert "drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper." Date: Fri, 17 Jan 2020 00:17:21 +0100 Message-Id: <20200116231756.104058057@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman This reverts commit e6733ec8948475c4b62574e452135dc629294d75 which is commit 29cf12394c0565d7eb1685bf0c1b4749aa6a8b66 upstream. Alistair writes: After updating to 5.4.7 we noticed that virtio_gpu's wait ioctl stopped working correctly. It looks like 29cf12394c05 ("drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.") was picked up automatically, but it depends on 889165ad6190 ("drm/virtio: pass gem reservation object to ttm init") from earlier in Gerd's series in Linus's tree, which was not picked up. Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: Chia-I Wu Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -463,29 +463,25 @@ out: } static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data, - struct drm_file *file) + struct drm_file *file) { struct drm_virtgpu_3d_wait *args = data; - struct drm_gem_object *obj; - long timeout = 15 * HZ; + struct drm_gem_object *gobj = NULL; + struct virtio_gpu_object *qobj = NULL; int ret; + bool nowait = false; - obj = drm_gem_object_lookup(file, args->handle); - if (obj == NULL) + gobj = drm_gem_object_lookup(file, args->handle); + if (gobj == NULL) return -ENOENT; - if (args->flags & VIRTGPU_WAIT_NOWAIT) { - ret = dma_resv_test_signaled_rcu(obj->resv, true); - } else { - ret = dma_resv_wait_timeout_rcu(obj->resv, true, true, - timeout); - } - if (ret == 0) - ret = -EBUSY; - else if (ret > 0) - ret = 0; + qobj = gem_to_virtio_gpu_obj(gobj); - drm_gem_object_put_unlocked(obj); + if (args->flags & VIRTGPU_WAIT_NOWAIT) + nowait = true; + ret = virtio_gpu_object_wait(qobj, nowait); + + drm_gem_object_put_unlocked(gobj); return ret; }