Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp456204pxb; Tue, 12 Apr 2022 05:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp7mMlE1neLSWObjhyoMCTddiO7+wwVNG9EJ+3o/lm4OWFtodHPH3dJMp2EQHCEdsNPmGl X-Received: by 2002:a65:46cf:0:b0:399:13b3:dd8b with SMTP id n15-20020a6546cf000000b0039913b3dd8bmr30737118pgr.585.1649768046044; Tue, 12 Apr 2022 05:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649768046; cv=none; d=google.com; s=arc-20160816; b=LJ2jmFIHpCaCflfcjRZlg5fnKBhit8FUWrxCta0N+hsKwSz0pG8tuvEk3JVaFi0kSD VMTxCOtlkAv+jxrH3rnXt4Ufcy9LfsVp/nraPhZ63fnru73SKaFB1tjTeblFF+e4PAKo kj4jywwj80Gl+aAV+OFyv2uVXxTSaGwOSP075q0tsGSfoUGYLZbCVK0ckbDeDbwodL8i Bo7xT7g5f4MPNlXxA85q3jTxD2P/UzLaMIi7izcy7ekrQAd4msTN0uyaOeSUl06vEbe0 lTuynzV8T6UQZWnznFEFCYwq94x6e2of2FeXeTXQtLtR/+CWO7ul8uFGjkp/1SIo1ZQD Zs6Q== 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=nPOdLj4VKS0vd7GyUY0wvPzxKvuHL4FDxwGeH1SumrY=; b=U0tExNyL+m4AHEmJGVW8PvJR1xyOLDjZalbBBiNLrsFJuJemkEUmpbNlCnsKc/diGh ludQrjn3ZCxA4sht7pCmwLt4/5nxg7tJEd6pLj0g61/Fxrcp9SYRgR8AjJQhBJS7lP16 ps3LnssBmlLb0jiKFz12IWQbEi5xTvbRWZ8Ovuq1lz/9UOlKjCGlyfetFIaGYynr9cSe ALY0N1J5mR5+o2xaa5zuagLGw4pa5/urTFw4FgAfURjiRzdluvDn9PsF9Bv3Kyfzk6fk YeR8L+2QRfoFSStOpq0GeETuNtLxMO2TIgsTxyPIAOnXaUGQRRJi4Id5zipN6eZA2OZp GYaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ohca8T9N; 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 i14-20020a63584e000000b003816043f114si2632547pgm.777.2022.04.12.05.53.52; Tue, 12 Apr 2022 05:54:06 -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=Ohca8T9N; 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 S1350352AbiDKWDG (ORCPT + 99 others); Mon, 11 Apr 2022 18:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350375AbiDKWCk (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 1A7F9E39 for ; Mon, 11 Apr 2022 15:00:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 81CE41F438CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649714423; bh=CWqvGLqMByoxyOodrX4VDvjOrVtokLSbI2qbVKtiRlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ohca8T9NknI5hVHqu9rr5ZgXYuOC9GXZJtDtkVbj/OxMg8xZc+KmY1YlqktGRzbvn RHHj5zlXOhIHZ1svIKMTtBTL6ieioJoyny22GnBKVQyb1Ns6Mjx3MQaHCkf70/myPB KV7fN6iulrVusmojzr5DBZ5ymQGAPvmIycGUAtmOgpqwparzpS98z+VKZ8l1tSULGF rEyX4IQ/DaUNR82ij5YKRy6pVvkfdA6l4cBlsINwR3h6ITsWIKx4W5mLI8cFfnW3Pm 87J8ylqNdiZH2vkmXUjfuS7k/ZWAIfkvsVU8WDUz7Lsc5ulnU8BZMw0dBu2TBOo90J zqjruRAl8rwdg== 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 04/15] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Tue, 12 Apr 2022 00:59:26 +0300 Message-Id: <20220411215937.281655-5-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.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 on dma_resv_reserve_fences() error to fix recursive locking of the reservations when this error happens. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 580a78809836..7db48d17ee3a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -228,8 +228,10 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) for (i = 0; i < objs->nents; ++i) { ret = dma_resv_reserve_fences(objs->objs[i]->resv, 1); - if (ret) + if (ret) { + virtio_gpu_array_unlock_resv(objs); return ret; + } } return ret; } -- 2.35.1