All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
@ 2018-07-25 13:28 bugzilla-daemon
  2018-07-25 13:28 ` bugzilla-daemon
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugzilla-daemon @ 2018-07-25 13:28 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2714 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

            Bug ID: 107375
           Summary: Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
           Product: DRI
           Version: DRI git
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: DRM/AMDgpu
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: pmenzel+bugs.freedesktop@molgen.mpg.de

Created attachment 140810
  --> https://bugs.freedesktop.org/attachment.cgi?id=140810&action=edit
HTML output of `sudo ./sleepgraph.py -config config/suspend-callgraph.cfg`
(devicelist: amdgpu, maxdepth: 12)

Profiling the suspend and resume time [1] on a MSI B350M MORTAR (MS-7A37) with
AMD Ryzen 3 2200G with Radeon Vega Graphics with Linux 4.18-rc6+ and
amd-staging-drm-next [2], `pci_pm_suspend()` takes over one second, which is
too long [3], cf. bug 107278 [3].

The majority of that, 750 ms, is spent in `amdgpu_device_ip_resume_phase2()`.

•   amdgpu_device_ip_resume_phase2 [amdgpu] (747.134 ms @ 97.889371)
    •   psp_resume [amdgpu] (673.370 ms @ 97.889371)
        […]
        •   psp_hw_start [amdgpu] (88.577 ms @ 97.889379)
        […]
        •   psp_np_fw_load [amdgpu] (584.783 ms @ 97.977957)
    […]
    •   dm_resume [amdgpu] (44.992 ms @ 98.567232)
        […]
        •   dc_link_detect [amdgpu] (17.777 ms @ 98.568212)
            (EDID read takes 8 ms?)
        […]
        •   drm_atomic_helper_resume (25.139 ms @ 98.587030)
        […]
    […]

In the PSP code the problem is `psp_cmd_submit_buf()`, which takes from 45 ms
to 141 ms. Something is wrong there.

```
static int
psp_cmd_submit_buf(struct psp_context *psp,
                   struct amdgpu_firmware_info *ucode,
                   struct psp_gfx_cmd_resp *cmd, uint64_t fence_mc_addr,
                   int index)
{
        int ret;

        memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);

        memcpy(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp));

        ret = psp_cmd_submit(psp, ucode, psp->cmd_buf_mc_addr,
                             fence_mc_addr, index);

        while (*((unsigned int *)psp->fence_buf) != index) {
                msleep(1);
        }

        return ret;
}
```

Also, I wonder why the sleep in the trace is 3 ms instead of 1 ms like in the
code.


[1]: https://01.org/suspendresume
[2]: https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next
[3]: https://bugs.freedesktop.org/show_bug.cgi?id=107278

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 4787 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
  2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
@ 2018-07-25 13:28 ` bugzilla-daemon
  2018-07-25 15:10 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2018-07-25 13:28 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 519 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

Paul Menzel <pmenzel+bugs.freedesktop@molgen.mpg.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |107278


Referenced Bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=107278
[Bug 107278] Raven: pci_pm_resume takes over 1 second
-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1588 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
  2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
  2018-07-25 13:28 ` bugzilla-daemon
@ 2018-07-25 15:10 ` bugzilla-daemon
  2018-07-25 15:54 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2018-07-25 15:10 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 661 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

--- Comment #1 from Michel Dänzer <michel@daenzer.net> ---
Created attachment 140814
  --> https://bugs.freedesktop.org/attachment.cgi?id=140814&action=edit
Do posting read in psp_v10_0_cmd_submit

Does this patch help by any chance?

(In reply to Paul Menzel from comment #0)
> Also, I wonder why the sleep in the trace is 3 ms instead of 1 ms like in
> the code.

Maybe your kernel is configured with CONFIG_HZ=300? Anyway, it doesn't really
matter, as it's waiting for the PSP to finish processing the command.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1785 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
  2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
  2018-07-25 13:28 ` bugzilla-daemon
  2018-07-25 15:10 ` bugzilla-daemon
@ 2018-07-25 15:54 ` bugzilla-daemon
  2018-09-17 15:37 ` bugzilla-daemon
  2019-11-19  8:45 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2018-07-25 15:54 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 930 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

--- Comment #2 from Paul Menzel <pmenzel+bugs.freedesktop@molgen.mpg.de> ---
(In reply to Michel Dänzer from comment #1)
> Created attachment 140814 [details] [review]
> Do posting read in psp_v10_0_cmd_submit
> 
> Does this patch help by any chance?

No, unfortunately it does not change the times.

> (In reply to Paul Menzel from comment #0)
> > Also, I wonder why the sleep in the trace is 3 ms instead of 1 ms like in
> > the code.
> 
> Maybe your kernel is configured with CONFIG_HZ=300? Anyway, it doesn't
> really matter, as it's waiting for the PSP to finish processing the command.

```
$ grep CONFIG_HZ .config
# CONFIG_HZ_PERIODIC is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2232 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
  2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
                   ` (2 preceding siblings ...)
  2018-07-25 15:54 ` bugzilla-daemon
@ 2018-09-17 15:37 ` bugzilla-daemon
  2019-11-19  8:45 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2018-09-17 15:37 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 601 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

--- Comment #3 from Paul Menzel <pmenzel+bugs.freedesktop@molgen.mpg.de> ---
With v4.19-rc4-22-gad3273d5f1b9 (Merge tag 'ext4_for_linus_stable' of
git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4) this now got worse,
and `amdgpu_device_ip_resume_phase2()` now takes 1.166 s.

`psp_np_fw_load()` takes 868.190 ms, and `dm_resume()` 178.380 ms.

It’d be great, if you could talk to the PSP firmware team, and also document,
if you can reproduce this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1412 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms
  2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
                   ` (3 preceding siblings ...)
  2018-09-17 15:37 ` bugzilla-daemon
@ 2019-11-19  8:45 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2019-11-19  8:45 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 805 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=107375

Martin Peres <martin.peres@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |MOVED
             Status|NEW                         |RESOLVED

--- Comment #4 from Martin Peres <martin.peres@free.fr> ---
-- 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/462.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2386 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-19  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 13:28 [Bug 107375] Raven: `amdgpu_device_ip_resume_phase2()` takes 750 ms bugzilla-daemon
2018-07-25 13:28 ` bugzilla-daemon
2018-07-25 15:10 ` bugzilla-daemon
2018-07-25 15:54 ` bugzilla-daemon
2018-09-17 15:37 ` bugzilla-daemon
2019-11-19  8:45 ` bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.