Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2373364ioo; Sat, 28 May 2022 11:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZFtruU4rP7UWMnVbYCu/iL4zYbbtdHcWh9sq/hKQQjdDri6p7x5+G/cz4WTY5OyvoIn0p X-Received: by 2002:a65:6741:0:b0:3f6:2cca:765b with SMTP id c1-20020a656741000000b003f62cca765bmr42282254pgu.558.1653763093463; Sat, 28 May 2022 11:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653763093; cv=none; d=google.com; s=arc-20160816; b=H5reGuaCFU3W6VmPm6t1IvTUfZRbDqdSdmXUA0mN+Y8CVBAfz7eIyEzosFOvBG+FLD agpQ5UF9tFzuBFafLScw7+poYDqtXxiqJ/KiW2GLyqipfHFGvnhL/5HL+FfnjKuAjlL0 FRIRIWMX0JAGv9tI72ifear91nLfhRoDTotReOjI/SZhqeavD0s8XHX+k/17IcK1fD0U ZRTq95Let3Liw3U3DwzptN37GGlt6Q295G+lJ1MXx4iuegOAebLTz+CPkYQdufegVJbq eo3GSzBM6Gb5wVggPYoNI/H9lqtRMK31/lemAhh3OAsJvpiFA10/nLJbwKT428Ux2olu eUKw== 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=X7M0EMw+dzMf30ZZz3eE9jwTva6S/D94EajPJdWFLbc=; b=dLul6OqODeRegP6xBGP3EmSYE7XUJ2g/qEiklgiKZ7aPOjZCsYNiwF/pdnYndqkrAU d9v8xNj8Vj5k9ewWPTK+uK9BOuGmZ3XbyVc+yaeRDi3mwbAZ8AnHIjvH+/ULBx3rXGnn 4vfXlN0QHVKp/7qVA+LmhR+ZCyip4ncHTg6uroGE2K77ZxuiMXS3GlJh8eCO/j65pUcb IpFUUupqWAgnBI1CyxQ32TMg2h068Zk4MM5YZ+mauEueb5g7FVxaTtJ+K1izWazI81Us cBIAkYqexiAwsYT1/7hlJcIy3UmK24ZqjkpZnckxq1RylHreW2dwxnz3CZCVBzSuJkeH BAFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Nn5sw/ZB"; 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 lp6-20020a17090b4a8600b001e049d7ca99si8571768pjb.138.2022.05.28.11.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:38:13 -0700 (PDT) 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="Nn5sw/ZB"; 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 362FA25591; Sat, 28 May 2022 11:32:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344431AbiEZXyp (ORCPT + 99 others); Thu, 26 May 2022 19:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349609AbiEZXye (ORCPT ); Thu, 26 May 2022 19:54:34 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF53BEBAA9; Thu, 26 May 2022 16:54:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 946501F409B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653609270; bh=GyVgUUI60R9kfFpC7zHb2iBoubCtP9Z4j/Xh4ZS18dE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nn5sw/ZBitN9MFcIz3dgoN1ioDPFU3hpYeDRVqXC4lpUBS+Aa/rVxTekzPvCX4liQ rsO7ZZLzBsZpuCjl2wba2FHpjPRzYupNGyMWgZ/KgbMYuDshKkSuL+Co7MjgACqRBu n3o2N7AH31AKp0ThCJ0WlHwoYCMoY77msQqXt9Padc9/q/tmGsKqgrWqH+xa8YVRY4 05/PUhygOAtITGKC/dNWaseNEgyoJkY2hW5Ffptf1NKu5sEAMQAhJpWebn6LaWe0kI UxzlIcFj/Hy0uEFSoZlCRNPZnEW1j6x27uoh/+K7sYfwR8MKPos1RFiMJwYvhU+18V kIVpRwvKzwIIQ== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v6 07/22] drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error Date: Fri, 27 May 2022 02:50:25 +0300 Message-Id: <20220526235040.678984-8-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220526235040.678984-1-dmitry.osipenko@collabora.com> References: <20220526235040.678984-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. Cc: stable@vger.kernel.org Reviewed-by: Emil Velikov 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 3d0c8d4d1c20..21c19cdedce0 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.3