From patchwork Wed Oct 19 08:22:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4576 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp205280wrs; Wed, 19 Oct 2022 01:48:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jLPGUuZKln3bo3riQPz9rBWjiRHfLi8Fw14a+Ihkmqivqxur46N7wl5YYpO2dudBLgnXU X-Received: by 2002:a65:6e4a:0:b0:438:874c:53fd with SMTP id be10-20020a656e4a000000b00438874c53fdmr6505962pgb.355.1666169334800; Wed, 19 Oct 2022 01:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169334; cv=none; d=google.com; s=arc-20160816; b=rzLaIudEmEoBDl4Em5LccFBh4jBP1qNKhb396bes1H9Z+I8xt6BeHk94H8TV1ejNmu HSFFRiSkNuq5qRhRxBBex3RgEuvEbp4zl1UBZeyWgs/QhrgWi5xK0mYqE889iDtKzp52 RDlS+c2lMJBlU8jR9RTwYOhoIjHbT652/KSh3i26ifMIEQ9XuqoQdlNVliCzmHmCzYPE mI2OaHyzR4YARuuAkyfcc1yJqhOVGGk3gH2TxcnIw9rC1ucrhwsXZwVK9I+aWEcnkoQX eUDe7qQvfryy0DgVrzudyzZaqmTNpmKGsmRDbnmDSnQQ5wfaI/ikar9Dl44Dhiwa4sC/ giVQ== 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=fs0www+8PA7T57IXMJKXSnpp9C1s8zgnr8gK4cYj7iY=; b=KO8F+VO9UZqHrXteEGaYptsIoNIJtgLuC56EmbJ2pAGs6VtOm5O2waXpFbMkDZ8QEo VicSt0YCKDmzZh+UBKcjXaeiTQxY2AEPr9vhr0rDOlyAnwIicU5CEThkmn0m98xZ5PsF zB2UvKg/ixw6W6DX0vQddnANFOfJc3pQZCYVAzlFnRxRhx1KLeLhuApeKsiXR23fHBUW 3qaBleC11kMJN2FJNS8QjQQhxFkYB9rpSnNSUZTJSEaIpjXSfcfJe1CFvZ6sWDrpmHq2 hnnLD+hqs5nxfGcL6CccwWwXvv7ThIHQV67Kvntbd+fyyXuleHIjjL1HFA1yjSKNH+eC xM6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dJld7rpY; 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 h123-20020a636c81000000b0045a62fd80e8si17415101pgc.468.2022.10.19.01.48.41; Wed, 19 Oct 2022 01:48:54 -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=dJld7rpY; 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 S231586AbiJSIsQ (ORCPT + 99 others); Wed, 19 Oct 2022 04:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbiJSIrs (ORCPT ); Wed, 19 Oct 2022 04:47:48 -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 4A93278202; Wed, 19 Oct 2022 01:45:29 -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 27B1A617E7; Wed, 19 Oct 2022 08:42:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BA8DC433C1; Wed, 19 Oct 2022 08:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168967; bh=ZizTAglFEXVj37CKMUyIA+z7OphHdSQB1tjv3W2T0vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJld7rpYfvGv4UtRKuV/yU6nTSDFuu1Hk1cmMxVcbQh0cytgALcCwbNFhXvjpkU8s aDOyusFb5ZAe2DmP0B4ePBVzs9o03f8ihaabw9E6w/T4cYkgCKPGWBz/cz4sj/AAAD a7LryYxOqhthU8vVawrTv70m7fYq4tSNnjauzdQI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emil Velikov , Dmitry Osipenko , Gerd Hoffmann Subject: [PATCH 6.0 075/862] drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error Date: Wed, 19 Oct 2022 10:22:42 +0200 Message-Id: <20221019083253.250754203@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?1747105176509297675?= X-GMAIL-MSGID: =?utf-8?q?1747105176509297675?= From: Dmitry Osipenko commit fdf0ff4d12cbcd76b53f27c96ce51ddca400884a upstream. Unlock reservations in the error code path of virtio_gpu_object_create() to silence debug warning splat produced by ww_mutex_destroy(&obj->lock) when GEM is released with the held lock. Cc: stable@vger.kernel.org Fixes: 30172efbfb84 ("drm/virtio: blob prep: refactor getting pages and attaching backing") Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-4-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_object.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -248,6 +248,8 @@ int virtio_gpu_object_create(struct virt ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents); if (ret != 0) { + if (fence) + virtio_gpu_array_unlock_resv(objs); virtio_gpu_array_put_free(objs); virtio_gpu_free_object(&shmem_obj->base); return ret;