From patchwork Sat Oct 22 07:19:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1090313wrr; Sat, 22 Oct 2022 00:46:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OV4yXu0tngoGz2H+GtYkAq5Q9ATf8D6zZJVE66k4NCSv4z0XIB+QrshCa0yW/DiHkzswZ X-Received: by 2002:a17:902:848c:b0:17a:b4c0:a02b with SMTP id c12-20020a170902848c00b0017ab4c0a02bmr22915117plo.122.1666424793566; Sat, 22 Oct 2022 00:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424793; cv=none; d=google.com; s=arc-20160816; b=ergnp2gLjuRbzbU3+sJQe3rIOj/oROMwcrzkdoq89dQwoYiQcA8ACCKuXifSNn1xOx ZqLWtdfpW5rjKTg8LjQIuXPE9rWcgXDvjmBdnXwJOoN74NUqM2S84hPzQG9yfmRv4Xjs Mi49JfWiwQFs3nZNPWVmcfGGA/gH4fYoXjJiUjkcWI9uv8IYf5gTO6dxIiZAoqs7i+fM A/qM+AoA6Agcvy0kg1/10cEsQhdF9bjZpuCxxhR/omOqMwwBWt5gG9n1tDjLVfrY+jj8 jPOXl+uAXEqN3isKEYgN6Hcb8eLdW4MIN2NhuWTAv5JpQzNsnryZ7a3mV6wJ7klRLyJa moBA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MkxjeU6M3abUBCp7GZI0PK1TC043mqKPBVbpxao033c=; b=JboiAP4tXqoR+IgPZj71ELrXbLAtk27pqpZCVgoTBqKDlpUlcvwFSaPe5Twl+Him5+ YSBQN+tSKQk995PvqBNNTQkhb4Qu+S/o9xC7RC2T/5qS8msdI0mcsz+JnshAWnlSQkvJ IGJ/hoEy/+m6vUh9VAZ9b6df12MFBVUZQVn9WOJZqZEkJ0hiQ3uSo/yUuMQQpmDPyBZP u3qFqSL8l1s+rA+cw1COXA6dJabNWLIEhfn3ePmyQcQGCIq7cIop2khhHM0Q5zXPs+1I ijvMKXw3jaXjlHoZLX7tn7uUr7TOF5iw/U4WYkVpJPWcxLgxF/3Tl3skCQZrVdZusYYq VfwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LkA7E4+C; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 71-20020a62144a000000b00557ea69d1f6si24881113pfu.308.2022.10.22.00.46.21; Sat, 22 Oct 2022 00:46:33 -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=@linuxfoundation.org header.s=korg header.b=LkA7E4+C; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231422AbiJVHqE (ORCPT + 99 others); Sat, 22 Oct 2022 03:46:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbiJVHoL (ORCPT ); Sat, 22 Oct 2022 03:44:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D410244738; Sat, 22 Oct 2022 00:42:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1EDD160AD7; Sat, 22 Oct 2022 07:38:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0A1C433C1; Sat, 22 Oct 2022 07:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424313; bh=agcjuSq3bveQHzBFdiNuBuaHvt3WmD6K+sd8Pe9wgqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LkA7E4+CMKgfZCo13KkyP5TeU2yAxOmf6+MmwwPPlkL0NpoLShWFoSadT2qgqR+z4 5bR6vetx/c0psq7abfTxE0cwoyXZ4/0fCxCfpRJ6nNlO0UMcRy5P4VC4UDx6xHQpz6 LFVV+VIM7KNcZSpNDOOTj4ptiZnVIw03eLmO4ALE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Dmitry Osipenko , Gerd Hoffmann Subject: [PATCH 5.19 069/717] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Sat, 22 Oct 2022 09:19:08 +0200 Message-Id: <20221022072427.384315035@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747373044025393586?= X-GMAIL-MSGID: =?utf-8?q?1747373044025393586?= From: Dmitry Osipenko commit 0f877398d30e1df657a31a62f7c7de1869b072b5 upstream. 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 Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-5-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 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 vi 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; }