dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 110674] Crashes / Resets From AMDGPU / Radeon VII
Date: Wed, 14 Aug 2019 17:30:55 +0000	[thread overview]
Message-ID: <bug-110674-502-DUN6i4wVaI@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-110674-502@http.bugs.freedesktop.org/>


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

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

--- Comment #100 from Tom B <tom@r.je> ---
I've bee trying to work backwards to find the place where screens get
initialised and eventually call vega20_pre_display_configuration_changed_task. 

vega20_pre_display_configuration_changed_task is exported as
pp_hwmgr_func::display_config_changed

Which is called form hardwaremanager.c:phm_pre_display_configuration_changed 

phm_pre_display_configuration_changed is called from
hwmghr.c:hwmgr_handle_task:

        switch (task_id) {
        case AMD_PP_TASK_DISPLAY_CONFIG_CHANGE:
                ret = phm_pre_display_configuration_changed(hwmgr);


pp_dpm_dispatch_tasks is exported as amd_pm_funcs::dispatch_tasks is called
from amdgpu_dpm_dispatch_task which is called in amdgpu_pm.c:


void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
{
        int i = 0;

        if (!adev->pm.dpm_enabled)
                return;

        if (adev->mode_info.num_crtc)
                amdgpu_display_bandwidth_update(adev);

        for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
                struct amdgpu_ring *ring = adev->rings[i];
                if (ring && ring->sched.ready)
                        amdgpu_fence_wait_empty(ring);
        }

        if (is_support_sw_smu(adev)) {
                struct smu_context *smu = &adev->smu;
                struct smu_dpm_context *smu_dpm = &adev->smu.smu_dpm;
                mutex_lock(&(smu->mutex));
                smu_handle_task(&adev->smu,
                                smu_dpm->dpm_level,
                                AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
                mutex_unlock(&(smu->mutex));
        } else {
                if (adev->powerplay.pp_funcs->dispatch_tasks) {
                        if (!amdgpu_device_has_dc_support(adev)) {
                                mutex_lock(&adev->pm.mutex);
                                amdgpu_dpm_get_active_displays(adev);
                                adev->pm.pm_display_cfg.num_display =
adev->pm.dpm.new_active_crtc_count;
                                adev->pm.pm_display_cfg.vrefresh =
amdgpu_dpm_get_vrefresh(adev);
                                adev->pm.pm_display_cfg.min_vblank_time =
amdgpu_dpm_get_vblank_time(adev);
                                /* we have issues with mclk switching with
refresh rates over 120 hz on the non-DC code. */
                                if (adev->pm.pm_display_cfg.vrefresh > 120)
                                        adev->pm.pm_display_cfg.min_vblank_time
= 0;
                                if
(adev->powerplay.pp_funcs->display_configuration_change)
                                       
adev->powerplay.pp_funcs->display_configuration_change(
                                                                       
adev->powerplay.pp_handle,
                                                                       
&adev->pm.pm_display_cfg);
                                mutex_unlock(&adev->pm.mutex);
                        }
                        amdgpu_dpm_dispatch_task(adev,
AMD_PP_TASK_DISPLAY_CONFIG_CHANGE, NULL);
                } else {
                        mutex_lock(&adev->pm.mutex);
                        amdgpu_dpm_get_active_displays(adev);
                        amdgpu_dpm_change_power_state_locked(adev);
                        mutex_unlock(&adev->pm.mutex);
                }
        }
}


This is the only place I can see AMD_PP_TASK_DISPLAY_CONFIG_CHANGE being called
from, which eventually is where vega20_pre_display_configuration_changed_task
gets called.

Presumably the code:

        for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
                struct amdgpu_ring *ring = adev->rings[i];
                if (ring && ring->sched.ready)
                        amdgpu_fence_wait_empty(ring);
        }



is what generates 


