Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3569793pxb; Mon, 25 Jan 2021 21:48:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2OCmF9d8HN/pj+HsqXtcSvxBl+OAGDR+GIrdV1LmDSE14fE9i0GnM3iR0DxEk5RGJ9j/p X-Received: by 2002:a17:906:bfcc:: with SMTP id us12mr2410325ejb.163.1611640134082; Mon, 25 Jan 2021 21:48:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611640134; cv=none; d=google.com; s=arc-20160816; b=RjjnVHMUQ0+qB2Wcv+XWZ0up89cfwtdayXJGqRUUOAackANAxPuxu4mqP45YsH0QNs FTK8v6+0+Q/wGXBTmocXq26TuBdGoq28dcL/ty1eodAr5zaMb0egvMK5MaqNttyDkWzM ytSA34x4U2dfYVP6K7yDs+Wq21bwtIAl43pDylbKVS9C/UN26tkYy1C3dR1v7I8Bw4x5 VB9Fw3TUDBzaa9goYq9QUrDb3Gv1txfnu2meZsDJNAlC81MLfm3g2YfccTSlmyGg/emU xZXKeN/0+rIwTX5JEJovCTm8B+LXp+LwaObXiVG/zbdL6r89o32FsC0uo8FgQqzYLPZ1 HDOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OcdVLRRdgBx5PAA8S6DFEnpuC3aQxaux8RhxdrxChZA=; b=Ij7+B/scq57VaXcYSDQbn80fR1Cpxr4Qqtg5bdlPywZ+N3hMyIcs/jx8UPGWzhxNDx uoR+y8AlCq1ehJteS+jjYHk3unW3Tv3AVF6vIObDiNA+iV5QgghDE10tJ+QKoTzb0KRK RjJ19ECYRHnJYdtPeO5xjv43uLARu1UV5sZuS6RFuukcSerTs7iTz6dBurkbpr4zDW+6 zC/2yRliFziK6J2cJrVIOiqSIx/bA+bWGzY/Lmtc7H26afInxiyeUu2IvttYS9C6QoCt pYiHPBASJ9OayXcI5l01UXLM9YbV9zFGhGd3QJPIX7qNK5mBWRjFwwg6jlRCHwYOeK93 cR/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BdlTb1gW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b1si7229384ejb.314.2021.01.25.21.48.29; Mon, 25 Jan 2021 21:48:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BdlTb1gW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2388786AbhAZFqF (ORCPT + 99 others); Tue, 26 Jan 2021 00:46:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56975 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727920AbhAYMSC (ORCPT ); Mon, 25 Jan 2021 07:18:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611576987; 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=OcdVLRRdgBx5PAA8S6DFEnpuC3aQxaux8RhxdrxChZA=; b=BdlTb1gWtkcnhSx8sEHdaIxmiZdxocmXttemudesNICFite5DoRizjcy7z1EmUiLkOjdTA kI9XoMhShrpRJRKJL5UsJU0m/ClDD4am2i2BPSlfInbmACnkzL2ABoJHt0DT9opYV94Igv M9RPc/AxXwnWui4Ci4bb2lz7foLrTyg= 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-198-8YSlVxJtP4G0aOtk8Y-r5w-1; Mon, 25 Jan 2021 07:16:23 -0500 X-MC-Unique: 8YSlVxJtP4G0aOtk8Y-r5w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 263341934101; Mon, 25 Jan 2021 12:16:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-27.ams2.redhat.com [10.36.113.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D51210013BD; Mon, 25 Jan 2021 12:16:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 84FB31800393; Mon, 25 Jan 2021 13:16:19 +0100 (CET) Date: Mon, 25 Jan 2021 13:16:19 +0100 From: Gerd Hoffmann To: Daniel Vetter Cc: Thomas Zimmermann , David Airlie , open list , dri-devel , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , Dave Airlie , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" Subject: Re: [PATCH v3 2/4] drm/qxl: unpin release objects Message-ID: <20210125121619.7w3flilhe5juiuyf@sirius.home.kraxel.org> References: <20210120111240.2509679-1-kraxel@redhat.com> <20210120111240.2509679-3-kraxel@redhat.com> <20210122133545.acloe4ytgp6r4iql@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Just calling ttm_bo_unpin() here makes lockdep unhappy. > > How does that one splat? But yeah if that's a problem should be > explained in the comment. I'd then also only do a pin_count--; to make > sure you can still catch other pin leaks if you have them. Setting it > to 0 kinda defeats the warning. Figured the unpin is at the completely wrong place while trying to reproduce the lockdep splat ... take care, Gerd From 43befab4a935114e8620af62781666fa81288255 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 25 Jan 2021 13:10:50 +0100 Subject: [PATCH] drm/qxl: unpin release objects Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index c52412724c26..28013fd1f8ea 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -347,6 +347,7 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, mutex_lock(&qdev->release_mutex); if (qdev->current_release_bo_offset[cur_idx] + 1 >= releases_per_bo[cur_idx]) { + qxl_bo_unpin(qdev->current_release_bo[cur_idx]); qxl_bo_unref(&qdev->current_release_bo[cur_idx]); qdev->current_release_bo_offset[cur_idx] = 0; qdev->current_release_bo[cur_idx] = NULL; -- 2.29.2