Bug 74911

Summary: [R9 270X] - Frozen display output and no response from keyboard right after loading kernel image and initramfs
Product: Drivers Reporter: Ivan Bulatovic (combuster)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: RESOLVED CODE_FIX    
Severity: high    
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.15.0-rc2 Subsystem:
Regression: No Bisected commit-id:

Description Ivan Bulatovic 2014-04-27 15:27:56 UTC
After booting 3.15.0-rc2 kernel, I can only see a message from grub indicating that kernel and initram images are loaded and that's it. No response from keyboard, I can only do a hard reset.

After bisecting this is what I get:

1ebe92802eaf0569784dce843bc28a78842d236c is the first bad commit
commit 1ebe92802eaf0569784dce843bc28a78842d236c
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Fri Apr 11 11:21:49 2014 -0400

    drm/radeon: add support for newer mc ucode on SI (v2)
    
    May fix stability issues with some newer cards.
    
    v2: print out mc firmware version used and size
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org

:040000 040000 cc6858148ad9e132feeb443839a6d367a1799b4c d8888cd6da07ac42406fc8f7e4720477fc707f83 M      drivers

This makes sense, there is no radeon/PITCAIRN_mc2.bin blob anywhere. At least not in linux-firmware branch. 

I have compiled radeon drivers into the kernel image itself, here is a relevant config line:

