Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1172318ybv; Wed, 5 Feb 2020 22:47:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxa1USSv5HEkkTmZ9pQgCbdmUE/bY4sK/TOfiCwueyAy2phpKXj4dB/p5dcuj6aGa3Tc445 X-Received: by 2002:a9d:7b4e:: with SMTP id f14mr29230196oto.355.1580971645274; Wed, 05 Feb 2020 22:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580971645; cv=none; d=google.com; s=arc-20160816; b=Rvq5thZAUz7m8GWEjm5Qi3i8weETlIPLE+B1AFonqtBnfM1VYzPWE/d1iyAslj6npq g/L5gt3uEAq9IVHqOFpoJ9MxU74oZC+3Rw239TkcFgiUna5hNeBd4GtggReLu8oGGpo3 1MyO8tHS+3NlgXpoeZsaxXdKzqzrPVt68jEPT7jNrekMKPwJOFRPQjTyDDUxugPN39s5 um1d6Kh+VwSotb8aRrWKPmQUSPknBPFm5Kjzv2SpVcLLDOXZ9RoXK/6DfhJQwJy8X4Lu 0jhYFANUx5ThMFuIc5TqH3fOmBpo67kwN/5uwZNUXrwPk/JqoDV0tNNQaPV8ZivZLPtf 2RKw== 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:cc:to:from:date :dkim-signature; bh=XebUo49bNGViZWk1x3tbVzqCjVaBGOH4dpQ4jrfUf70=; b=YC2VZW5fHdxtMC0BFTG3b/kzFoHr1bsFur6vtL2VhmqjYmFPMl99yrFtSB7N4nIqOp XWQbTj+6LOzwnqFnjpkVg8/8jRfXaMaKBBMfRUksA5Ib9L9gNOJtrB8OZCAyMggWSFdi MwXYDEEthkeaiKyo3SOHNK29lRqg55BLIc4XJZSIsKg7G/EW94lHmzbfWnzbQVOgPedy xX/nOKaX7LDeJm3yKfHpKN8HbVQgzxaDKe5WIhsU+i6kB6vw+3vEgtqkc2gOWtdpGavm dnJT+g511biQepfwNXXPUN16FmXnyukBZBj/kwav1pDvwxT6NJsvO0jFvMLEEM61aJOl fEPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G8IIrGyZ; 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 m5si1472020oie.240.2020.02.05.22.47.02; Wed, 05 Feb 2020 22:47:25 -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=G8IIrGyZ; 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 S1727798AbgBFGns (ORCPT + 99 others); Thu, 6 Feb 2020 01:43:48 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39793 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726673AbgBFGnr (ORCPT ); Thu, 6 Feb 2020 01:43:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580971426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XebUo49bNGViZWk1x3tbVzqCjVaBGOH4dpQ4jrfUf70=; b=G8IIrGyZ0tDw9PlKycW93pRaNUgjewlPRBrSS+dnyXv46fW9DZTY8tTi8vs3eRvFXS9uyR 8acNnY28kTdqWroEEIug0M7Xy3Unn3cx5MxkcAZqESY1l3zgEssozykBA/t2jk2b4mL5Dc /e1gyA05qJPkqpoVJjF/EEmD9bV23GE= 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-380-nfSFAOAsPsGxoUg6EfvKSg-1; Thu, 06 Feb 2020 01:43:42 -0500 X-MC-Unique: nfSFAOAsPsGxoUg6EfvKSg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E93A21081FA0; Thu, 6 Feb 2020 06:43:39 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DA945C1B0; Thu, 6 Feb 2020 06:43:39 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9C9639D7F; Thu, 6 Feb 2020 07:43:38 +0100 (CET) Date: Thu, 6 Feb 2020 07:43:38 +0100 From: Gerd Hoffmann To: Chia-I Wu Cc: ML dri-devel , Gurchetan Singh , David Airlie , Daniel Vetter , "open list:VIRTIO GPU DRIVER" , open list Subject: Re: [PATCH 2/4] drm/virtio: resource teardown tweaks Message-ID: <20200206064338.badm6ijgyo2p5mmc@sirius.home.kraxel.org> References: <20200205105955.28143-1-kraxel@redhat.com> <20200205105955.28143-3-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > - > > - drm_gem_shmem_free_object(obj); > > + if (bo->created) { > > + virtio_gpu_cmd_unref_resource(vgdev, bo); > > + /* completion handler calls virtio_gpu_cleanup_object() */ > nitpick: we don't need this comment when virtio_gpu_cmd_unref_cb is > defined by this file and passed to virtio_gpu_cmd_unref_resource. I want virtio_gpu_cmd_unref_cb + virtio_gpu_cmd_unref_resource being placed next to each other so it is easier to see how they work hand in hand. > I happen to be looking at our error handling paths. I think we want > virtio_gpu_queue_fenced_ctrl_buffer to call vbuf->resp_cb on errors. /me was thinking about that too. Yes, we will need either that, or a separate vbuf->error_cb callback. That'll be another patch though. > > + /* > > + * We are in the release callback and do NOT want refcount > > + * bo, so do NOT use virtio_gpu_array_add_obj(). > > + */ > > + vbuf->objs = virtio_gpu_array_alloc(1); > > + vbuf->objs->objs[0] = &bo->base.base > This is an abuse of obj array. Add "void *private_data;" to > virtio_gpu_vbuffer and use that maybe? I'd name that *cb_data, but yes, that makes sense. cheers, Gerd