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 90F6B606A31A for ; Tue, 1 Dec 2026 23:30:32 +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=cKR/iyRp Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 535D510EAA4; Tue, 1 Dec 2026 23:30:27 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66DC310EAA4 for ; Tue, 1 Dec 2026 23:30:21 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 2261C452B0; Tue, 1 Dec 2026 23:30:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA89E1F000C1; Tue, 1 Dec 2026 23:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796167821; bh=WigymVCmpOxPAV6T6G1+bLyjFwTFk1x/WfLoWthG3KI=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=cKR/iyRpRatyf5PUW7WnAdRXGML8M3gXov+8DM3rz2jbZLKgF9RUGmGzgXV8KT6cO QdRr4lEApyeL2YB7LQuB6EQI8aWx5urRXp9PdHUIhGzS+U+ZiaEGZrtmL/KubKR1jw 3nZrSGmcNBedjEFtU54ruxVXLoz3nK5Mi02L88oXcxGAVV/otcLNP4Anr7jo7n8oQY IHLjo6YbMvL++YWRr1eZd7ynGthL8jln2STw7fkeJTyPKnxy4PynBeJUQ0M6Jvc3DH aNVmHUEKYTlJ4Vr5bUcOMfwq0RmTrcsD3vDiiL0QZfongzPTnzwPxF7ExnY2sjbyvv 3KQf6pM1/dQ3Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RESEND PATCH v3 1/3] drm/xe/forcewake: add delayed release with hysteresis To: "Zongyao Bai" , intel-xe@lists.freedesktop.org In-Reply-To: <20261201230744.680448-2-zongyao.bai@intel.com> References: <20261201230744.680448-1-zongyao.bai@intel.com> <20261201230744.680448-2-zongyao.bai@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 23:30:20 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" 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: - [Medium] drm/xe/forcewake: unflushed delayed release across PCIe FLR in xe_gt_flr_prepare() -- commit 2e2963541af2cb3833279db65dd42d66d442d570 Author: Zongyao Bai drm/xe/forcewake: add delayed release with hysteresis This commit adds xe_force_wake_put_delay() and a delayed work item to keep forcewake domains awake for a short hysteresis window after their last reference is dropped. > diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_f= orce_wake.c > index 197e2197bd0a3..1b69e8e1e8eb1 100644 > --- a/drivers/gpu/drm/xe/xe_force_wake.c > +++ b/drivers/gpu/drm/xe/xe_force_wake.c [ ... ] > @@ -187,8 +223,13 @@ unsigned int __must_check xe_force_wake_get(struct x= e_force_wake *fw, > spin_lock_irqsave(&fw->lock, flags); > for_each_fw_domain_masked(domain, ref_rqst, fw, tmp) { > if (!domain->ref++) { > - awake_rqst |=3D BIT(domain->id); > - domain_wake(gt, domain); > + if (fw->delayed_domains & BIT(domain->id)) { > + /* Still awake from a delayed release: reuse it. */ > + fw->delayed_domains &=3D ~BIT(domain->id); > + } else { > + awake_rqst |=3D BIT(domain->id); > + domain_wake(gt, domain); > + } > } > ref_incr |=3D BIT(domain->id); > } [Severity: Medium] What happens to domains in fw->delayed_domains across a PCIe FLR? Even with commit "drm/xe/forcewake: flush delayed release at power and teardown boundaries" flushing delayed domains in xe_gt_suspend() and xe_gt_runtime_suspend(), xe_pci_reset_prepare() calls xe_device_suspend(xe, false, true) with flr =3D true, which runs xe_gt_flr_prepare() and skips xe_gt_suspend(). If a domain is in fw->delayed_domains when an FLR starts, fw->delayed_release_work can fire during the reset and time out waiting for a sleep ACK on a resetting device, or BIT(domain->id) can remain set in fw->delayed_domains into xe_pci_reset_done() -> xe_gt_resume() so that xe_force_wake_get() skips domain_wake() on a domain that hardware reset to sleep. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201230744.6804= 48-1-zongyao.bai@intel.com?part=3D1