Received: by 2002:a05:6512:3a82:0:0:0:0 with SMTP id q2csp541254lfu; Mon, 25 Apr 2022 04:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyorHqG9/QX1DBbEcQHhN1gPUKg9OvfLp9YryU2cOh+GfJMYZtoiZU1FmSEVUipZH2W0C9Y X-Received: by 2002:a17:902:ecc1:b0:15d:242c:477f with SMTP id a1-20020a170902ecc100b0015d242c477fmr1357535plh.62.1650885631933; Mon, 25 Apr 2022 04:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650885631; cv=none; d=google.com; s=arc-20160816; b=i4or2PtvH+Ji+s8/k5nJJ4RjFqLC0/QO5JY23jbjQ/KzA6Q9vjEfLjuTdz7EyAidMb pCLvzTax4mYX1RQ1WNmgTNGCForN6Y+d1AjlS/s48FlEMhhFnIwvj6mzxEb0a8NP2kWG QWlFwfrNcdIDxjUAJaMo/f9rJFYicKC17h5syONciZehCATmTGHAsm2cDLeJGd6+iZ1O EfXyFxkzKxT4gDbUss7boIhngOq7hBXkCpHFbGARTbo025/9eSnIPqMYqPmqbk6zuzrI lQxiyzAQ0IUgkyjOAm1DHFnihY9S2nqLtGRe+b5GraQmd2DK7ms7+5BxF03avzKdE47H So9Q== 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=o/dAKyYqhpfcpP4HLG7lcr8Vhfcko6lMP3crWMigK4U=; b=OZLQMqn1CRFbqp+fFwBrn9jCcQhbjMGNgX1TzTYyZimKLiIjzxmhe088tOiQGivlGL KANKGUQDXufKWLLxhN2b4tdzURCSxjEoOitnsRETiM+7op1v769iPt0Grrjm82ZR2WX/ lsdXKMVgBCOP6BD5lTskj//hoxIX65GhiCQi9YnZgMdTWT0iqWSGSQlmFu/4npDz3g9A yRERIrjy6Z13CNodIq0h66nTxJjHyGHwmA2GYIJdLhv4hLBkwJPhy+m/c7sJ7cbfvh9k GWOa8Cq/JH9D9NeXVH645Oh7/kkl7xp2UdjYseuu/fDbVTbyMVS30k92TUuRy8q3I5N1 zXyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oZybRU4m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a63730e000000b0039d678a64e2si17546691pgc.232.2022.04.25.04.20.17; Mon, 25 Apr 2022 04:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oZybRU4m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237782AbiDXTIH (ORCPT + 99 others); Sun, 24 Apr 2022 15:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237715AbiDXTHo (ORCPT ); Sun, 24 Apr 2022 15:07:44 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B01B713976C for ; Sun, 24 Apr 2022 12:04:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id C660E1F44DAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650827081; bh=isO7PTUeJcDVmAZaS1b0iVVGgXGziCi18eZsBem42Os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oZybRU4m8FYNIo5lOZbKiof+CBL6PMKvYiaXlkBXxadri70VDv5ZujwQay1V4WdBr oEfe5JqWvrVhdfl4nzE7GXsOCszDf9nkWi48reEV0/g3KO/Pl0SGqHL7SvLsNdoLAZ 0I0GYwDAepeF+GzAefgBCtos/S2xCODh+mknyQEEzyVxyVLebTGuIk2EzMzkSE3EzD LZRMi1Cf3/U7d6JDI2OyxeU9pJHoaCZB2gySXA7Uw+vy6yCV6JepnghHbHtdUtpryI gGNcBe5EKy326KwMzk2VXQO2zfj+f5Pfcph2XGGLqZjniLwtXJRD8Vq+Oaz2cIIpAn U1iMat256jMkw== 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?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v5 04/17] drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error Date: Sun, 24 Apr 2022 22:04:11 +0300 Message-Id: <20220424190424.540501-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220424190424.540501-1-dmitry.osipenko@collabora.com> References: <20220424190424.540501-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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.1