Re: [PATCH v1] drm/radeon: stop the GPU before kexec
From: Nickolai Zeldovich
Date: Wed Nov 18 2026 - 10:22:42 EST
On Wed, Nov 18, 2026 at 7:11 AM Christian König
<christian.koenig@xxxxxxx> wrote:
> On 11/17/26 18:03, Nickolai Zeldovich wrote:
> > Suspend the GPU in radeon_pci_shutdown() on kexec, as PPC64 and Loongson
> > already do on every shutdown. Normal shutdown and reboot are unchanged:
> > commit 8d13c187c42e ("Revert "drm/radeon: Fix EEH during kexec"")
> > removed the same call there because it hung some HD 5770 systems.
>
> Yeah that is clearly not the right approach.
>
> The kexec is often done to switch to a new kernel because the old one has encountered some severe problem, doing a HW suspend in such a situation is not guaranteed to work.
>
> What should be done instead is to fix the initialization order and/or disable GART before the bus mastering is enabled again.
Thanks, that makes sense. I tried disabling the IH at the start of
evergreen_startup(), before the MC programming raises the page-flip
interrupts. I also had to clear IH_WPTR_WRITEBACK_ENABLE when disabling
the IH; otherwise resetting the write pointer writes it back through
the stale GART, which is one more stray write. With both changes, I
see no stray writes (no canary-page corruption, and successful kexec reboots).
On disabling the GART: the new GART is already enabled before bus
mastering, so, as far as I can tell, the stray writes were translated
through the old one earlier, during the MC programming. Disabling the
old GART before that would also keep the stray writes out of system
memory, but evergreen_pcie_gart_disable() and its counterparts also
unpin the GART BO, which is not pinned at that point, so disabling the
IH seemed the more direct fix.
Before I send a v2, a quick question about scope. R600, RV770,
Cayman, SI and CIK have the same IH, and their *_startup() functions
program the MC before their irq_init() in the same way, so the same
two-line change (see below; disable the IH at the start of
*_startup(), and clear the writeback enable in the corresponding
*_disable_interrupts()) should apply to all of them. But I can only
test Evergreen: my card is a Caicos (HD 6450), which runs
evergreen_startup(). Would you prefer I just fix Evergreen, or all 6
families (the other 5 only compile-tested)?
Nickolai.
For reference, the Evergreen version without comments (with apologies
for the loss of tabs):
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -5010,6 +5010,8 @@ static int evergreen_startup(struct radeon_device *rdev)
int r;
struct drm_device *ddev = rdev_to_drm(rdev);
+ r600_disable_interrupts(rdev);
+
/* enable pcie gen2 link */
evergreen_pcie_gen2_enable(rdev);
/* enable aspm */
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3604,7 +3604,7 @@ void r600_disable_interrupts(struct radeon_device *rdev)
u32 ih_rb_cntl = RREG32(IH_RB_CNTL);
u32 ih_cntl = RREG32(IH_CNTL);
- ih_rb_cntl &= ~IH_RB_ENABLE;
+ ih_rb_cntl &= ~(IH_RB_ENABLE | IH_WPTR_WRITEBACK_ENABLE);
ih_cntl &= ~ENABLE_INTR;
WREG32(IH_RB_CNTL, ih_rb_cntl);
WREG32(IH_CNTL, ih_cntl);