From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6855606A322 for ; Thu, 3 Dec 2026 21:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=A2anQtpt Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FEDF10E6C5; Thu, 3 Dec 2026 21:39:57 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D3D510E51C for ; Thu, 3 Dec 2026 21:39:50 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 06998408B2; Thu, 3 Dec 2026 21:39:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA2131F0092C; Thu, 3 Dec 2026 21:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796333989; bh=16DXNNsrBP01S/GniP3JOZvaLhKXJp1FVFZDau81fRc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=A2anQtptC2nRFF6Lf1f+oo3Frr7SBeIsJRAoskgCt8XKwwmWnxuf8bqcdA6gOZzoZ QjLF9/vFMeyShqzZTwQs/BO94eIiA6KLs0XBu37G1CffMQQ6l9aPnCUZCUdWDM19A0 dXfUuYv0H8h3UZ4XT+j9uvC/M+pvpdTB1o+HomgIG6aWuFpBvsBApoUCxyPfOuCA1n 9eXxTGkl2zHzmN4PsBgszgJoGS5eJldL9gnNucmQBFYCsnl8g6YKr9sHC4Aa0bwpOt 8CQVymLpumCLYALotdRjtKfQjdlkLK3/Z990z9eqUX/nIu664NkxdbUYePDF2p2ztx TVEKms/c/1uXQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/virtio: Reset device before deleting virtqueues on init failure To: "Yuho Choi" Cc: dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev, "Michael S. Tsirkin" , "Eugenio Perez" In-Reply-To: <20261203212127.2147347-2-oss.patchbox@gmail.com> References: <20261203212127.2147347-2-oss.patchbox@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 21:39:49 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] drm/virtio: redundant double virtio_reset_device() in virtio_gpu_init() -- commit 4d07ab1dc65a97542b38fd22d37c228f75391c94 Author: Yuho Choi drm/virtio: Reset device before deleting virtqueues on init failure This commit adds a virtio_reset_device() call in the err_vbufs error path of virtio_gpu_init() so the device is reset before deleting virtqueues when virtio_gpu_alloc_vbufs() or virtio_gpu_modeset_init() fails. > diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virti= o/virtgpu_kms.c > index 1d4d3bf46a202..c729545e41f52 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_kms.c > +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c > @@ -326,6 +326,7 @@ int virtio_gpu_init(struct virtio_device *vdev, struc= t drm_device *dev) > err_scanouts: > virtio_gpu_free_vbufs(vgdev); > err_vbufs: > + virtio_reset_device(vgdev->vdev); > vgdev->vdev->config->del_vqs(vgdev->vdev); > err_vqs: > dev->dev_private =3D NULL; [Severity: Low] Does the err_reset_device unwind path now call virtio_reset_device() twice? When waiting for display info times out, virtio_gpu_init() jumps to err_reset_device, calls virtio_reset_device(), and falls through into err_vbufs to reset the device again before del_vqs(). The second call repeats the transport reset and virtio_synchronize_cbs() unnecessarily. Skipping the second virtio_reset_device() on the err_reset_device path by jumping directly to del_vqs() after virtio_gpu_free_vbufs() would avoid the redundant reset. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203212127.2147= 347-2-oss.patchbox@gmail.com?part=3D1