Skip to contentSkip to conversation

New: [amdgpu] divide error: 0000 on resume from S3

Bug 212293 [email protected] 1 participant 9 messages Mar 15, 2021 – May 29, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=212293

            Bug ID: 212293
           Summary: [amdgpu] divide error: 0000 on resume from S3
           Product: Drivers
           Version: 2.5
    Kernel Version: 5.11.6
          Hardware: x86-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Video(DRI - non Intel)
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Created attachment 295869
--> https://bugzilla.kernel.org/attachment.cgi?id=295869&action=edit
kernel log since resume

My system experiences a kernel panic when resuming from S3, coming from amdgpu. The GPU has to be in a specific state for this to happen. Mainly when my desktop environment turns off the screens after some inactivity, and subsequently suspends the system.

This issue only occurs with kernel versions 5.11.x.
I could only reproduce this with KDE Plasma / KWin on Wayland, while testing KDE Plasma / KWin on Xorg and on Wayland (Xorg seems to work fine).

REPRODUCTION
1. Start KDE Plasma / KWin on Wayland
2. Set Screen Energy Saving "Switch off after" to a low value like 1min
3. Wait until Plasma has turned off screens
4. Suspend the system (via SSH for example)
5. Try to wake from sleep

SYSTEM INFO
CPU: AMD Ryzen 9 3900X
Mainboard: ASUS ROG STRIX B450-F GAMING II
GPU: GIGABYTE Radeon RX VEGA 56 GAMING OC 8G

ATTACHMENTS
I attached the kernel panic I could capture via ttyS0.

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #1 from Sefa Eyeoglu ([email protected]) --- ADDITIONAL SYSTEM INFO
OS: Arch Linux (with testing repos)

Kernels with this issue: 5.11.6.arch1, 5.11.6.zen1, 5.12rc2 (built from Arch Linux User Repository)
Kernels without this issue: 5.10.23-1-lts

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

Alex Deucher ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Alex Deucher ([email protected]) --- Can you bisect?
https://www.kernel.org/doc/html/latest/admin-guide/bug-bisect.html

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #3 from Sefa Eyeoglu ([email protected]) --- This took some time, as I apparently went wrong paths sometimes.

Anyways.

I bisected between tags v5.10 (good) and v5.11 (bad), while only looking at path "drivers/gpu/drm/amd".

At the end I landed at commit 12f4849a1cfd69f3c37cca042f2e9c512f923741 by Simon Ser (emersion).

I will do some debugging myself to see if it's the real deal, but that change might very well be it.

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #4 from Sefa Eyeoglu ([email protected]) --- Created attachment 295887
--> https://bugzilla.kernel.org/attachment.cgi?id=295887&action=edit
git bisect log

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #5 from Sefa Eyeoglu ([email protected]) --- I was unable to add Simon Ser to CC

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #6 from Sefa Eyeoglu ([email protected]) --- Okay I tried to debug it by printing.

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 573cf17262da..8e6b890ad611 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
@@ -9271,6 +9271,8 @@ static int dm_check_crtc_cursor(struct drm_atomic_state

*state,

                return 0;
        }

+ printk("SCRUMPLEX_DEBUG %d %d %d %d", new_cursor_state->src_w,
new_cursor_state->src_h, new_primary_state->src_w, new_primary_state->src_h); +

        cursor_scale_w = new_cursor_state->crtc_w * 1000 /
                         (new_cursor_state->src_w >> 16);
        cursor_scale_h = new_cursor_state->crtc_h * 1000 /
Signature · 29 lines
2.31.0


This adds my very professional printk, which outputs all values that are used
to divide in any way later.


While reproducing the issue I got the following output

[   89.850437] SCRUMPLEX_DEBUG 8388608 8388608 0 0


So some weird state is causing the src_w and src_h values of
"new_primary_state" to be 0.

That would explain the issue to me. Now I don't know enough about
drm_plane_state and drm_atomic_get_new_plane_state to say why this is like
this. But as with most of these kinds of issues. A simple condition check
beforehand would solve this issue.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

--- Comment #7 from Sefa Eyeoglu ([email protected]) --- I submitted a patch here:
https://lists.freedesktop.org/archives/amd-gfx/2021-March/060754.html

Signature · 8 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

[Bug 212293] [amdgpu] divide error: 0000 on resume from S3

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=212293

Sefa Eyeoglu ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #8 from Sefa Eyeoglu ([email protected]) --- Fixed in 5.11 and 5.12

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.