Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2330617pxb; Sun, 17 Apr 2022 19:03:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Uebo/tYCBZICegXzn48Ykl06iQtpIPkcMY+PSql9K+uXMk3lthIjBpNEX/FOLIiAfKiw X-Received: by 2002:a50:9e61:0:b0:419:d8e5:6236 with SMTP id z88-20020a509e61000000b00419d8e56236mr9937597ede.327.1650247392868; Sun, 17 Apr 2022 19:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650247392; cv=none; d=google.com; s=arc-20160816; b=LQCTOUJe4ItZ7sfivdZVgIajUUst7j9DA1d7xQHuhsHeBIRUd0ZbWu0ZpsKtvEFeg5 YUCc9WvxpoLw/EBz7FPehCrmuazGm1MqCrPS+FQehZV0Z95n1J4zPutd+OiHPN8blChT Chtfe+Xh9+XqLJt3zZBkZsXLlGTb2aoF/LeW1uUrX0PJVLxsLegl+wKUs8tku/9D4q9Z z9PCouNj0dBouyb0Ly1L5LgnCCe426g1mTLtDlw8TZTK7uMYzVANbC0dS7huRLTeziSc sHkYr1a0RuRDNTVM2T/djCgcgw+czJelcDMPsXz50HW+Zhqc+oRE+N/j5rTIjMCFeKwt ABIA== 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=oFylDhzkHy8aJArr/yqz6PGYfmOAim0/8aGueon8jlo+mJDwBfvk3xdib8CMlkh5ck FntBmjLOPLTiMoFPH1sLLyIWqqfTYjG/kDmkMtZW/ny5zuf+wHwuqXVrDtY90ezS957x fAT/lyICXL7sFcpA92mGcExn4c6e9FNS8SH7Qp38n6FZ2ASAbQr9qAuQxJv9sMfCL5dv J9Wtp4+2m/4tQNugfczyvi7DbsUnr6CCA17QuIY9vhn1QKeScBzg8FIAZUNTgMtNtZFb I9aF5qSNGGBa/E5iP/8xlsfAzXcw/EEDBpdivedV9evfNbfQDjZbFXoyF5cpneA8gKrI oyZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="RCU0g4/e"; 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 gf1-20020a170906e20100b006e894a5efc6si5223548ejb.542.2022.04.17.19.02.47; Sun, 17 Apr 2022 19:03:12 -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="RCU0g4/e"; 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 S235191AbiDQWkV (ORCPT + 99 others); Sun, 17 Apr 2022 18:40:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235160AbiDQWkK (ORCPT ); Sun, 17 Apr 2022 18:40:10 -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 2712A17053 for ; Sun, 17 Apr 2022 15:37:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 6D5E21F40EAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650235053; bh=isO7PTUeJcDVmAZaS1b0iVVGgXGziCi18eZsBem42Os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RCU0g4/e8IIBgm39Cna0t75waPeHxN5xPVxsFDXz8lk8cqLB1fOgTM9j+MVuyXbVG +XZzwYUUP9XGxUqodAUBMzmfKeVk3FRhTJtnnHRGDXxDeI23i+ogWSu6fo8R1UH3Iq OpAPJ5+h8PXjtHCsOIvnC6Dj6RZcaCwPWFR0ElLf0InNmGChOA8245jPAgvBIonUt7 U5GM3VlDpXHtqr+vRwjU7cgwI1upzmPOjFtwsBxVb0P0xPQtXysbuU0KfWWDitRvfB XcOaH7M/rCOOzPxbnx9KIjpuwmrHT9iciWkgUzIUPZ+yRcYkoQaNS9PA4B64bdZ4QP v9RtjeOacepmA== 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v4 03/15] drm/virtio: Unlock GEM reservations on virtio_gpu_object_shmem_init() error Date: Mon, 18 Apr 2022 01:36:55 +0300 Message-Id: <20220417223707.157113-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220417223707.157113-1-dmitry.osipenko@collabora.com> References: <20220417223707.157113-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. 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