Bug 67876

Summary: linux v3.11.0-rc1 many drm:radeon_ttm_backend_bind ERROR failed to bind 2025 pages issued during boot
Product: DRI Reporter: Jim Cromie <jim.cromie>
Component: DRM/RadeonAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: XOrg git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Jim Cromie 2013-08-07 19:33:30 UTC
during boot of linux 3.11-rc1+
apparently just after switch over to fb,
I get a raft of errors like this
(copied from a photo)

 [drm:radeon_ttm_backend_bind] *ERROR* failed to bind 2250 pages at 0x000000..
 [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (always-same-tuple)
 size      : 888xxxxx bytes  
 alignment : 0 bytes
 domains   : 2

Eventually, they stop, and boot continues normally, and machine is functional.
If I hit escape (any key?) then the stream of errors is interrupted,
and systemd boot continues, again normally.

dmesg then contains many of these:
(almost exclusively these)

 WARNING: at /home/jimc/projects/lx/linux-2.6/drivers/gpu/drm/radeon/radeon_gart.c:280 radeon_gart_bind+0xe9/0xf0 [radeon]()
 trying to bind memory to uninitialized GART !
 Modules linked in: ebtable_nat ebtables configs ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat xt_CHECKSUM iptable_mangle bridge stp llc be2iscsi rfcomm iscsi_boot_sysfs bnx2i bnep cnic uio cxgb4i cxgb4 cxgb3i cxgb3 nf_conntrack_tftp ip6t_REJECT xt_physdev mdio libcxgbi ib_iser nf_conntrack_ipv6 rdma_cm ib_addr iw_cm nf_conntrack_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 ib_cm ib_sa xt_state nf_conntrack ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip6table_filter ip6_tables it87 hwmon_vid snd_hda_codec_hdmi snd_hda_codec_via snd_hda_intel snd_hda_codec snd_usb_audio snd_usbmidi_lib nfsd snd_hwdep auth_rpcgss oid_registry nfs_acl lockd snd_seq snd_pcm sunrpc snd_rawmidi snd_page_alloc snd_seq_device acpi_cpufreq btusb bluetooth uvcvideo videobuf2_vmalloc videobuf2_memops snd_timer mperf videobuf2_core videodev media snd r8169 tulip serio_raw sp5100_tco i2c_piix4 k10temp dcdbas microcode rfkill mii soundcore vhost_net tun macvtap macvlan kvm_amd kvm uinput binfmt_misc ata_generic pata_acpi usb_storage pata_atiixp radeon i2c_algo_bit drm_kms_helper ttm drm i2c_core
 CPU: 0 PID: 161 Comm: plymouthd Tainted: G        W    3.10.0-rc5-x2-00131-gdc50ba7 #27
 Hardware name: Dell Inc. Inspiron 546 /0F896N, BIOS A11 01/19/2010
  0000000000000009 ffff88021f81b8c8 ffffffff81610fc9 ffff88021f81b908
  ffffffff8104a590 ffff88021f81b8e8 ffff88022148c100 ffff88021ffd4000
  ffff88021ffd4a18 ffff88021f81bad8 ffff880209c16448 ffff88021f81b968
 Call Trace:
  [<ffffffff81610fc9>] dump_stack+0x19/0x1b
  [<ffffffff8104a590>] warn_slowpath_common+0x70/0xa0
  [<ffffffff8104a676>] warn_slowpath_fmt+0x46/0x50
  [<ffffffffa009cc99>] radeon_gart_bind+0xe9/0xf0 [radeon]
  [<ffffffffa009a127>] radeon_ttm_backend_bind+0x37/0xa0 [radeon]
  [<ffffffffa0069d0f>] ttm_tt_bind+0x4f/0x70 [ttm]
  [<ffffffffa006c1bf>] ttm_bo_handle_move_mem+0x59f/0x630 [ttm]
  [<ffffffffa006cd90>] ? ttm_bo_mem_space+0x180/0x360 [ttm]
  [<ffffffffa006d097>] ttm_bo_move_buffer+0x127/0x140 [ttm]
  [<ffffffffa006d14a>] ttm_bo_validate+0x9a/0x110 [ttm]
  [<ffffffffa006d4be>] ttm_bo_init+0x2fe/0x3c0 [ttm]
  [<ffffffffa009b861>] radeon_bo_create+0x181/0x200 [radeon]
  [<ffffffffa009b530>] ? radeon_bo_clear_va+0x60/0x60 [radeon]
  [<ffffffffa00ae046>] radeon_gem_object_create+0xa6/0x180 [radeon]
  [<ffffffffa00ae4bb>] radeon_gem_create_ioctl+0x6b/0x120 [radeon]
  [<ffffffffa0015499>] drm_ioctl+0x549/0x680 [drm]
  [<ffffffffa00ae450>] ? radeon_gem_pwrite_ioctl+0x30/0x30 [radeon]
  [<ffffffff81078713>] ? __wake_up+0x53/0x70
  [<ffffffff811c1beb>] ? fsnotify+0x24b/0x340
  [<ffffffff81195107>] do_vfs_ioctl+0x97/0x580
  [<ffffffff8127b8ca>] ? inode_has_perm.isra.32.constprop.62+0x2a/0x30
  [<ffffffff8127cc77>] ? file_has_perm+0x97/0xb0
  [<ffffffff81195681>] SyS_ioctl+0x91/0xb0
  [<ffffffff81183e02>] ? SyS_write+0x52/0xa0
  [<ffffffff8161f1c2>] system_call_fastpath+0x16/0x1b
 ---[ end trace 9dba5d10af0bf040 ]---
 [drm:radeon_ttm_backend_bind] *ERROR* failed to bind 2250 pages at 0x00000000
 [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (9216000, 2, 4096, -22)


FWIW - git describe has apparently mis-labeled the kernel,
its not really v3.10-rc5+ but rather v3.11-rc1-minus

Ive git bisected it down to: (note the SHA match w kernel's -gXXX)

commit dc50ba7f9a6d9a920409892c7f30bce266067345
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Jun 26 00:33:35 2013 -0400

    drm/radeon/kms: add dpm support for evergreen (v4)
    
    This adds dpm support for evergreen asics.  This includes:
    - clockgating
    - dynamic engine clock scaling
    - dynamic memory clock scaling
    - dynamic voltage scaling
    - dynamic pcie gen1/gen2 switching (requires additional acpi support)
    
    Set radeon.dpm=1 to enable.
    
    v2: reduce stack usage, rename ulv struct
    v3: fix thermal interrupt check notices by Jerome
    v4: fix state enable
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

The previous commit boots fine:

commit 66229b200598a3b66b839d1759ff3f5b17ac5639
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Jun 26 00:11:19 2013 -0400

    drm/radeon/kms: add dpm support for rv7xx (v4)
    
dmesg for that kernel looked to have info thats pertinent 
to whats been done in Alex's patchset at this commit,
so heres the relevant parts.

[jimc@groucho bootlogs]$ grep -Ei 'radeon|drm' dmesg-3.10.0-rc5-x2-00130-g66229b2
[    1.730634] [drm] Initialized drm 1.1.0 20060810
[    1.752826] dynamic_debug:ddebug_add_module: 1 debug prints in module radeon
[    1.754453] [drm] radeon kernel modesetting enabled.
[    1.754752] [drm] initializing kernel modesetting (CEDAR 0x1002:0x68E1 0x1787:0x3000).
[    1.754789] [drm] register mmio base: 0xFE9E0000
[    1.754790] [drm] register mmio size: 131072
[    1.755653] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[    1.755655] radeon 0000:01:00.0: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF
[    1.756022] [drm] Detected VRAM RAM=1024M, BAR=256M
[    1.756027] [drm] RAM width 64bits DDR
[    1.756139] [drm] radeon: 1024M of VRAM memory ready
[    1.756140] [drm] radeon: 512M of GTT memory ready.
[    1.756212] radeon 0000:01:00.0: radeon_uvd: Can't load firmware "radeon/CYPRESS_uvd.bin"
[    1.756271] [drm] GART: num cpu pages 131072, num gpu pages 131072
[    1.757275] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
[    1.757328] [drm] Loading CEDAR Microcode
[    1.781141] [drm] PCIE GART of 512M enabled (table at 0x0000000000040000).
[    1.781252] radeon 0000:01:00.0: WB enabled
[    1.781255] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff88021ffa4c00
[    1.781257] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff88021ffa4c0c
[    1.781260] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[    1.781260] [drm] Driver supports precise vblank timestamp query.
[    1.781281] radeon 0000:01:00.0: irq 42 for MSI/MSI-X
[    1.781293] radeon 0000:01:00.0: radeon: using MSI.
[    1.781316] [drm] radeon: irq initialized.
[    1.797570] [drm] ring test on 0 succeeded in 1 usecs
[    1.797628] [drm] ring test on 3 succeeded in 1 usecs
[    1.797753] [drm] ib test on ring 0 succeeded in 0 usecs
[    1.797776] [drm] ib test on ring 3 succeeded in 0 usecs
[    1.797977] [drm] Radeon Display Connectors
[    1.797978] [drm] Connector 0:
[    1.797979] [drm]   HDMI-A-1
[    1.797980] [drm]   HPD2
[    1.797982] [drm]   DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c
[    1.797983] [drm]   Encoders:
[    1.797984] [drm]     DFP1: INTERNAL_UNIPHY1
[    1.797985] [drm] Connector 1:
[    1.797986] [drm]   DVI-D-1
[    1.797986] [drm]   HPD4
[    1.797988] [drm]   DDC: 0x6440 0x6440 0x6444 0x6444 0x6448 0x6448 0x644c 0x644c
[    1.797988] [drm]   Encoders:
[    1.797989] [drm]     DFP2: INTERNAL_UNIPHY
[    1.797990] [drm] Connector 2:
[    1.797991] [drm]   VGA-1
[    1.797992] [drm]   DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c
[    1.797993] [drm]   Encoders:
[    1.797994] [drm]     CRT1: INTERNAL_KLDSCP_DAC1
[    1.798039] [drm] Internal thermal controller with fan control
[    1.798069] [drm] radeon: power management initialized
[    1.895209] [drm] fb mappable at 0xD0142000
[    1.895210] [drm] vram apper at 0xD0000000
[    1.895211] [drm] size 9216000
[    1.895212] [drm] fb depth is 24
[    1.895213] [drm]    pitch is 7680
[    1.895331] fbcon: radeondrmfb (fb0) is primary device
[    2.120738] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
[    2.120740] radeon 0000:01:00.0: registered panic notifier
[    2.120746] [drm] Initialized radeon 2.34.0 20080528 for 0000:01:00.0 on minor 0
[jimc@groucho bootlogs]$ 


So thats what I got right now.
I hope to try a few things myself soon, 
but I'll test a patch promptly.
Comment 1 Alex Deucher 2013-08-07 19:54:58 UTC
That commit shouldn't change anything unless you enable dpm.  However, the driver now requires an additional ucode file.  Make sure you have the CEDAR_smc.bin ucode installed.  You can grab it from the linux-firmware tree or from here:
http://people.freedesktop.org/~agd5f/radeon_ucode/
Comment 2 Jim Cromie 2013-08-08 01:15:30 UTC
thank you Alex, the firmware page helped some.

Turns out I needed more than the CEDAR_smc.bin,
(which fwiw was never warned about)

[    1.756212] radeon 0000:01:00.0: radeon_uvd: Can't load firmware "radeon/CYPRESS_uvd.bin"

which went away only after fetching that FW too.


So, having both FWs, I tested current master and it worked.
(I'll assume that means my bisect-bad would too)

$ uname -r
3.11.0-rc4-x2-00050-gb7bc9e7

[jimc@groucho bootlogs]$ dmesg| grep -E 'radeon|drm' 
[    1.741557] [drm] Initialized drm 1.1.0 20060810
[    1.773454] dynamic_debug:ddebug_add_module: 1 debug prints in module radeon
[    1.775402] [drm] radeon kernel modesetting enabled.
[    1.775714] [drm] initializing kernel modesetting (CEDAR 0x1002:0x68E1 0x1787:0x3000).
[    1.775734] [drm] register mmio base: 0xFE9E0000
[    1.775735] [drm] register mmio size: 131072
[    1.776643] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[    1.776645] radeon 0000:01:00.0: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF
[    1.776647] [drm] Detected VRAM RAM=1024M, BAR=256M
[    1.776648] [drm] RAM width 64bits DDR
[    1.776755] [drm] radeon: 1024M of VRAM memory ready
[    1.776757] [drm] radeon: 512M of GTT memory ready.
[    1.777788] [drm] GART: num cpu pages 131072, num gpu pages 131072
[    1.778782] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
[    1.778799] [drm] Loading CEDAR Microcode
[    1.788485] [drm] PCIE GART of 512M enabled (table at 0x000000000025D000).
[    1.788599] radeon 0000:01:00.0: WB enabled
[    1.788602] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff88021e466c00
[    1.788604] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff88021e466c0c
[    1.788607] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c418 and cpu addr 0xffffc9001101c418
[    1.788609] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[    1.788610] [drm] Driver supports precise vblank timestamp query.
[    1.788632] radeon 0000:01:00.0: irq 42 for MSI/MSI-X
[    1.788644] radeon 0000:01:00.0: radeon: using MSI.
[    1.788667] [drm] radeon: irq initialized.
[    1.804943] [drm] ring test on 0 succeeded in 1 usecs
[    1.805001] [drm] ring test on 3 succeeded in 1 usecs
[    2.992422] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    4.013574] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    5.034731] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    6.055874] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    7.077016] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    8.098157] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[    9.119302] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[   10.140429] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[   11.161610] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[   12.182794] [drm:r600_uvd_init] *ERROR* UVD not responding, trying to reset the VCPU!!!
[   12.202894] [drm:r600_uvd_init] *ERROR* UVD not responding, giving up!!!
[   12.202973] [drm:evergreen_startup] *ERROR* radeon: error initializing UVD (-1).



