stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 01/58] drm/amdgpu/gfx6: fix CSIB handling
@ 2025-06-01 23:39 Sasha Levin
  2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 02/58] drm/dp: add option to disable zero sized address only transactions Sasha Levin
                   ` (56 more replies)
  0 siblings, 57 replies; 58+ messages in thread
From: Sasha Levin @ 2025-06-01 23:39 UTC (permalink / raw)
  To: patches, stable
  Cc: Alex Deucher, Rodrigo Siqueira, Sasha Levin, christian.koenig,
	airlied, simona, sunil.khatri, alexandre.f.demers, boyuan.zhang,
	kevinyang.wang, mario.limonciello, amd-gfx, dri-devel,
	linux-kernel

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit 8307ebc15c1ea98a8a0b7837af1faa6c01514577 ]

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

Now let me understand what the bug is. Looking at the original code:
```c for (sect = adev->gfx.rlc.cs_data; sect->section != NULL; ++sect) {
for (ext = sect->section; ext->extent != NULL; ++ext) { if (sect->id ==
SECT_CONTEXT) { // process SECT_CONTEXT sections } else { return; //
BUG: This returns early, skipping remaining code } } } // Important code
that should always run: buffer[count++] =
cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, 1)); buffer[count++] =
cpu_to_le32(mmPA_SC_RASTER_CONFIG - PACKET3_SET_CONTEXT_REG_START); //
... more important buffer initialization ``` The fix removes the early
return so that all sections are processed and the important buffer
initialization at the end always runs. **YES** This commit should be
backported to stable kernel trees for the following reasons: 1. **Clear
Bug Fix**: The commit fixes a clear logic error where an early return
statement prevents critical buffer initialization code from executing.
The original code would return immediately when encountering a non-
SECT_CONTEXT section, skipping the important packet commands that should
always be written to the buffer (PACKET3_SET_CONTEXT_REG,
PACKET3_PREAMBLE_END_CLEAR_STATE, PACKET3_CLEAR_STATE). 2. **Functional
Impact**: This bug affects the Clear State Indirect Buffer (CSIB)
handling in AMD GPU driver for GFX6 hardware. The incomplete buffer
initialization could lead to: - Incorrect GPU state during graphics
operations - Potential rendering issues or GPU hangs - Inconsistent
hardware behavior 3. **Small and Contained Fix**: The fix is minimal -
it simply removes two lines (the else block with return statement). This
is a low-risk change that doesn't introduce new functionality or alter
the architecture. 4. **Hardware-Specific Bug**: This affects real users
with GFX6 AMD GPUs. The bug prevents proper initialization of the GPU's
clear state buffer, which is essential for correct GPU operation. 5.
**Similar to Historical Backports**: Looking at commit 4 in the similar
commits (marked as YES for backporting), which also fixed preamble
handling issues in the AMD GPU driver, this follows a similar pattern of
fixing command buffer handling bugs. The commit message clearly
indicates this is a bug fix ("We shouldn't return after the last
section. We need to update the rest of the CSIB"), and the code change
confirms that critical buffer initialization was being skipped due to
the premature return.

 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index 204b246f0e3f9..0219f1175c078 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -2873,8 +2873,6 @@ static void gfx_v6_0_get_csb_buffer(struct amdgpu_device *adev,
 				buffer[count++] = cpu_to_le32(ext->reg_index - 0xa000);
 				for (i = 0; i < ext->reg_count; i++)
 					buffer[count++] = cpu_to_le32(ext->extent[i]);
-			} else {
-				return;
 			}
 		}
 	}
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2025-06-01 23:42 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-01 23:39 [PATCH AUTOSEL 6.1 01/58] drm/amdgpu/gfx6: fix CSIB handling Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 02/58] drm/dp: add option to disable zero sized address only transactions Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 03/58] sunrpc: update nextcheck time when adding new cache entries Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 04/58] drm/amd/display: DCN32 null data check Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 05/58] drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 06/58] exfat: fix double free in delayed_free Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 07/58] arm64/cpuinfo: only show one cpu's info in c_show() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 08/58] drm/bridge: anx7625: change the gpiod_set_value API Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 09/58] drm/amdgpu/gfx11: fix CSIB handling Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 10/58] media: i2c: imx334: Enable runtime PM before sub-device registration Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 11/58] drm/msm/hdmi: add runtime PM calls to DDC transfer function Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 12/58] media: uapi: v4l: Fix V4L2_TYPE_IS_OUTPUT condition Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 13/58] drm/amd/display: Add NULL pointer checks in dm_force_atomic_commit() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 14/58] drm/amd/display: Skip to enable dsc if it has been off Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 15/58] drm/msm/a6xx: Increase HFI response timeout Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 16/58] media: i2c: imx334: Fix runtime PM handling in remove function Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 17/58] drm/amdgpu/gfx10: fix CSIB handling Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 18/58] drm: panel-orientation-quirks: Add ZOTAC Gaming Zone Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 19/58] media: ccs-pll: Better validate VT PLL branch Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 20/58] media: uapi: v4l: Change V4L2_TYPE_IS_CAPTURE condition Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 21/58] drm/amdgpu/gfx7: fix CSIB handling Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 22/58] ext4: ext4: unify EXT4_EX_NOCACHE|NOFAIL flags in ext4_ext_remove_space() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 23/58] jfs: fix array-index-out-of-bounds read in add_missing_indices Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 24/58] media: ti: cal: Fix wrong goto on error path Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 25/58] media: rkvdec: h264: Use bytesperline and buffer height as virstride Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 26/58] media: rkvdec: Initialize the m2m context before the controls Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 27/58] sunrpc: fix race in cache cleanup causing stale nextcheck time Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 28/58] ext4: prevent stale extent cache entries caused by concurrent get es_cache Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 29/58] drm/amdgpu/gfx8: fix CSIB handling Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 30/58] drm/amdgpu/gfx9: " Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 31/58] jfs: Fix null-ptr-deref in jfs_ioc_trim Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 32/58] drm/amd/display: Correct prefetch calculation Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 33/58] drm/msm/dpu: don't select single flush for active CTL blocks Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 34/58] drm/amdkfd: Set SDMA_RLCx_IB_CNTL/SWITCH_INSIDE_IB Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 35/58] media: tc358743: ignore video while HPD is low Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 36/58] media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 37/58] media: i2c: imx334: update mode_3840x2160_regs array Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 38/58] nios2: force update_mmu_cache on spurious tlb-permission--related pagefaults Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 39/58] media: rcar-vin: Fix stride setting for RAW8 formats Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 40/58] media: qcom: venus: Fix uninitialized variable warning Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 41/58] ACPI: bus: Bail out if acpi_kobj registration fails Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 42/58] pmdomain: ti: Fix STANDBY handling of PER power domain Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 43/58] PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn() Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 44/58] ASoC: amd: yc: Add quirk for Lenovo Yoga Pro 7 14ASP9 Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 45/58] thermal/drivers/qcom/tsens: Update conditions to strictly evaluate for IP v2+ Sasha Levin
2025-06-01 23:39 ` [PATCH AUTOSEL 6.1 46/58] clocksource/drivers/timer-tegra186: Fix watchdog self-pinging Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 47/58] gpio: pxa: Make irq_chip immutable Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 48/58] gpio: grgpio: " Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 49/58] gpio: xgene-sb: " Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 50/58] mmc: Add quirk to disable DDR50 tuning Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 51/58] clocksource: Fix the CPUs' choice in the watchdog per CPU verification Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 52/58] ACPICA: Avoid sequence overread in call to strncmp() Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 53/58] ACPICA: utilities: Fix overflow check in vsnprintf() Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 54/58] ACPI: EC: Add device to acpi_ec_no_wakeup[] qurik list Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 55/58] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 56/58] cpufreq: Force sync policy boost with global boost on sysfs update Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 57/58] power: supply: bq27xxx: Retrieve again when busy Sasha Levin
2025-06-01 23:40 ` [PATCH AUTOSEL 6.1 58/58] ASoC: tas2770: Power cycle amp on ISENSE/VSENSE change Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).