Bug 212957 - [radeon] kernel NULL pointer dereference during system boot
Summary: [radeon] kernel NULL pointer dereference during system boot
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: x86-64 Linux
: P1 high
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-05 21:17 UTC by Dennis Foster
Modified: 2021-05-27 17:19 UTC (History)
3 users (show)

See Also:
Kernel Version: 5.12.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
journalctl (3.74 KB, text/plain)
2021-05-05 21:17 UTC, Dennis Foster
Details
journalctl - bad commit (3.82 KB, text/plain)
2021-05-12 01:35 UTC, Dennis Foster
Details

Description Dennis Foster 2021-05-05 21:17:25 UTC
Created attachment 296657 [details]
journalctl

GPU: Radeon RX 470 + ATI FirePro 2270

Cannot boot into graphical session with recent kernel 5.12.1, the system gets stuck at black screen.

May 05 16:38:58 homeserver kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000

Could be possible regression of https://bugzilla.kernel.org/show_bug.cgi?id=212137
Comment 1 Alex Deucher 2021-05-05 21:54:44 UTC
Can you bisect?
Comment 2 Arvin 2021-05-08 15:45:15 UTC
I can confirm I have a similar issue on a laptop with AMD dual GPU (6520G + HD 6750M). The system boots to a graphical desktop (MATE + LightDM) and works fine until I open a program with the discrete graphics (DRI_PRIME=1).

Going to bisect once I get the laptop later in the day.
Comment 3 Dennis Foster 2021-05-12 00:50:41 UTC
(In reply to Alex Deucher from comment #1)
> Can you bisect?

0575ff3d33cd62123991d2a5d0d8459d72592388 is the first bad commit
commit 0575ff3d33cd62123991d2a5d0d8459d72592388
Author: Christian König <christian.koenig@amd.com>
Date:   Thu Oct 8 13:01:35 2020 +0200

    drm/radeon: stop using pages with drm_prime_sg_to_page_addr_arrays v2
    
    This is deprecated.
    
    v2: also use ttm_sg_tt_init to avoid allocating the page array.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/403832/

 drivers/gpu/drm/radeon/radeon_ttm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)


I wasn't able to revert this commit on v5.12, because there's another commit c67e62790f5c156705fb162da840c6d89d0af6e0 where it seems like that file was changed drastically, in particular drm_prime_sg_to_page_addr_arrays() was replaced with drm_prime_sg_to_dma_addr_array().
Comment 4 Dennis Foster 2021-05-12 01:35:12 UTC
Created attachment 296723 [details]
journalctl - bad commit

Attached is a part of the system log after checking out the bisected commit.
Comment 5 Dennis Foster 2021-05-27 17:19:54 UTC
The issue is now resolved in kernel version 5.12.7

Link to the patch commit:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.12.y&id=ec1bd01b632ad748dce8a0eeb4c167bead71315f

Note You need to log in before you can comment on or make changes to this bug.