Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3555644pxp; Tue, 8 Mar 2022 17:21:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4QZ7CbkghIKQt3pGeHnAG7q7Z91iCPoeFUS1UjhevrpXhtWValFpKC9KStWz0Xa6qr1jR X-Received: by 2002:a63:2022:0:b0:349:beed:bfd8 with SMTP id g34-20020a632022000000b00349beedbfd8mr16516751pgg.175.1646788876220; Tue, 08 Mar 2022 17:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646788876; cv=none; d=google.com; s=arc-20160816; b=d63B3IyKc9lVwZHgCH3WviG2wkWGlAO99DMETC8jlYFd9JsPcU8jpuOV31itGLPLTi FFG9q0TdTu28M8VQWm2skUrB2zi4R4XlfgeykegtX/aJHBAiB6tYiIZuYz0A8TdnOQem v4jSWsKZUCl252qL8rxa+jOt3prg4yxjDjhDHZgkXmTyc/C0m+jgHqCnNvfNhxbEH171 0o1Z8IuAX3IlBqeFLMiPHaKuS2u7wMYrgJPwCjpJd3o11PPEX3fmVk8Yrq7DoZP4Lejo T+7jH4bncuS6cudoLUFjKs2gaam1gL4TuycC0/R3z/mnfvBX0E6zBdWGY7bprzKi606l ibwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bschcygCP61mt8Oic3lvdTOZ1bMS0ZJCKLAcBIoAjDg=; b=qi6mFu6A0KZtseVsY+ZL5JvHF3S3YYKheDGlycDpj/CP4D7JXY7PHtagtDA2dXfhDl k4ibuHwATB8+DJwP9C+xx0nry+BPneTRWM+K/XZ0tX1JgVUmOosEWHzotpI/Z6YRPmBt hwV79tujBXTaA7VhSTT82nYtCyfpyQXnFuXZ6Irfq2CZSXnU6PJqHHzgZmcaSLUGB79z fW65o7y6O9VMGxGAsQWUi/4zREbIwQhY1Qsk19dlae8m2F3oBmkiSyLRIb5VCf7hRreu kfzN3BEdAM3EHgXzB7+wUEg5uELrUNC+QP0unlISAD3Xv2B67JdVC0y3VpfdrAmAi1Ze 6/3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kaqgtcgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f127-20020a636a85000000b00380b840ba6csi256220pgc.610.2022.03.08.17.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:21:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kaqgtcgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1AF971903F7; Tue, 8 Mar 2022 16:14:36 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347131AbiCHNSz (ORCPT + 99 others); Tue, 8 Mar 2022 08:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347098AbiCHNSk (ORCPT ); Tue, 8 Mar 2022 08:18:40 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7223DF1A for ; Tue, 8 Mar 2022 05:17:42 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 07A121F44057 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646745460; bh=0Mvk1IbY4ynFDHSPlmHlslCnsE7WaqbmgIPWG1EbnKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kaqgtcgzu26X8gQF1ipy3eQWvpRAnS5s0mwVRyvOhE9uMfheAJorIXQP6iA8ADpfK dtaOS3hLwFB67I/L8D5kLY/JdZ998dx5IXDMneiruQ70BgEzYUW9OD9XYCPCHrj1U3 PksSyvVwgTl0VwmCEBLWDtUgV49bxU7Zj6wRundPjSHyezSM4N5dm3QCCmzfuOkZhd wrM67efRYYhg9AK7eUo83EHjjvW5Zh3EN7SYWkb6Im8hEnxgNTf6MrZ+nD1BHFTX7H Zf8H5D4MJSs5Au7ZdBDPvsMR0RUPmMqntsq+2lWzg32jhc6Acl3vKvrw8tksrWAlsa LBMwo/hQx4YCw== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Gustavo Padovan , Daniel Stone , Tomeu Vizoso , virtualization@lists.linux-foundation.org, Dmitry Osipenko Subject: [PATCH v1 3/5] drm/virtio: Unlock GEM reservations in error code path Date: Tue, 8 Mar 2022 16:17:23 +0300 Message-Id: <20220308131725.60607-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220308131725.60607-1-dmitry.osipenko@collabora.com> References: <20220308131725.60607-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unlock reservations in the error code path of virtio_gpu_object_create() to silence debug warning splat produced by ww_mutex_destroy(&obj->lock) when GEM is released with the held lock. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index bea7806a3ae3..0b8cbb87f8d8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -250,6 +250,8 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents); if (ret != 0) { + if (fence) + virtio_gpu_array_unlock_resv(objs); virtio_gpu_array_put_free(objs); virtio_gpu_free_object(&shmem_obj->base); return ret; -- 2.35.1