[    3.683718] amdgpu 0000:44:00.0: ring gfx uses VM inv eng 0 on hub 0
[    3.683719] amdgpu 0000:44:00.0: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[    3.683720] amdgpu 0000:44:00.0: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[    3.683720] amdgpu 0000:44:00.0: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[    3.683721] amdgpu 0000:44:00.0: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[    3.683722] amdgpu 0000:44:00.0: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[    3.683722] amdgpu 0000:44:00.0: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[    3.683723] amdgpu 0000:44:00.0: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[    3.683724] amdgpu 0000:44:00.0: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[    3.683724] amdgpu 0000:44:00.0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
[    3.683725] amdgpu 0000:44:00.0: ring sdma0 uses VM inv eng 0 on hub 1
[    3.683726] amdgpu 0000:44:00.0: ring page0 uses VM inv eng 1 on hub 1
[    3.683726] amdgpu 0000:44:00.0: ring sdma1 uses VM inv eng 4 on hub 1
[    3.683727] amdgpu 0000:44:00.0: ring page1 uses VM inv eng 5 on hub 1
[    3.683728] amdgpu 0000:44:00.0: ring uvd_0 uses VM inv eng 6 on hub 1
[    3.683728] amdgpu 0000:44:00.0: ring uvd_enc_0.0 uses VM inv eng 7 on hub 1
[    3.683729] amdgpu 0000:44:00.0: ring uvd_enc_0.1 uses VM inv eng 8 on hub 1
[    3.683730] amdgpu 0000:44:00.0: ring uvd_1 uses VM inv eng 9 on hub 1
[    3.683730] amdgpu 0000:44:00.0: ring uvd_enc_1.0 uses VM inv eng 10 on hub
1
[    3.683731] amdgpu 0000:44:00.0: ring uvd_enc_1.1 uses VM inv eng 11 on hub
1
[    3.683731] amdgpu 0000:44:00.0: ring vce0 uses VM inv eng 12 on hub 1
[    3.683732] amdgpu 0000:44:00.0: ring vce1 uses VM inv eng 13 on hub 1
[    3.683733] amdgpu 0000:44:00.0: ring vce2 uses VM inv eng 14 on hub 1

In dmesg. I'll add a pr_err() to verify this.  If so, it means our issue is
introduced somewhere between that for loop and amdgpu_dpm_dispatch_task in this
function. 


amdgpu_pm_compute_clocks is called from
amdgpu_dm_pp_smu.c:dm_pp_apply_display_requirements which is called in
dce_clk_mgr.c in two places: dce_pplib_apply_display_requirements and
dce11_pplib_apply_display_requirements. I don't know which is used for the VII,
I'll add some logging to verify.

But here's something that may be relevant to this bug. In
dce11_pplib_apply_display_requirements there's a check for the number of
displays:


        /* TODO: is this still applicable?*/
        if (pp_display_cfg->display_count == 1) {
                const struct dc_crtc_timing *timing =
                        &context->streams[0]->timing;

                pp_display_cfg->crtc_index =
                        pp_display_cfg->disp_configs[0].pipe_idx;
                pp_display_cfg->line_time_in_us = timing->h_total * 10000 /
timing->pix_clk_100hz;
        }


So there's something that is different when mroe than one display is connected.
That's as far as I got walking backwards through the code. I'll note that this
was also present in 5.0.1, but it could be that something is relying on
ctrc_inxex or line_time_in_us, which wasn't checked previously as these values
only appear to be set if there is a single display.

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

