Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3315498pxp; Mon, 14 Mar 2022 16:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQwHyqGPBFhpgZ1+FiBYJ7kYbcpaydLA8L/qdmQOGELznNjn+XI3K1jyl9BgdaDtmodmnz X-Received: by 2002:a17:906:7942:b0:6da:bdb1:3388 with SMTP id l2-20020a170906794200b006dabdb13388mr20282248ejo.236.1647300250250; Mon, 14 Mar 2022 16:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647300250; cv=none; d=google.com; s=arc-20160816; b=v39qB4XV/pHKbbgImhFgSJU8HA7YqR52MlhU8y/cRIK8dFcmI8jfit4u0heLBJVcDh MPflig2XqHUDv4GrHxOUOFQu6dqx5ecRH7MS+UWOwFdTz4rVWq5M2GqO1kb57Yhwe/eU SuI1xK4V5lFrvXw8HMzfqicV6APrHy/QD9qn+BSIg3u5DG+oAtqNc+idUJonalsG6vUe i2DPV671DxsPnPZdq01SLOGM/aKGvyaXmoZqI86ytuqWMSk57PwvS0rX8R9A/pocsAZ7 Sj3G3FVPkZMPv2FAdu7T9dCcqU0k93hR7gs+Xjn6UprXUXmLNrI2EGA+Nf63Gg84FurG 4TdQ== 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=CCB32WlZJiTWBSokVeWXFvCj+RZG2sE/Gn3I+YyFbJlXWXo08fjBsrqaSVhD9kUSUM KIZFs08xhhmsDT7y53eZAxD3+JKmFt/qFQrvSQD/Sko7f5gEXBD1AxFU6FQqibhQhpcM nvRi42dX2VuibLvnASbIa3+s7Yy/nGPzO9ErPmd4oGMCsjZCs4SaALbGA76PNp1jhjpZ s9gA4VK7pqgaeHT8iPbdvhphAdyToKUPyWPUJhkmaUbfLfR6lPkODiDf/fuIBvwNq+FM kMoOWixAf7EVWPKKIow5BBlip0m7Q5ZAXMMJFOfO6ezdB16E8t++/GFEufpr7bD/bYkh 2KQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jRkI5E1D; 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 z10-20020a170906270a00b006d0a2b5edc4si9071032ejc.365.2022.03.14.16.23.45; Mon, 14 Mar 2022 16:24:10 -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=jRkI5E1D; 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 S1343491AbiCNWpg (ORCPT + 99 others); Mon, 14 Mar 2022 18:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245749AbiCNWp0 (ORCPT ); Mon, 14 Mar 2022 18:45:26 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98BFC33EBF for ; Mon, 14 Mar 2022 15:44:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 330571F42F20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1647297853; bh=0Mvk1IbY4ynFDHSPlmHlslCnsE7WaqbmgIPWG1EbnKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRkI5E1DyY9KXCE78PpCasXL8mbecLlXZwciHB76LH/L+9sFWxSwXvAcxMhJC2W7r m/DgGS4nVqrA6Vfmikvgrbt/ih3049H115L0SP/1W5tByLBrrsT2rPJToUnafuLONd 700bSC/ekaprBQBNfexRiQDB0BG0uoGNa4h17L0bk0r2Msem/X7+s4mH2u1ZUE3soy mxd9W8OJ8euMaKDShIsXE+AZkgMJ0IBBEiodNJ/bD0ZNx2IciljG2skMxKZ8IcIkGE LPoM9fTLyZnmDA9vnGYhBtsQodKZzEOfU4hYm04gWoEw/feAkmv85OBFVhhMIIaJIO 4fQUwcWafZ3XA== 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 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 v2 3/8] drm/virtio: Unlock GEM reservations in error code path Date: Tue, 15 Mar 2022 01:42:48 +0300 Message-Id: <20220314224253.236359-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314224253.236359-1-dmitry.osipenko@collabora.com> References: <20220314224253.236359-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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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. 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