Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp767316pxb; Tue, 12 Apr 2022 12:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxcVivGntXvwIjmFBdYT4N7LpuETbEOHZvdAkpo45Z9NfzTcWJcx0zGvViU2//2ZBtXn8e X-Received: by 2002:a17:902:bcca:b0:153:88c7:a02 with SMTP id o10-20020a170902bcca00b0015388c70a02mr39442130pls.112.1649793395279; Tue, 12 Apr 2022 12:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649793395; cv=none; d=google.com; s=arc-20160816; b=IkrjxhGywlWf5VjIMjxj3/T0NU3VYDdisEeA3FXjoQjVf4GXbHPurVAYeWjsA4mPY/ DY/fdj+kaF/JTTltqKcex3O6Qy3RVMnpaTZKqqGfj6GCWdvK18xGqnfRGz4hPrYiA+6X KTY7eUq2rKkMNzaMAmgB9MwvHiVGIyC2nI5f4PmKuaC0MJPXngbl2r6+NbZaYEw9bomz sqMiQzOtLav1pxYN/XZrhWRm7+w/QNJsfMaguJ4rlCoLq071BqlTuf9xVFfyCsk6ndBA XWmv72dm5gOEFLq1lFXBb2EqFQKT20gZTntR4ER4J0qly9tGlB1e/dDn97i60q7GmDZE MbQQ== 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=K5XODVrAtaY8ecOwTFxQIpwZ0NBQ5gSPZh/fQ0CV8AvCWMtdrejs8OcgzBHHmhcp3X PcGLbp0Qx82WGeu3myeH9E99Vp3MXStBTKYFMZMQ2oaAU1KvwiS9eHh3RNXpEkXJzvzD i1hlh3Z5dejAS3Hi3fJKrwlGkzFNjIyOGhRshgfpGXVjl4JUsqxYpsyQTGVuVZfVO1+W VMD92oMDEhcANvb/lFJpCLNSWOrAr5Jfuk8uaqMG/a6hM4GP57EzER/gtJ9POWlKnmit zAPykHrN7s4oktRbv5FR2Sb/DoEwLfoO/ZvxHO0q5C4XVoJIgzrzrogbFwqUoew65l/p vcww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=c5a6rNCK; 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 a185-20020a6390c2000000b0039da12e38cbsi1819932pge.664.2022.04.12.12.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:56:35 -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=c5a6rNCK; 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 24B4963E1; Tue, 12 Apr 2022 12:49:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350398AbiDKWDN (ORCPT + 99 others); Mon, 11 Apr 2022 18:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350374AbiDKWCk (ORCPT ); Mon, 11 Apr 2022 18:02:40 -0400 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 7480EC11 for ; Mon, 11 Apr 2022 15:00:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id D33161F43C82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649714421; bh=isO7PTUeJcDVmAZaS1b0iVVGgXGziCi18eZsBem42Os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5a6rNCKW1SFmEjGB2SM+3wBjzMZRF08aK5HRbuiJJXWAeIbjQ/ocfi6vDmFxdPbj GgKj/4ZqrxOB8X1J2B/xfPQ+qxt2JeHO/x9+wQmRNPu+opbt9D+6k9So9hPBJkTQst G3eumY637vW3fmHMvpc1wHkCGP25KiTwJ/yLfqPc+EIBZqXV+yVKmBwYSpX5ED/jDk WIYpg8ciwMwPsrIG/x2IUqR3Sns2b2IHZwEengN9xOF5W/wm2oZXpXoJMH3LeCZiKr jJrqZXSptwS+nFBwd/KSnV4CKotPZfG7FBKLlhnj1IXycBQgX8oYpjhOMQkvIOXdsQ Bi+ut5+3CjuQg== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Gustavo Padovan , Daniel Stone , virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v3 03/15] drm/virtio: Unlock GEM reservations on virtio_gpu_object_shmem_init() error Date: Tue, 12 Apr 2022 00:59:25 +0300 Message-Id: <20220411215937.281655-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411215937.281655-1-dmitry.osipenko@collabora.com> References: <20220411215937.281655-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.1