Im a bit puzzled at the apparent need for 2 different CODENAME_ firmwares,
an also why theres no warning for missing CEDAR_smc.bin
Comment 3 Alex Deucher 2013-08-08 12:23:40 UTC
I'm not sure why you aren't getting the smc error message, you should be.  To fix teh UVD error messages, you also need an updated rlc ucode.
Comment 4 Jim Cromie 2013-08-14 04:33:40 UTC
So Ive apparently got bad rlc firmware from last Dec:

[jimc@groucho ~]$ sum radeon-fw/* /lib/firmware/radeon/CEDAR_* | sort
05888     3 /lib/firmware/radeon/CEDAR_rlc.bin
23436     3 radeon-fw/CEDAR_rlc.bin
35913    24 /lib/firmware/radeon/CEDAR_smc.bin
35913    24 radeon-fw/CEDAR_smc.bin
45275     6 /lib/firmware/radeon/CEDAR_me.bin
45275     6 radeon-fw/CEDAR_me.bin
55341     5 /lib/firmware/radeon/CEDAR_pfp.bin
55341     5 radeon-fw/CEDAR_pfp.bin
[jimc@groucho ~]$ ll /lib/firmware/radeon/CEDAR_*
-rw-r--r--. 1 root root  5504 Dec 23  2012 /lib/firmware/radeon/CEDAR_me.bin
-rw-r--r--. 1 root root  4480 Dec 23  2012 /lib/firmware/radeon/CEDAR_pfp.bin
-rw-r--r--. 1 root root  3072 Dec 23  2012 /lib/firmware/radeon/CEDAR_rlc.bin
-rw-rw-r--. 1 root root 23888 Aug  7 15:18 /lib/firmware/radeon/CEDAR_smc.bin


The odd errors I saw now have a "usual suspect",
I'll reboot with rc5 but still missing fw to see what bootlog looks like,
then update that fw, and reboot again.
Comment 5 Alex Deucher 2013-08-14 12:57:47 UTC
The rlc ucode was updated for UVD support.  You need the newer rlc ucode if you want to use UVD.  But either version should work if you don't need UVD.
Comment 6 Martin Peres 2019-11-19 08:36:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/364.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.