Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5867445ybv; Wed, 12 Feb 2020 01:37:16 -0800 (PST) X-Google-Smtp-Source: APXvYqw7cQYs5tYaqqkW9n0B6gtR0QztUBbDjKJKuzUZfemrCw6uFpyAsOjHspBep9AVJTtusx7k X-Received: by 2002:a05:6830:14c3:: with SMTP id t3mr8367272otq.213.1581500236094; Wed, 12 Feb 2020 01:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581500236; cv=none; d=google.com; s=arc-20160816; b=U95u6Dpc3D6MxARLieTeHeqKsXLgaMUqc8n/KqCg/bk9UwAFLCl3lTHIwC3hOh73/2 tnfFnduQS7SFL3YgLyK93T8u1IgRJqIATFNvOmJ57wI4ttKxdqfCDHt0LmkooODibE+0 whRmFbdG80X5ARiAsvN3SO8QB7SpMpvJjtWFpNq3enCxdh4t2ka/oI6T1GUwS0it8qyc uJQS6BjI6YwklJg/Fnn0SrJgC1g9Mn3gVP9PfkslW9Y6HC7dro5l9LBS05V63tZHEmZV qBSGUTpYsD9BzWZyVj3MeEL3COimV5g9+wxKcgSf3LxueNQUNXP0e+mhn7c3GZ8u2naE vLDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=Co8sI2fabCgvVIAdRsnaywT6jDF6jkLMvIt7c5U+e2k=; b=VTxH66FV7GT4ZN6ci0SpdiDRl+Hsf5pJ4Zx02ChxTHLfkovPEfmiVoM0kswl+bJwV6 HQMKxIPLCWz2YBTKza/kCEZjT4Z/oieMNRVCz7+Huk1Z9Ljh6AbYzBrry0lkEv9gIxFw M046bqEVyWUdJJ1EX03jRwBTX2GKsCPSuUhbhTJSFFWNRgzYgkzMiGqmb3Z4mHVI14y2 UGPE7gCWETOyhnCf1OiBltiwkMtUyGRhpyAUsgImA2ynJjqcEVvI+NXG9tbp+Xokj3Mt yPLFjih+0U1FVdn511wTlcmmNxyeITQj/IW1dsMehEVITFV+egbM/tnxOrpd/ke7NdBL SzVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HOsohDmK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si3251533otr.8.2020.02.12.01.36.59; Wed, 12 Feb 2020 01:37:16 -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=@redhat.com header.s=mimecast20190719 header.b=HOsohDmK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728842AbgBLJfx (ORCPT + 99 others); Wed, 12 Feb 2020 04:35:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39575 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728626AbgBLJfx (ORCPT ); Wed, 12 Feb 2020 04:35:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581500151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Co8sI2fabCgvVIAdRsnaywT6jDF6jkLMvIt7c5U+e2k=; b=HOsohDmKIpWVXo3nTz1n6nbguz1/epD8I/8KMiwh0nY0drVtNy236X+FzzHBhKMS5V9aCc 2g2zNqUx5gBJv0QVvFxOMeO2Y4A+Z4JjeW8Oi4lj60oYzjtf5gijaroTXqHNKMZOFvW91D IpTMmVtVrRLNJZSDiVvxWmInjq2QSS8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-KA2V6KLsMOaMd2oUQYkYQQ-1; Wed, 12 Feb 2020 04:35:45 -0500 X-MC-Unique: KA2V6KLsMOaMd2oUQYkYQQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC5C68017DF; Wed, 12 Feb 2020 09:35:44 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5ACBE60BF4; Wed, 12 Feb 2020 09:35:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 937FE9D6B; Wed, 12 Feb 2020 10:35:43 +0100 (CET) Date: Wed, 12 Feb 2020 10:35:43 +0100 From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org, olvaffe@gmail.com, gurchetansingh@chromium.org, David Airlie , "open list:VIRTIO GPU DRIVER" , open list Subject: Re: [PATCH v4] drm/virtio: add drm_driver.release callback. Message-ID: <20200212093543.qg4j2nk5wxlii7wr@sirius.home.kraxel.org> References: <20200211135805.24436-1-kraxel@redhat.com> <20200211142711.GE2363188@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211142711.GE2363188@phenom.ffwll.local> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 03:27:11PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:58:04PM +0100, Gerd Hoffmann wrote: > > Split virtio_gpu_deinit(), move the drm shutdown and release to > > virtio_gpu_release(). Drop vqs_ready variable, instead use > > drm_dev_{enter,exit,unplug} to avoid touching hardware after > > device removal. Tidy up here and there. > > > > v4: add changelog. > > v3: use drm_dev_*(). > > > > Signed-off-by: Gerd Hoffmann > > Looks reasonable I think. > > Reviewed-by: Daniel Vetter > > I didn't review whether you need more drm_dev_enter/exit pairs, virtio is > a bit more complex for that and I have no idea how exactly it works. virtio uses two rings to send commands to the device, one to move the cursor and one for everything else. So pretty much everything ends up calling either this ... > > @@ -330,7 +330,14 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev, ... or this ... > > @@ -460,12 +460,13 @@ static void virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev, ... to submit some request to the (virtual) hardware. Therefore we don't need many drm_dev_enter/exit pairs to cover everything ;) cheers, Gerd