Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2706650pxb; Mon, 25 Apr 2022 00:03:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXWEzeSv9JdYlb/4f97khvGWVelJ69qkemy92gs4KT5YsqHmhmfEh00RmuRW8fsGC+GHeX X-Received: by 2002:a17:907:a412:b0:6f0:1071:25ac with SMTP id sg18-20020a170907a41200b006f0107125acmr15076534ejc.261.1650870184535; Mon, 25 Apr 2022 00:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650870184; cv=none; d=google.com; s=arc-20160816; b=HckBUNBnBclniqMDEGhX81Ri33IXgOwbwpJD2pBw7nZkWOcRxotcZuiUDwxAx7c8WA q1gCVThRNOmCJwTPfJUKo1nfSSGv4UOhnnv0KOCKXkQX46R2OcnDKHZuCjjMQpdpo5ir 2s3U30tsl/XHa5lIIetNSNglEgjgpMjF4DmnUEfXhEc4RmyNc7QrFx7MrvBD1uSu3OXv ub65rBpGCvpGJejw909dN5PDipj2JwQS5istEzqhZvpFSa96REgzQrrkKVmeu+1jlD25 o+yNXXuq/tdu+0mZzmgz5abWuOELFIGIzH6csREuAnQrLJGVphVEOD3Qu8QsUdKQ+05u e01A== 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=U7JGPPi0FWCpGud2MUj2ss9cKjg0mriqm7Oh7zHELeU44J8lEP9CQNk38Ml8iNmxGh cWAqdVAYf19OoHsj56pITuExLiQOf05vIN7jYFVd7EA7Z/HSbGxu/6+X82VOfRMQPE2N 9qH8IKu/dBU9Dbjk+9JIileAQW+u4Qs6QuXbkL60eRjfRPZipCBknsmuOM2NfKjMghId hD+mhAAV/2GJS6F2iBkq51okJ7OCttEcWNVHDVDG5qoUH7qdyJeBwc7t+h3jqrsk95Lz cOGZWpDEmpZlCcpKCUOKUuWchTHuuf6sy6R7qQQ5r+BM/NMpfQvgP7FG9wsPexFDntbQ VHzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=n3gZ507n; 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 z16-20020a170906075000b006df76385b71si11989250ejb.17.2022.04.25.00.02.41; Mon, 25 Apr 2022 00:03:04 -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=n3gZ507n; 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 S237618AbiDXTIL (ORCPT + 99 others); Sun, 24 Apr 2022 15:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237751AbiDXTHr (ORCPT ); Sun, 24 Apr 2022 15:07:47 -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 426EA13976C for ; Sun, 24 Apr 2022 12:04:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id EF6FF1F44DAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650827083; bh=CWqvGLqMByoxyOodrX4VDvjOrVtokLSbI2qbVKtiRlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3gZ507nUEjkxanjrfYvMbPGr6luevyfyePOFTjRbSczf/vG2/OiLqYVnzhLLB3GH DHROBA12hQWd1djtC4QjK9/ZwtJPKJpXqyTiApJO2+kEHymyLUNXN7dmdf9g41VHCi L25WmQ+XFuQFO5WWrqAib6wm7VIZ/Tx189f1bsKblSGKsT1tP1SH109gLw0LUYFESr lr//oA/cxhGISAAr2rL2pU7n6Enj5+sFILtNq3VCK5yk7OQaG9LwSec+CSQa8/uOwp sJPSM5TpcivojKpayK7ZE71AT7HmWJrE22KCHV7qPeUUPikdSmKashSkU6oWr/LRYf 4SPJQGhwg48JQ== 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 05/17] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Sun, 24 Apr 2022 22:04:12 +0300 Message-Id: <20220424190424.540501-6-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 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