From patchwork Mon Oct 24 11:26:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp633194wru; Mon, 24 Oct 2022 13:13:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46BOa3G4uxwgystH5kSXwMQqi/G+arGBoKzQjDwJL5yS+OpJHD1uy5QvGi9YAT9PPTPjlU X-Received: by 2002:a17:90b:1041:b0:213:1d13:aba2 with SMTP id gq1-20020a17090b104100b002131d13aba2mr5820504pjb.154.1666642421959; Mon, 24 Oct 2022 13:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666642421; cv=none; d=google.com; s=arc-20160816; b=y6/r8QYVVqZxdHLGUgwH/vgmLTUHKE5qmK8dF1DDHStsyNvkIlkETAteNPWrBh8cDF +0N+ER88ZA8jxqR9jqprp24kUnqDohPE0dyAHmDPQmhNykpF6U41pGFZaYXBTqVMQr9q EBlht97t2StU2iG5L0kOr4+2lRS1cp6W2bBAg8Yo5jErtBv/9qFIQ6diJy2gpIOqYdBS J8aqm5P2QRBdivQk6iQLUgkaCfUEEscqaTCQ5g78ceZOd2KspuyT8/NaNvT6c4n0YLSQ 1GVHDexJi0qWvzAwuuv3ybaghSW6vE2j2cLue2+AwHIBMjyILINDA1C7iMOwoiFNa6Jy BseQ== 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=gYcuh6ANVvbzAqX37rhN7fXbhU4zN3ZbhK3LXLwh3bE=; b=hW98m8dr8t/VLOfmMioCKa6UzuN+qT+VudqoUrfaC3EqZ3FBZcth05JAdb+Wf2OmlI WxLdpG2uBDB67DuhipbnLxTIqLjtrbQ6QpR4XHa0r1dmHJwTwg7y6X3lD7ZTUNO+GKuO tQybq3lb1k81dgSeRm4NEDuvgrzKt2HBG5ojydyIByElS3zTzz9FDBQwpz+1c7bUXhdw HOasHtzR6fzVHZYqhQoFlybeGp86t1hTjqsXHBi4YR2RJ/Xxz9gxuUNiliyBmEl6uuzS ZtW4YMdcuCAIdmqKNWJ8rR+JKX/T2aA8fOfu6bDcsUJnyx7LOP5jplWnofpW7EuVcBCp Jbuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E6TeQjSw; 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 t16-20020a632250000000b0046edccffb8dsi479684pgm.535.2022.10.24.13.13.29; Mon, 24 Oct 2022 13:13:41 -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=E6TeQjSw; 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 S230324AbiJXUBK (ORCPT + 99 others); Mon, 24 Oct 2022 16:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234313AbiJXT7j (ORCPT ); Mon, 24 Oct 2022 15:59:39 -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 53129172B54; Mon, 24 Oct 2022 11:22:30 -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 B3112B81730; Mon, 24 Oct 2022 12:35:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DC4AC433D6; Mon, 24 Oct 2022 12:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614920; bh=Sv1I4qRxsNAcOAYNJeyF0HrhTXqVyHtQl4EVlTTTgHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E6TeQjSwfq1shbb/1M18uW+8i/Si8gm0p3fsB570tZZuL6yCUDLlrflLL1b8yCyKK E13eIlouSGqXGCNuzHzTFn3X/kUa4X2J42/rcs7AFS0W2dTk9HQMqXpKVIjZVI6c1l ZiuFKHX4xzD3c8/lhvrT6H8+NsC43hARBdyubMcs= 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 5.15 053/530] drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error Date: Mon, 24 Oct 2022 13:26:37 +0200 Message-Id: <20221024113047.430780121@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747601244079457273?= X-GMAIL-MSGID: =?utf-8?q?1747601244079457273?= 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 @@ -247,6 +247,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;