From patchwork Wed Oct 19 08:22:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp205829wrs; Wed, 19 Oct 2022 01:50:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45D6hPXWqmaPmUaSt/+06JB8rPEDwtTVty40aYzQelx3uag8vwue+YntATTOHw2BjTtZBg X-Received: by 2002:a17:902:b94c:b0:178:336f:13d6 with SMTP id h12-20020a170902b94c00b00178336f13d6mr7645082pls.64.1666169446966; Wed, 19 Oct 2022 01:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169446; cv=none; d=google.com; s=arc-20160816; b=vwHguBVpHWeytTPZtMj3VzvVVpEAQ2fvlhrG3JlabaCrO0MmGdSZoTxQcJZcedTwTm hzy+UrD73IvzpK8XeLTD+JQ2PUfdaYt7B6TH2YRf2ObqwRSxhIpC2da//2V1JdZgUD9s 6nberrAGyT2hAjiU5g0C0sv7DfEQpDN3G1b7fITCF3Iai0Ztpx/7xCugHH1DdRoIvQSs WzjqU5P0u6dIG/FsJckJGhixPWDYN4/AiaFuVh0nsIGiX8n7/YTpwVozaoeNFEp47NyM 2WwIFurfw4iGuTG4FvRnUlNGzPUs1HLQLcApVPK5AKIbhYd033eGYpYDGLpxN9ZCsS/y 8ExQ== 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=w6FDPTSnI2TfUyfqswUuhSl86oCiFR8jTzEgZogoVe1l84MH15gF4sUNRjYmaWJ4ud 0vgXkgOsfGEJovI6114HV4md4CK17LUNpbUoSNc5lzKSLJWjFuIhvwFI9iqJwsr8g/ff V/1OMm5VSzD8NPz1BO3OHNzOXwi1RC3ksh++9sGsceq0uiZD5I5AtIM1VkfqQS+gVNVm lbhZj/vcTF3Wc9nKfeqND1NIyHr+syGu+tafNSIMiU6S6T10x/Z1FldS7ThTRmruchNg G2EI9Ny/vlTjov3t264do/GTAvvDF3K9a+WRvMmpq3oj3fF+Bf1GaRAxGFC4Ug2qyHz6 vRfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dA0I0WsG; 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 lp16-20020a17090b4a9000b00202c32c06bcsi25594131pjb.126.2022.10.19.01.50.33; Wed, 19 Oct 2022 01:50:46 -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=dA0I0WsG; 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 S229977AbiJSIsy (ORCPT + 99 others); Wed, 19 Oct 2022 04:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbiJSIsQ (ORCPT ); Wed, 19 Oct 2022 04:48:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5EC733848; Wed, 19 Oct 2022 01:46:07 -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 ams.source.kernel.org (Postfix) with ESMTPS id AE38CB822DC; Wed, 19 Oct 2022 08:42:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C958C433D6; Wed, 19 Oct 2022 08:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168970; bh=agcjuSq3bveQHzBFdiNuBuaHvt3WmD6K+sd8Pe9wgqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dA0I0WsG7Hog9z0YK2P3s36zPv7G7tCU69RiXQfy45hay7hHRMMRy8yzsXDPN44Gq kgQXaWz6dzEtuiXKjJ+KZHZc+07eRCa2BhnsNE/0bCW2tGKD7wZLKXte41ZFd0BALG o1Sf2IZCgTB4nE6AHb7jCG83v3V95k2TsOvPp17Y= 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 6.0 076/862] drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Date: Wed, 19 Oct 2022 10:22:43 +0200 Message-Id: <20221019083253.299039750@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747105294475610348?= X-GMAIL-MSGID: =?utf-8?q?1747105294475610348?= 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; }