[Help][RS780E][mipsel]Screen corruption sometimes

Chen Jie chenj at lemote.com
Tue Aug 23 23:14:31 PDT 2011


Hi,

2011/8/23 Alex Deucher <alexdeucher at gmail.com>
>
> > Not sure I understand it or not, but we're using the sideport way, and
> > has a dedicated 128M DDR2 memory as VRAM.
>
> The default behavior of the system bios is to set up sideport memory
> interleaved with stolen system memory.  Unless your bios only enables
> sideport you'll need to respect the stolen system memory used as vram.
>  Also, sideport memory has really limited memory bandwidth.  It's a
> powersaving feature as if you un-interleave the sideport memory, you
> can put the display in sideport and stop memory access via the CPU.
> For decent performance, you need to use system memory or interleaved
> sideport and system memory.
Got it, thanks.
BTW, if using 128M sideport memory, will it occupy another 128M system
memory in the default behavior?


>
> >
> > The details are at:
> >   * http://dev.lemote.com/files/upload/software/temp/Radeon.test/radeon_test.c
> >   * diff with original radeon_test_moves():
> > http://dev.lemote.com/files/upload/software/temp/Radeon.test/radeon_test.diff
> >
> > The new bo moving test is pass, but when I changed the bo size to 4M,
> > the kernel panic with unaligned access at some point after bo moving
> > test. The original radeon_test_moves() is ok for 4M bo size. Could
> > someone reviews the new radeon_test_moves() to find if this was caused
> > by some mistakes of the code or is a potential bug of the platform?
>
> See if the attached patch helps.  It flushes the HDP caches if the
> driver uses the wait_idle callback rather than flushing in the fence
> emit.
The patch doesn't work for me.  P.S. due to we haven't finished a
solid port to a newer version of kernel, the hack was done on the old
2.6.36 kernel(http://dev.lemote.com/cgit/linux-3A.git/)

I did some more hack, and found if create/reserve/pin more bo in VRAM
than available, it will cause unaligned access panic. And a simpler
way to trigger kernel panic(but another kind of kernel panic):

    struct radeon_bo **vram_obj = NULL;
    uint64_t *vram_addr = NULL;
    unsigned i, n, size;

    n = 31; /* 30 is the maximum num of bo can be allocated successfully */
    size = 4 * 1024 * 1024;

    vram_obj = kzalloc(n * sizeof(*vram_obj), GFP_KERNEL);
    vram_addr = kzalloc(n * sizeof(*vram_addr), GFP_KERNEL);

    for (i = 0; i < n; i++) {
        int r;
        /* Create bo lives in VRAM */
        r = radeon_bo_create(rdev, NULL, size, true, RADEON_GEM_DOMAIN_VRAM,
                vram_obj + i);
        if (r) {
            DRM_ERROR("Failed to create VRAM object %d\n", i);
            break;
        }

        r = radeon_bo_reserve(vram_obj[i], false);
        if (unlikely(r != 0))
            break;
        r = radeon_bo_pin(vram_obj[i], RADEON_GEM_DOMAIN_VRAM, vram_addr + i);
        if (r) {
            DRM_ERROR("Failed to pin VRAM object %d\n", i);
            break;
        }
    }

   /* If I comment the following, no kernel panic for me */
   if (vram_obj) {
        for (i = 0; i < n; i++) {
            if (vram_obj[i]) {
                if (radeon_bo_is_reserved(vram_obj[i])) {
                    radeon_bo_unpin(vram_obj[i]);
                    radeon_bo_unreserve(vram_obj[i]);
                }
                radeon_bo_unref(&vram_obj[i]);
            }
        }
        kfree(vram_obj);
    }
    if (vram_addr)
        kfree(vram_addr);
----
The corresponding dmesg log:

[    1.125000] [drm] Initialized drm 1.1.0 20060810
[    1.128906] [drm] radeon defaulting to kernel modesetting.
[    1.136718] [drm] radeon kernel modesetting enabled.
[    1.175781] [drm] initializing kernel modesetting (RS780 0x1002:0x9615).
[    1.183593] [drm] register mmio base: 0x48000000
[    1.187500] [drm] register mmio size: 65536
[    1.195312] radeon 0000:01:05.0: BAR 6: can't assign [???
0x00000000 flags 0x0] (bogus alignment)
[    1.203125] ATOM BIOS: BR041389
[    1.207031] radeon 0000:01:05.0: VRAM: 128M 0x10000000 - 0x17FFFFFF
(128M used)
[    1.214843] radeon 0000:01:05.0: GTT: 512M 0x18000000 - 0x37FFFFFF
[    1.222656] [drm] Detected VRAM RAM=128M, BAR=128M
[    1.226562] [drm] RAM width 32bits DDR
[    1.230468] [TTM] Zone  kernel: Available graphics memory: 464720 kiB.
[    1.238281] [TTM] Initializing pool allocator.
[    1.242187] [drm] radeon: 128M of VRAM memory ready
[    1.246093] [drm] radeon: 512M of GTT memory ready.
[    1.250000] [drm] radeon: irq initialized.
[    1.253906] [drm] GART: num cpu pages 32768, num gpu pages 131072
[    1.265625] [drm] Loading RS780 Microcode
[    1.343750] [drm] ring test succeeded in 0 usecs
[    1.347656] [drm] radeon: ib pool ready.
[    1.351562] [drm] ib test succeeded in 0 usecs
[    1.355468] [drm] Enabling audio support
[    1.359375] radeon 0000:01:05.0: 980000013eecbe00 pin failed
[    1.367187] [drm:radeon_test_moves] *ERROR* Failed to pin VRAM object 31
[    1.378906] radeon 0000:01:05.0: 980000013eecbe00 unpin not necessary
[    1.386718] CPU 3 Unable to handle kernel paging request at virtual
address 0000000000000008, epc == ffffffff804aff08, ra ==
ffffffff804aff00
[    1.398437] Oops[#1]:
[    1.402343] Cpu 3
[    1.402343] $ 0   : 0000000000000000 000000001400fce0
980000013eecbe00 0000000000000000
[    1.402343] $ 4   : 980000013e5e2f50 ffffffff8047a66c
0000000000000000 0000000000000000
[    1.402343] $ 8   : 0000000000000000 980000000161c000
00004124924d2492 ffffffff81073f20
[    1.402343] $12   : 0000000000000007 ffffffff810f3ee0
fffffffffffffffc ffffffff81073f28
[    1.402343] $16   : 980000013eecbe00 980000013eecbe48
980000013e8f7d40 000000000000001f
[    1.402343] $20   : 980000013e8f7e00 980000013e8f7ef8
0000000000000028 980000013e5e2000
[    1.402343] $24   : 0000000000000000 ffffffff804afedc
[    1.402343] $28   : 980000013e044000 980000013e047af0
980000013eecbe00 ffffffff804aff00
[    1.402343] Hi    : 0000000000000000
[    1.402343] Lo    : 00000000011694a8
[    1.402343] epc   : ffffffff804aff08 radeon_ttm_bo_destroy+0x2c/0x68
[    1.402343]     Not tainted
[    1.402343] ra    : ffffffff804aff00 radeon_ttm_bo_destroy+0x24/0x68
[    1.402343] Status: 1400fce3    KX SX UX KERNEL EXL IE
[    1.402343] Cause : 0000000c
[    1.402343] BadVA : 0000000000000008
[    1.402343] PrId  : 00006305 (ICT Loongson-3)
[    1.402343] Modules linked in:
[    1.402343] Process swapper (pid: 1, threadinfo=980000013e044000,
task=980000013e078000, tls=0000000000000000)
[    1.402343] Stack : 980000013eecbe8c 980000013eecbe8c
ffffffff8047a66c ffffffff803f056c
[    1.402343]         0000000000000028 980000013eecbe48
980000013e5e2530 ffffffff8047b478
[    1.402343]         0000000000070000 980000013eecbe88
ffffffff8047b418 ffffffff803f056c
[    1.402343]         000000000000001f 980000013e5e2530
980000013eecbe48 ffffffff8047a950
[    1.402343]         000000001400fce1 980000013e8f7cf8
980000013e5e3dc0 ffffffff804b0230
[    1.402343]         0000000000000000 ffffffff8047a554
980000013e8f7cf8 980000013e8f7cf8
[    1.402343]         980000013e8f7c00 ffffffff804f27bc
980000013e5e2000 0000000000000000
[    1.402343]         00000000ffffffff 0000000000c20021
980000013e5db800 980000013e5dbbb8
[    1.402343]         0000000000000004 0000000000000000
0000000000000000 ffffffff8049b85c
[    1.402343]         980000013e5db800 980000013e5e2000
fffffffffffffff4 ffffffff8049cc08
[    1.402343]         ...
[    1.402343] Call Trace:
[    1.402343] [<ffffffff804aff08>] radeon_ttm_bo_destroy+0x2c/0x68
[    1.402343] [<ffffffff803f056c>] kref_put+0x70/0x90
[    1.402343] [<ffffffff8047b478>] ttm_bo_release+0x60/0x78
[    1.402343] [<ffffffff803f056c>] kref_put+0x70/0x90
[    1.402343] [<ffffffff8047a950>] ttm_bo_unref+0x38/0x50
[    1.402343] [<ffffffff804b0230>] radeon_bo_unref+0x3c/0x68
[    1.402343] [<ffffffff804f27bc>] radeon_test_moves+0x174/0x1d0
[    1.402343] [<ffffffff8049b85c>] radeon_device_init+0x474/0x4b4
[    1.402343] [<ffffffff8049cc08>] radeon_driver_load_kms+0xcc/0x138
[    1.402343] [<ffffffff8046c54c>] drm_get_pci_dev+0x140/0x230
[    1.402343] [<ffffffff80406af0>] local_pci_probe+0x5c/0xd8
[    1.402343] [<ffffffff80406f48>] pci_device_probe+0x5c/0x9c
[    1.402343] [<ffffffff80528690>] driver_probe_device+0xe4/0x1c0
[    1.402343] [<ffffffff805287d8>] __driver_attach+0x6c/0xa4
[    1.402343] [<ffffffff8052764c>] bus_for_each_dev+0x54/0x94
[    1.402343] [<ffffffff80527e48>] bus_add_driver+0xbc/0x258
[    1.402343] [<ffffffff80528ae4>] driver_register+0xc4/0x178
[    1.402343] [<ffffffff80407310>] __pci_register_driver+0x50/0xe0
[    1.402343] [<ffffffff802159dc>] do_one_initcall+0x88/0x174
[    1.402343] [<ffffffff81078c60>] kernel_init+0x208/0x2bc
[    1.402343] [<ffffffff80217c84>] kernel_thread_helper+0x10/0x18
[    1.402343]
[    1.402343]
[    1.402343] Code: 64840f50  de020008  de23ffb8 <fc620008> fc430000
de0401e0  fe30ffb8  fe100008  0c084d49
[    1.402343] Disabling lock debugging due to kernel taint
[    1.750000] Kernel panic - not syncing: Attempted to kill init!



Regards,
- Chen Jie


More information about the xorg-driver-ati mailing list