From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794591263; b=kjP3AAzfnVsrIq5uMbWiJ5t3doPJ8AXWAaWgDuD/i6BOJk5iV3ssG3epVW3pezSq0mxB mnCjemLZMHbg6Y9yQIz8Mpyw2oB8q2J0wGAwV7EAc3BuMpNGH8V1mWdmuG5hyo9DB3I3R GM5/c0UpK1JXun+snwm6gFAWLHqMpkbZemCWqiqBJbPShDZBJJT78TNO4HHBoIMo4HFy7 aMPyUM8QDlAZ/4iDFBEbuQJZR3Cl3iHUvJpyLGy4H06okLxCLTKYYz+JJMhS2kYCGkPIg +WO7cvo0zT4z7w9kN840oS+q/e0keoHgf/tuxig2zqpZPP8MO45e5vptOLDebFKZXJw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794591263; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=i37QS2i4NXO3tqZxRYpaid+uPT+6s4Z9RxJAwE7p0hY=; b=X01qVBAwflpiWElsnDkymNoDP81k5RIcUcZZVhUGcDmhyKQ4F/rBZn2OjryLhc/kfmw6 6nMSPWmvp1AN04u6+hL+h0nzbJnES/WY8Trc+G9TcpjH5ns7BIGCTnt3rsEwkvyOdJPy3 yG6wYTRSlKl2BPkaIaVn+oFrJhUaz6OsT5A9GGNnBvaPfTuYg89RqcAIE+NHX0ZEqEbL+ 25DG5a0JGi1/x01WQ7BjE7Q7fl75lKLTkZY3xq7z/41WLX5sFxqjigRfV3oTJuHSawW16 PDG5yOtpMfDeurkzdKMjpN1hL6ROQjzf6COrrLc0UqjnLia5uU1KSelTfaag2UdkAJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=xBKiDoKk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03C2C6076F93; Fri, 13 Nov 2026 17:34:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=xBKiDoKk Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3CCA1F000C4; Fri, 13 Nov 2026 17:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794591262; bh=i37QS2i4NXO3tqZxRYpaid+uPT+6s4Z9RxJAwE7p0hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xBKiDoKkvEDh/EQ4DmTujs1qEGurtFTFifcpB7OjSptiobjjImreRlMi6tUF8m2qa 8XL4GoHTW2i84r7Gz3Vn0amJXgjow7hwKFTrbG5P/NaEMThmpXjFUv8yA5EQbRVekK i5oS7J8ZeXiNQZo9CccjrdCqSkwgGIKfucPEzeEQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Danijel Slivka , Milan Milicevic , Alex Deucher , Sasha Levin Subject: [PATCH 6.12 344/670] drm/amdgpu: publish IH enabled before PSP programs IH_RB_CNTL Date: Fri, 13 Nov 2026 10:48:28 -0500 Message-ID: <20261113153823.499493064@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261113153811.177190860@linuxfoundation.org> References: <20261113153811.177190860@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Milan Milicevic [ Upstream commit 9d550dd1a3b4b96da49f3560a84b5c2413a88cd3 ] On SR-IOV, programming IH_RB_CNTL through PSP is slow enough for the first MSI to arrive before ih->enabled is set. amdgpu_ih_process() then drops the interrupt, rptr stays at 0, and RPTR_REARM never generates another edge, so every ring hits the fence fallback timer. Set ih->enabled before psp_reg_program() on the indirect IH path for Navi10 and IH v6.0, and clear it if programming fails. Signed-off-by: Danijel Slivka Signed-off-by: Milan Milicevic Acked-by: Alex Deucher Signed-off-by: Alex Deucher (cherry picked from commit b2f9434f9d17c94798e8d8957af3adc4a9949016) Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 13 ++++++++++++- drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c index fa6c7e5fbbe3b..78775b8cfbc6c 100644 --- a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c @@ -168,8 +168,19 @@ static int ih_v6_0_toggle_ring_interrupts(struct amdgpu_device *adev, tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, ENABLE_INTR, (enable ? 1 : 0)); if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) { - if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) + /* + * PSP programming of IH_RB_CNTL is slow enough for MSI to + * arrive before this call returns. Publish ih->enabled first + * so amdgpu_ih_process() consumes that IV and rearms. + */ + if (enable) { + ih->enabled = true; + smp_wmb(); + } + if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) { + ih->enabled = false; return -ETIMEDOUT; + } } else { WREG32(ih_regs->ih_rb_cntl, tmp); } diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c index b7fb128778b18..454a161a189f4 100644 --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c @@ -194,8 +194,19 @@ static int navi10_ih_toggle_ring_interrupts(struct amdgpu_device *adev, tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, ENABLE_INTR, (enable ? 1 : 0)); if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) { - if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) + /* + * PSP programming of IH_RB_CNTL is slow enough for MSI to + * arrive before this call returns. Publish ih->enabled first + * so amdgpu_ih_process() consumes that IV and rearms. + */ + if (enable) { + ih->enabled = true; + smp_wmb(); + } + if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) { + ih->enabled = false; return -ETIMEDOUT; + } } else { WREG32(ih_regs->ih_rb_cntl, tmp); } -- 2.53.0