[-- Attachment #1.2: Type: text/html, Size: 8185 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

  parent reply	other threads:[~2019-08-14 17:30 UTC|newest]

Thread overview: 179+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  5:55 [Bug 110674] Crashes / Resets From AMDGPU / Radeon VII bugzilla-daemon
2019-05-14  5:55 ` bugzilla-daemon
2019-05-14  5:56 ` bugzilla-daemon
2019-05-14  5:56 ` bugzilla-daemon
2019-05-14  9:04 ` bugzilla-daemon
2019-05-14  9:05 ` bugzilla-daemon
2019-05-14  9:20 ` bugzilla-daemon
2019-05-14  9:34 ` bugzilla-daemon
2019-05-14 15:32 ` bugzilla-daemon
2019-05-15  2:15 ` bugzilla-daemon
2019-05-15  2:16 ` bugzilla-daemon
2019-05-15  3:05 ` bugzilla-daemon
2019-05-15  3:09 ` bugzilla-daemon
2019-05-15  3:09 ` bugzilla-daemon
2019-05-15  3:10 ` bugzilla-daemon
2019-05-15  3:10 ` bugzilla-daemon
2019-05-19  9:36 ` bugzilla-daemon
2019-05-19  9:39 ` bugzilla-daemon
2019-05-19 14:27 ` bugzilla-daemon
2019-05-19 17:52 ` bugzilla-daemon
2019-05-19 20:30 ` bugzilla-daemon
2019-05-19 20:53 ` bugzilla-daemon
2019-05-19 22:04 ` bugzilla-daemon
2019-05-19 22:05 ` bugzilla-daemon
2019-05-19 22:14 ` bugzilla-daemon
2019-05-19 22:19 ` bugzilla-daemon
2019-05-19 22:28 ` bugzilla-daemon
2019-05-19 22:37 ` bugzilla-daemon
2019-05-19 23:02 ` bugzilla-daemon
2019-05-19 23:05 ` bugzilla-daemon
2019-05-19 23:18 ` bugzilla-daemon
2019-05-19 23:49 ` bugzilla-daemon
2019-05-21  7:38 ` bugzilla-daemon
2019-05-21  8:11 ` bugzilla-daemon
2019-05-21  9:42 ` bugzilla-daemon
2019-05-30 16:15 ` bugzilla-daemon
2019-06-03 11:39 ` bugzilla-daemon
2019-06-03 14:57 ` bugzilla-daemon
2019-06-04  4:19 ` bugzilla-daemon
2019-06-04  4:21 ` bugzilla-daemon
2019-06-15 16:58 ` bugzilla-daemon
2019-06-15 16:59 ` bugzilla-daemon
2019-06-15 22:15 ` bugzilla-daemon
2019-06-16 16:05 ` bugzilla-daemon
2019-06-16 16:08 ` bugzilla-daemon
2019-06-17 10:18 ` bugzilla-daemon
2019-06-21 20:17 ` bugzilla-daemon
2019-06-21 20:18 ` bugzilla-daemon
2019-06-22  4:19 ` bugzilla-daemon
2019-06-22  4:20 ` bugzilla-daemon
2019-07-08 12:29 ` bugzilla-daemon
2019-07-25  5:36 ` bugzilla-daemon
2019-07-26  1:19 ` bugzilla-daemon
2019-07-26  1:24 ` bugzilla-daemon
2019-07-26  3:19 ` bugzilla-daemon
2019-07-28  5:20 ` bugzilla-daemon
2019-07-29 10:52 ` bugzilla-daemon
2019-07-29 19:25 ` bugzilla-daemon
2019-07-29 21:40 ` bugzilla-daemon
2019-07-31 15:37 ` bugzilla-daemon
2019-07-31 17:09 ` bugzilla-daemon
2019-07-31 17:13 ` bugzilla-daemon
2019-08-03 12:10 ` bugzilla-daemon
2019-08-03 12:31 ` bugzilla-daemon
2019-08-03 13:35 ` bugzilla-daemon
2019-08-08 14:37 ` bugzilla-daemon
2019-08-10 12:10 ` bugzilla-daemon
2019-08-10 13:02 ` bugzilla-daemon
2019-08-10 13:14 ` bugzilla-daemon
2019-08-10 13:15 ` bugzilla-daemon
2019-08-10 13:29 ` bugzilla-daemon
2019-08-10 16:39 ` bugzilla-daemon
2019-08-10 19:00 ` bugzilla-daemon
2019-08-11  1:15 ` bugzilla-daemon
2019-08-11 15:26 ` bugzilla-daemon
2019-08-11 17:00 ` bugzilla-daemon
2019-08-11 18:43 ` bugzilla-daemon
2019-08-11 18:45 ` bugzilla-daemon
2019-08-11 22:31 ` bugzilla-daemon
2019-08-11 23:44 ` bugzilla-daemon
2019-08-12  3:12 ` bugzilla-daemon
2019-08-12  3:29 ` bugzilla-daemon
2019-08-12  5:18 ` bugzilla-daemon
2019-08-12  5:58 ` bugzilla-daemon
2019-08-12 13:21 ` bugzilla-daemon
2019-08-12 14:34 ` bugzilla-daemon
2019-08-12 15:34 ` bugzilla-daemon
2019-08-12 15:42 ` bugzilla-daemon
2019-08-12 15:53 ` bugzilla-daemon
2019-08-12 15:56 ` bugzilla-daemon
2019-08-12 16:32 ` bugzilla-daemon
2019-08-12 16:38 ` bugzilla-daemon
2019-08-12 16:47 ` bugzilla-daemon
2019-08-12 16:57 ` bugzilla-daemon
2019-08-12 17:40 ` bugzilla-daemon
2019-08-12 18:37 ` bugzilla-daemon
2019-08-13  3:15 ` bugzilla-daemon
2019-08-13  3:33 ` bugzilla-daemon
2019-08-13 13:05 ` bugzilla-daemon
2019-08-13 13:35 ` bugzilla-daemon
2019-08-13 15:20 ` bugzilla-daemon
2019-08-13 17:11 ` bugzilla-daemon
2019-08-13 18:33 ` bugzilla-daemon
2019-08-14 15:44 ` bugzilla-daemon
2019-08-14 17:30 ` bugzilla-daemon [this message]
2019-08-16  5:58 ` bugzilla-daemon
2019-08-16 10:10 ` bugzilla-daemon
2019-08-16 10:35 ` bugzilla-daemon
2019-08-16 10:41 ` bugzilla-daemon
2019-08-16 13:10 ` bugzilla-daemon
2019-08-16 13:18 ` bugzilla-daemon
2019-08-16 14:17 ` bugzilla-daemon
2019-08-16 21:06 ` bugzilla-daemon
2019-08-16 22:14 ` bugzilla-daemon
2019-08-16 23:19 ` bugzilla-daemon
2019-08-17  1:47 ` bugzilla-daemon
2019-08-17  2:15 ` bugzilla-daemon
2019-08-17  2:37 ` bugzilla-daemon
2019-08-17  3:16 ` bugzilla-daemon
2019-08-17 13:37 ` bugzilla-daemon
2019-08-25 20:46 ` bugzilla-daemon
2019-08-25 20:47 ` bugzilla-daemon
2019-08-25 23:01 ` bugzilla-daemon
2019-08-26  3:20 ` bugzilla-daemon
2019-08-26  3:21 ` bugzilla-daemon
2019-08-26  3:47 ` bugzilla-daemon
2019-08-27 21:56 ` bugzilla-daemon
2019-08-31  0:11 ` bugzilla-daemon
2019-09-03 16:46 ` bugzilla-daemon
2019-09-18  9:52 ` bugzilla-daemon
2019-09-18 11:36 ` bugzilla-daemon
2019-09-20 19:12 ` bugzilla-daemon
2019-09-20 19:13 ` bugzilla-daemon
2019-09-21 15:02 ` bugzilla-daemon
2019-09-21 15:12 ` bugzilla-daemon
2019-09-21 15:25 ` bugzilla-daemon
2019-09-21 15:38 ` bugzilla-daemon
2019-09-21 15:57 ` bugzilla-daemon
2019-09-21 15:59 ` bugzilla-daemon
2019-09-21 19:54 ` bugzilla-daemon
2019-09-21 20:04 ` bugzilla-daemon
2019-09-22 21:36 ` bugzilla-daemon
2019-09-22 21:38 ` bugzilla-daemon
2019-09-23  4:09 ` bugzilla-daemon
2019-09-23  4:11 ` bugzilla-daemon
2019-09-23 14:19 ` bugzilla-daemon
2019-09-23 14:20 ` bugzilla-daemon
2019-09-23 15:40 ` bugzilla-daemon
2019-09-23 15:43 ` bugzilla-daemon
2019-09-23 16:04 ` bugzilla-daemon
2019-09-24  9:44 ` bugzilla-daemon
2019-09-27 14:46 ` bugzilla-daemon
2019-09-27 15:12 ` bugzilla-daemon
2019-09-27 15:13 ` bugzilla-daemon
2019-09-29 19:25 ` bugzilla-daemon
2019-09-29 19:28 ` bugzilla-daemon
2019-09-29 19:30 ` bugzilla-daemon
2019-09-30 20:20 ` bugzilla-daemon
2019-10-01 23:44 ` bugzilla-daemon
2019-10-03  6:54 ` bugzilla-daemon
2019-10-04 12:43 ` bugzilla-daemon
2019-10-06 14:16 ` bugzilla-daemon
2019-10-06 16:39 ` bugzilla-daemon
2019-10-06 17:06 ` bugzilla-daemon
2019-10-06 17:07 ` bugzilla-daemon
2019-10-10 12:50 ` bugzilla-daemon
2019-10-12 23:34 ` bugzilla-daemon
2019-10-14  9:15 ` bugzilla-daemon
2019-10-14 10:39 ` bugzilla-daemon
2019-10-14 11:37 ` bugzilla-daemon
2019-10-14 17:05 ` bugzilla-daemon
2019-10-19 17:35 ` bugzilla-daemon
2019-10-20 18:27 ` bugzilla-daemon
2019-10-21  8:11 ` bugzilla-daemon
2019-11-10 16:36 ` bugzilla-daemon
2019-11-10 17:45 ` bugzilla-daemon
2019-11-26 12:03 ` bugzilla-daemon
2019-11-26 14:14 ` bugzilla-daemon
2019-11-26 23:13 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110674-502-DUN6i4wVaI@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox