<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If we are trying to debug a reproducible hang, probably best to just to disable gfxoff before messing with it to remove that as a factor. Otherwise, the method included in this patch is the proper way to disable/enable GFXOFF dynamically.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, February 21, 2020 10:27 AM<br>
<b>To:</b> Huang, Ray <Ray.Huang@amd.com>; Liu, Monk <Monk.Liu@amd.com><br>
<b>Cc:</b> StDenis, Tom <Tom.StDenis@amd.com>; Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: 回复: [PATCH] drm/amd/amdgpu: disable GFXOFF around debugfs access to MMIO</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 21.02.20 um 16:23 schrieb Huang Rui:<br>
> On Fri, Feb 21, 2020 at 11:18:07PM +0800, Liu, Monk wrote:<br>
>> Better not use KIQ, because when you use debugfs to read register you usually hit a hang, and by that case KIQ probably already die<br>
> If CP is busy, the gfx should be in "on" state at that time, we needn't use KIQ.<br>
<br>
Yeah, but how do you detect that? Do we have a way to wake up the CP <br>
without asking power management to do so?<br>
<br>
Cause the register debug interface is meant to be used when the ASIC is <br>
completed locked up. Sending messages to the SMU is not really going to <br>
work in that situation.<br>
<br>
Regards,<br>
Christian.<br>
<br>
><br>
> Thanks,<br>
> Ray<br>
><br>
>> -----邮件原件-----<br>
>> 发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Huang Rui<br>
>> 发送时间: 2020年2月21日 22:34<br>
>> 收件人: StDenis, Tom <Tom.StDenis@amd.com><br>
>> 抄送: Alex Deucher <alexdeucher@gmail.com>; amd-gfx list <amd-gfx@lists.freedesktop.org><br>
>> 主题: Re: [PATCH] drm/amd/amdgpu: disable GFXOFF around debugfs access to MMIO<br>
>><br>
>> On Wed, Feb 19, 2020 at 10:09:46AM -0500, Tom St Denis wrote:<br>
>>> I got some messages after a while:<br>
>>><br>
>>> [ 741.788564] Failed to send Message 8.<br>
>>> [ 746.671509] Failed to send Message 8.<br>
>>> [ 748.749673] Failed to send Message 2b.<br>
>>> [ 759.245414] Failed to send Message 7.<br>
>>> [ 763.216902] Failed to send Message 2a.<br>
>>><br>
>>> Are there any additional locks that should be held? Because some<br>
>>> commands like --top or --waves can do a lot of distinct read<br>
>>> operations (causing a lot of enable/disable calls).<br>
>>><br>
>>> I'm going to sit on this a bit since I don't think the patch is ready<br>
>>> for pushing out.<br>
>>><br>
>> How about use RREG32_KIQ and WREG32_KIQ?<br>
>><br>
>> Thanks,<br>
>> Ray<br>
>><br>
>>> Tom<br>
>>><br>
>>> On 2020-02-19 10:07 a.m., Alex Deucher wrote:<br>
>>>> On Wed, Feb 19, 2020 at 10:04 AM Tom St Denis <tom.stdenis@amd.com> wrote:<br>
>>>>> Signed-off-by: Tom St Denis <tom.stdenis@amd.com><br>
>>>> Please add a patch description. With that fixed:<br>
>>>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
>>>><br>
>>>>> ---<br>
>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++<br>
>>>>> 1 file changed, 3 insertions(+)<br>
>>>>><br>
>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c<br>
>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c<br>
>>>>> index 7379910790c9..66f763300c96 100644<br>
>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c<br>
>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c<br>
>>>>> @@ -169,6 +169,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,<br>
>>>>> if (pm_pg_lock)<br>
>>>>> mutex_lock(&adev->pm.mutex);<br>
>>>>><br>
>>>>> + amdgpu_gfx_off_ctrl(adev, false);<br>
>>>>> while (size) {<br>
>>>>> uint32_t value;<br>
>>>>><br>
>>>>> @@ -192,6 +193,8 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,<br>
>>>>> }<br>
>>>>><br>
>>>>> end:<br>
>>>>> + amdgpu_gfx_off_ctrl(adev, true);<br>
>>>>> +<br>
>>>>> if (use_bank) {<br>
>>>>> amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);<br>
>>>>> mutex_unlock(&adev->grbm_idx_mutex);<br>
>>>>> --<br>
>>>>> 2.24.1<br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> amd-gfx mailing list<br>
>>>>> amd-gfx@lists.freedesktop.org<br>
>>>>> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F</a><br>
>>>>> lists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7<br>
>>>>> C01%7Cmonk.liu%40amd.com%7Cba45efb26c0240ed036f08d7b6db20aa%7C3dd8<br>
>>>>> 961fe4884e608e11a82d994e183d%7C0%7C0%7C637178924605524378&sdat<br>
>>>>> a=%2FyHkvYU5T%2F4iFxRexsg%2BIdm7sDzyXbjzNpHUGCO7h4k%3D&reserve<br>
>>>>> d=0<br>
>>> _______________________________________________<br>
>>> amd-gfx mailing list<br>
>>> amd-gfx@lists.freedesktop.org<br>
>>> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist</a><br>
>>> s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cmo<br>
>>> nk.liu%40amd.com%7Cba45efb26c0240ed036f08d7b6db20aa%7C3dd8961fe4884e60<br>
>>> 8e11a82d994e183d%7C0%7C0%7C637178924605524378&sdata=%2FyHkvYU5T%2F<br>
>>> 4iFxRexsg%2BIdm7sDzyXbjzNpHUGCO7h4k%3D&reserved=0<br>
>> _______________________________________________<br>
>> amd-gfx mailing list<br>
>> amd-gfx@lists.freedesktop.org<br>
>> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0</a><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0</a><br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf3762304925b4019bfed08d7b6e287e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178957179179431&sdata=bY7V%2BKOF3gYu4ITGCKgAiRvXUvxPcwsz2zsEJDns3jI%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>