Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp948615iog; Thu, 30 Jun 2022 13:33:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tbZCdFo4UgIyvXzNv6YlwskpaC/u4OpMniiXY+3cTkJefbju9BeVGSFqSLnf3P5OqTvW+J X-Received: by 2002:a17:906:9c84:b0:6e0:7c75:6f01 with SMTP id fj4-20020a1709069c8400b006e07c756f01mr10812142ejc.103.1656621225231; Thu, 30 Jun 2022 13:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656621225; cv=none; d=google.com; s=arc-20160816; b=geHZ9dEyQ2S0az0Ni44J5dDSlFQ4qlbmX+k6VaGYfLoDzRGlMDqUN1iNgZOSTfWs6x jsyZsHnaspBhU2nSvBQf8744yyWaMHIo27oDKNRdc597a4iu/KWUJHjelsOf4Idtp8ae pNCHCKcYtM9yamuxoM4GPRHlgj7N2njRcgd94xi+pmkGu75/QCCpQMfP3fAvJNWWMpGc cJ+3WoOY7dN6ZpKFis/DfXdiZelx3IW50G38ljyTJ1zjAN+M7VvUmC5GiPOH8rqF0YqF cngCQmKEKdy8UcxILmDIIVSoJGZfFc5jtKG3i1i48wsrLrbY+VCqR6C8zvqrd/Rc6s19 ftkg== 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=QgqkJC9gNzeyIkxcnRh9tAJHveV/pPbnDS+cM681Y9g=; b=dNZ/5J12MK7o5GQPr5a4fzY0V+Ht0cpUiLiEKQnMxp+2Oh6ioVHjKSWh+34NEU2Hj5 COgofERrWI3bVNunf+KQ1oyFA4Z1AfVtbjCq+9Fy8ZIp7aHGjFsNJzYB8MBv1p19Oide WGm33gL9/U6fJFUng3NJ4AOZHqMUmwkbc7bzK3/e75T9ani0BSthvTVQpwQ/CTR6l8YE LxI6YeX0dLavVQzL5a98h+qESizAcpu94NjVbB+0DS4rQ9+8yUuMR80lHt+7VOzsS0lI OLF5GwZBsLZY/FCwiiVBuVY1CJ02TlXPuGOsqmaCrxczDoYD1V6EXKVrJALWjbZ2jqsV zdMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VbB4ZOCJ; 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 z5-20020a05640240c500b00435c7624e9esi25975246edb.617.2022.06.30.13.33.19; Thu, 30 Jun 2022 13:33:45 -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=VbB4ZOCJ; 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 S237067AbiF3UIE (ORCPT + 99 others); Thu, 30 Jun 2022 16:08:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237040AbiF3UH7 (ORCPT ); Thu, 30 Jun 2022 16:07:59 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 633574506F for ; Thu, 30 Jun 2022 13:07:58 -0700 (PDT) Received: from dimapc.. (109-252-118-164.nat.spd-mgts.ru [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 4B15A660198A; Thu, 30 Jun 2022 21:07:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656619677; bh=GeAjvmf+urVtW31vmebmoRtvHFY653QOqua5mOTvkSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VbB4ZOCJC+c+Y/MR1xX3Oav+CB3vQfwwq4q/RdEi0jvay8fgzvzUCDZf0e49O9Z5X LHgCCiTRvH+jN3odtLCMFtJF7vp+Qf7GKfoAfXwvrWyL+CCHj8hsogZeq7PItfADsI HUh9uEL1gj78ULc90Gia8fj8lq3jr55eN2jhgEPVhYCL33FQnTwP7CfrjbbuRO7+d3 GchOKe/FW+RI6p5cxIuKntlY3U8gM3TUc14g4t0zD3cD4jm6+uhFmAkn9ZKAA14IJA iXdpDJu5o2ZcHZtRMamoxPgkTV6gPsflXAjrLMHsZ+bFKElk0OKsanY15M8w4RoL3j wz4ZhXWwEBplw== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Thomas Zimmermann , Emil Velikov , Robin Murphy , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , kernel@collabora.com Subject: [PATCH v7 4/9] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Thu, 30 Jun 2022 23:07:21 +0300 Message-Id: <20220630200726.1884320-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630200726.1884320-1-dmitry.osipenko@collabora.com> References: <20220630200726.1884320-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4") Reviewed-by: Thomas Hellström 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.36.1