Skip to contentSkip to conversation

New: [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

Bug 201015 [email protected] 1 participant 12 messages Sep 5, 2018 – Nov 10, 2018

lore
Share & tools
lore
#0 lore raw

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

Bug ID: 201015
Summary: [amdgpu] BUG: unable to handle kernel NULL pointer
dereference on resume with 2 monitors (vega)
Product: Drivers
Version: 2.5
Kernel Version: 4.19-rc2
Hardware: All
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 278309
--> https://bugzilla.kernel.org/attachment.cgi?id=278309&action=edit
dmesg, failed resume with 2 monitors

Happens on resume from suspend when 2 monitors are connected (over DisplayPort).
With 1 monitor suspend/resume works reliably.

Vega 64 (Sapphire Nitro+)
Dell P2415Q and LG 27UD69P, connected over DisplayPort

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

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

--- Comment #1 from Aleksandr Mezin ([email protected]) --- Created attachment 278311
--> https://bugzilla.kernel.org/attachment.cgi?id=278311&action=edit
dmesg, multiple suspend-resume cycles with 1 monitor, then attached 2nd monitor, resume failed

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

Michel Dänzer ([email protected]) changed:

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

                 CC|                            |[email protected],
                   |                            |[email protected]

--- Comment #2 from Michel Dänzer ([email protected]) --- Is this a regression in 4.19-rc compared to 4.18?

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #3 from Aleksandr Mezin ([email protected]) --- (In reply to Michel Dänzer from comment #2)

Quoted 1 line

Is this a regression in 4.19-rc compared to 4.18?

No, happens on 4.18.5 too.

But on 4.18 suspend-resume also triggers
https://bugzilla.kernel.org/show_bug.cgi?id=200531 (one of the monitors turns off quickly -> resume with one monitor in standby mode -> triggers REG_WAIT timeout). But null pointer dereference is there too. With only one monitor quick suspend-resume on 4.18.5 works fine (exactly as it is on 4.19-rc2).

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #4 from Nicholas Kazlauskas ([email protected]) --- Created attachment 278425
--> https://bugzilla.kernel.org/attachment.cgi?id=278425&action=edit
0001-drm-amd-display-Add-null-checks-to-surface-update-in.patch

I'm unable to reproduce the issue under Ubuntu 18.04, GNOME, 4.19 rc2 and a Vega.

What's your userspace setup like?

You can try the attached patch and see if that helps the problem. Try booting with drm.debug=6 in your bootline and post the results of the suspend with the patch.

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #5 from Aleksandr Mezin ([email protected]) --- Created attachment 278427
--> https://bugzilla.kernel.org/attachment.cgi?id=278427&action=edit
Kernel log, 2 suspend-resume attempts, second one failed

(In reply to Nicholas Kazlauskas from comment #4)

Quoted 7 lines

Created attachment 278425 [details] 0001-drm-amd-display-Add-null-checks-to-surface-update-in.patch

I'm unable to reproduce the issue under Ubuntu 18.04, GNOME, 4.19 rc2 and a Vega.

What's your userspace setup like?

Arch Linux, 4.19-rc3, GNOME 3.28.3

Quoted 4 lines

You can try the attached patch and see if that helps the problem. Try booting with drm.debug=6 in your bootline and post the results of the suspend with the patch.

This time first suspend-resume worked fine, second one failed

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #6 from Nicholas Kazlauskas ([email protected]) --- I'd imagine you're probably running GNOME on Wayland from that setup environment.

The patch seems to fix the null pointer deference but you're probably getting a black screen from those failed atomic commits.

Might not be a problem with the driver but with the GNOME Wayland implementation - I would need to do more investigation to see which atomic commits are failing and if the failures are valid (but unchecked).

You would probably not see this occur for GNOME over Xorg.

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #7 from Aleksandr Mezin ([email protected]) --- (In reply to Nicholas Kazlauskas from comment #6)

Quoted 11 lines

I'd imagine you're probably running GNOME on Wayland from that setup environment.

The patch seems to fix the null pointer deference but you're probably getting a black screen from those failed atomic commits.

Might not be a problem with the driver but with the GNOME Wayland implementation - I would need to do more investigation to see which atomic commits are failing and if the failures are valid (but unchecked).

You would probably not see this occur for GNOME over Xorg.

No, it occurs with Gnome on Xorg, with modesetting driver. Gnome on Wayland seems to handle suspend and resume fine (even on unpatched 4.19-rc3). Also, I tried xf86-video-amdgpu. It works like Gnome on Wayland, but sometimes after resume one display is limited to 800x600 resolution only (it's a 4k display). Probably another different issue.

I expected modesetting driver to work though.

Signature · 6 lines
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 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #8 from Aleksandr Mezin ([email protected]) --- Created attachment 278457
--> https://bugzilla.kernel.org/attachment.cgi?id=278457&action=edit
kernel log: patched kernel + xorg modesetting, resume failed

Even with patched kernel, when resume fails there are errors in kernel log (when using modesetting driver):

[   98.136982] [drm:drm_atomic_helper_wait_for_flip_done [drm_kms_helper]]
*ERROR* [CRTC:43:crtc-0] flip_done timed out
[  103.668322] [drm:dc_remove_plane_from_context [amdgpu]] *ERROR* Existing
plane_state not found; failed to detach it!
[  103.702464] [drm:dc_remove_plane_from_context [amdgpu]] *ERROR* Existing

plane_state not found; failed to detach it!

Signature · 6 lines
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
#9 lore raw

[Bug 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #9 from Aleksandr Mezin ([email protected]) --- Created attachment 278459
--> https://bugzilla.kernel.org/attachment.cgi?id=278459&action=edit
user log: patched kernel + xorg modesetting, resume failed

сен 12 01:05:22 X299 /usr/lib/gdm-x-session[1593]: (WW) modeset(0): flip queue
failed: Invalid argument
сен 12 01:05:22 X299 /usr/lib/gdm-x-session[1593]: (WW) modeset(0): Page flip
failed: Invalid argument
сен 12 01:05:22 X299 /usr/lib/gdm-x-session[1593]: (EE) modeset(0): present flip failed
сен 12 01:05:22 X299 /usr/lib/gdm-x-session[1593]: (WW) modeset(0): flip queue
failed: Invalid argument
сен 12 01:05:22 X299 /usr/lib/gdm-x-session[1593]: (WW) modeset(0): Page flip
failed: Invalid argument

Signature · 6 lines
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
#10 lore raw

[Bug 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

--- Comment #10 from Aleksandr Mezin ([email protected]) --- After recent updates, the issue went away. But I'm not sure what exactly has changed. I tried reverting the kernel (to 4.19-rc3) and libdrm, but still can't trigger it anymore.

Signature · 6 lines
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
#11 lore raw

[Bug 201015] [amdgpu] BUG: unable to handle kernel NULL pointer dereference on resume with 2 monitors (vega)

In reply to [email protected]

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

Aleksandr Mezin ([email protected]) changed:

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

             Status|NEW                         |RESOLVED
         Resolution|---                         |OBSOLETE
Signature · 6 lines
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