Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1054612ioo; Thu, 26 May 2022 23:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy75dPjZj5ne+xvaPXQnuq0oAQHon5H8W8VW+Ka4qK0la7fVX1ORcjCHP8GNXxvLn94BGkq X-Received: by 2002:a17:902:758a:b0:15e:ef4f:fed5 with SMTP id j10-20020a170902758a00b0015eef4ffed5mr41381571pll.1.1653634373197; Thu, 26 May 2022 23:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653634373; cv=none; d=google.com; s=arc-20160816; b=rmJBvmmc4xWYV+2LHpgqMk0PveMjxhrlT1s2IAtJJTXZxJPJc1YHF5T3kLX2+4sci1 JGj1SGNgcQfaRoXEqfZioB2pcmmXJhemfdErWtelumoRwQiuqYacJYs3Jaexx5Fw+nJb igoUyfFY5Ir2ulyzXKBwXxPuSByhvZmxydWDczjK3HbTy3MMDTktkAuB9KLoeLFkgMBo NHnhyKEpc/93C9nldxRv7KujW5sBNEHMAdgTQssO+i+6A8BbcifcaLQ92Z27Qvq7wOTy GZtHTzBqkLV9WMXdr35yQd/MGcTmmaJ/5p661mg9hLdvwZ98d4dCv332enUJHU7pcAGI cbCA== 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=x57ckkULNuHYODjPLv5Dm2fifn0lClA6JAyMTZTbp9o=; b=bioyaBrLJ2GiVIPSlHr31ypDrD7bAk06gwdOnNRH1EecyI3r3J92FQTUQPd5EwviQA DGuE1D6KwdyjuRWl8ZcdlWeodQZq7kbQO7TpXpevTnyzqP/mp6aqF+H7QBevF1qGvgKw K8aeKnVL24CY/cHfMUHlEibXtQHhJcIqBiZp3BisS+etubu3JmgjYF3gUyYEIHUwNoyQ hEXqScevtIJiB/Kf96TclI3+F2fNRrStz5gtpKV7wkCh49q+9/ZYg/aRgnu2VkfQKMAQ sXFW9acHXwHHQHHSLEWww5HIVrhf5Rz5wW+C4Ux5I9MKdXPm7dvND38YIXC4igUV44nN qzrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LuHwpeim; 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 q18-20020a17090311d200b00153b2d165c6si4731538plh.462.2022.05.26.23.52.41; Thu, 26 May 2022 23:52:53 -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=LuHwpeim; 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 S1349622AbiEZXyz (ORCPT + 99 others); Thu, 26 May 2022 19:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349670AbiEZXyi (ORCPT ); Thu, 26 May 2022 19:54:38 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38BEAE8BBA; Thu, 26 May 2022 16:54:35 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 990981F409FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653609273; bh=eF2XX5/j1kKfeZpCaTpZ0jlF7vtBDjwSe+BehMSKUaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LuHwpeims5dqdJ816i/QR4pJpGilSUoC+x5O7sFLvpBzeMOiEBIRt9XydEwI26Qt6 GIdgccQ0FwpJ5B/hBGc9WbWI007BhxShN8d9k7fJsf6osiPeaqGKpRZzWysZ8eJW6d P77xJbRQoGhG6h58qPG8cMFY2Lc+g4jS7hYVyvlGEc6tspExJ5xh5P51q1aZyQ5qJ5 pinN/CF5bo4occ8NNLGhJT3UeAJq0kWVh0GouNQTGnkn2hhoakpwMF1JEOveST3+Ta G7ZQRqMiS0HZSVgBfom3f6xfgpsdvS3F6SvOF9S/ERyDRkPoUaB+NeuCGRrWgfCZ8b oseNggf8SpziQ== 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?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v6 08/22] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Fri, 27 May 2022 02:50:26 +0300 Message-Id: <20220526235040.678984-9-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220526235040.678984-1-dmitry.osipenko@collabora.com> References: <20220526235040.678984-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.3