Improve time to suspend on Radeon HD 6310
Submitted by Paul Menzel
Assigned to Default DRI bug account
Link to original bug (#100941)
Description
Created attachment 131223
HTML page generated by pm-graph (sudo ./analyze_suspend.py -config config/suspend-callgraph.cfg
)
The ASRock E350M1 has a Radeon HD 6310.
$ sudo lspci -s 0:01.0 -nn -v<br>
00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler [Radeon HD 6310] [1002:9802] (prog-if 00 [VGA controller])<br>
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler [Radeon HD 6310] [1002:9802]<br>
Flags: bus master, fast devsel, latency 0, IRQ 28<br>
Memory at e0000000 (32-bit, prefetchable) [size=256M]<br>
I/O ports at 2000 [size=256]<br>
Memory at f0100000 (32-bit, non-prefetchable) [size=256K]<br>
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]<br>
Capabilities: [50] Power Management version 3<br>
Capabilities: [58] Express Root Complex Integrated Endpoint, MSI 00<br>
Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+<br>
Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?><br>
Kernel driver in use: radeon<br>
Kernel modules: radeon<br>
```<br>
<br>
With Debian Sid/unstable with Linux 4.9.25 suspend and resume times are benchmarked with pm-graph [1], and the command below.<br>
<br>
```<br>
sudo ./analyze_suspend.py -config config/suspend-callgraph.cfg<br>
```<br>
<br>
It turns out that with 258 ms the radeon module takes the majority of the time during suspend.<br>
<br>
In that cycle one `radeon_bo_evict_vram` call takes the longest with 198 ms.<br>
<br>
```<br>
[…]<br>
459.186778 | 0) kworker-1495 | 0.974 us | radeon_fence_wait_empty [radeon]();<br>
459.186780 | 0) kworker-1495 | 0.440 us | radeon_fence_wait_empty [radeon]();<br>
459.186783 | 0) kworker-1495 | 0.501 us | radeon_fence_wait_empty [radeon]();<br>
459.186785 | 0) kworker-1495 | 5.424 us | radeon_save_bios_scratch_regs [radeon]();<br>
459.186793 | 0) kworker-1495 | 7625.511 us | evergreen_suspend [radeon]();<br>
459.194422 | 0) kworker-1495 | 10.158 us | evergreen_hpd_fini [radeon]();<br>
459.194434 | 0) kworker-1495 | 198203.3 us | radeon_bo_evict_vram [radeon]();<br>
[…]<br>
```<br>
<br>
Please see the attached files for more details.<br>
<br>
**Attachment 131223**, "HTML page generated by pm-graph (`sudo ./analyze_suspend.py -config config/suspend-callgraph.cfg`)": <br>
[kodi_mem.html](/uploads/90c2a61a1f85fb02462afae8ad0b2aaa/kodi_mem.html)<br>