CONFIG_EXTRA_FIRMWARE="radeon/PITCAIRN_ce.bin radeon/PITCAIRN_mc.bin radeon/PITCAIRN_me.bin radeon/PITCAIRN_pfp.bin radeon/PITCAIRN_rlc.bin radeon/PITCAIRN_smc.bin radeon/TAHITI_uvd.bin"
Comment 1 Michel Dänzer 2014-04-28 08:27:40 UTC
(In reply to Ivan Bulatovic from comment #0)
> After booting 3.15.0-rc2 kernel, I can only see a message from grub
> indicating that kernel and initram images are loaded and that's it. No
> response from keyboard, I can only do a hard reset.

How long have you waited for? Trying to load a non-existent firmware file may only time out after a minute or so.


> This makes sense, there is no radeon/PITCAIRN_mc2.bin blob anywhere. At
> least not in linux-firmware branch. 

You can get it e.g. from:

http://people.freedesktop.org/~agd5f/radeon_ucode/


> I have compiled radeon drivers into the kernel image itself, [...]

It's recommended to build the radeon driver as a module instead and let the firmware files be loaded from the initrd or normal filesystem.
Comment 2 Ivan Bulatovic 2014-04-28 09:37:38 UTC
> How long have you waited for? Trying to load a non-existent firmware file
> may only time out after a minute or so.

I've left it once for a while, but I'll test for how long and report back, seems to me it was about 4min.

> 
> > This makes sense, there is no radeon/PITCAIRN_mc2.bin blob anywhere. At
> > least not in linux-firmware branch. 
> 
> You can get it e.g. from:
> 
> http://people.freedesktop.org/~agd5f/radeon_ucode/
> 

Thanx, got it!
 
> > I have compiled radeon drivers into the kernel image itself, [...]
> 
> It's recommended to build the radeon driver as a module instead and let the
> firmware files be loaded from the initrd or normal filesystem.

Well, if it was recommended I haven't saw that recommendation anywhere. Used to build an intel driver into kernel image itself, KMS kicks in as early as possible. I did the same with radeon, and it works for me great this whole time.

Don't mean to be rude or anything, but I don't know if it is recommended (or desirable) to commit a piece of code to mainline that will _require_ a blob that can't be found in linux-firmware ?

I'll see about the timeout and report back in. 

Thanks Michel
Comment 3 Ivan Bulatovic 2014-04-28 09:57:45 UTC
Apologies, it opts out after a minute just like you've said it would.

[    0.793366] [drm] Loading PITCAIRN Microcode
[    0.793478] radeon 0000:01:00.0: Direct firmware load failed with error -2
[    0.793483] radeon 0000:01:00.0: Falling back to user helper
[    1.390284] tsc: Refined TSC clocksource calibration: 3092.973 MHz
[    2.390419] Switched to clocksource tsc
[   60.893686] [drm] radeon/PITCAIRN_mc.bin: 31076 bytes
[   60.893692] [drm] Internal thermal controller with fan control
[   60.893906] [drm] probing gen 2 caps for device 8086:101 = 2212d02/0
[   60.902426] [drm] radeon: dpm initialized
[   60.902575] [drm] GART: num cpu pages 262144, num gpu pages 262144
[   60.903606] [drm] probing gen 2 caps for device 8086:101 = 2212d02/0
[   60.903621] [drm] PCIE gen 2 link speeds already enabled
[   60.922014] [drm] PCIE GART of 1024M enabled (table at 0x0000000000276000)

Now I'll try with mc2 part that you've linked.
Comment 4 Ivan Bulatovic 2014-04-28 10:20:33 UTC
[    0.779800] ATOM BIOS: C63101
[    0.779862] radeon 0000:01:00.0: VRAM: 2048M 0x0000000000000000 - 0x000000007FFFFFFF (2048M used)
[    0.779867] radeon 0000:01:00.0: GTT: 1024M 0x0000000080000000 - 0x00000000BFFFFFFF
[    0.779872] [drm] Detected VRAM RAM=2048M, BAR=256M
[    0.779874] [drm] RAM width 256bits DDR
[    0.780115] [TTM] Zone  kernel: Available graphics memory: 2011376 kiB
[    0.780118] [TTM] Initializing pool allocator
[    0.780135] [TTM] Initializing DMA pool allocator
[    0.780378] [drm] radeon: 2048M of VRAM memory ready
[    0.780383] [drm] radeon: 1024M of GTT memory ready.
[    0.780442] [drm] Loading PITCAIRN Microcode
[    0.780447] [drm] radeon/PITCAIRN_mc2.bin: 31100 bytes
[    0.780451] [drm] Internal thermal controller with fan control
[    0.780677] [drm] probing gen 2 caps for device 8086:101 = 2212d02/0
[    0.789158] [drm] radeon: dpm initialized
[    0.789301] [drm] GART: num cpu pages 262144, num gpu pages 262144
[    0.790351] [drm] probing gen 2 caps for device 8086:101 = 2212d02/0
[    0.790365] [drm] PCIE gen 2 link speeds already enabled
[    0.804243] [drm] PCIE GART of 1024M enabled (table at 0x0000000000276000).

Works now, 3.15.0-rc3 - no problems with the PITCAIRN_mc2.bin copied in /usr/lib/modules/firmware/radeon.

Thanks Michel for clarification and help.

I won't touch the status of the bug report since I don't know if this one should be marked as resolved untill mc2 parts hit the linux-firmware branch.
Comment 5 Michel Dänzer 2014-05-02 03:34:33 UTC
(In reply to Ivan Bulatovic from comment #3)
> Apologies, it opts out after a minute just like you've said it would.

Yep, that timeout is one of the biggest downsides of building the driver into the kernel instead of as a module.

I'd say there's no bug here, at least not in the radeon driver.
Comment 6 Michel Dänzer 2014-05-02 03:36:01 UTC
(In reply to Ivan Bulatovic from comment #2)
> Don't mean to be rude or anything, but I don't know if it is recommended (or
> desirable) to commit a piece of code to mainline that will _require_ a blob
> that can't be found in linux-firmware ?

The radeon driver has always required microcode for some functionality.
Comment 7 Ivan Bulatovic 2014-06-12 20:14:54 UTC
Fixed with:

4848a1e059de5aa723ff6627b90de8a5d9632626

radeon: add mc2 firmware for SI/CI GPUs

Thanks Michel and Alex for uploading this one.

Closing :)