[PATCH v2 4/7] drm/amdgpu: Fix SMU error failure
Andrey Grodzovsky
Andrey.Grodzovsky at amd.com
Fri Aug 28 20:28:55 UTC 2020
On 8/28/20 3:29 PM, Alex Deucher wrote:
> On Fri, Aug 28, 2020 at 12:06 PM Andrey Grodzovsky
> <andrey.grodzovsky at amd.com> wrote:
>> Wait for HW/PSP initiated ASIC reset to complete before
>> starting the recovery operations.
>>
>> v2: Remove typo
>>
>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 22 ++++++++++++++++++++--
>> 1 file changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 9a367a8..06664a9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -4844,14 +4844,32 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
>> {
>> struct drm_device *dev = pci_get_drvdata(pdev);
>> struct amdgpu_device *adev = drm_to_adev(dev);
>> - int r;
>> + int r, i;
>> bool vram_lost;
>> + u32 memsize;
>>
>> DRM_INFO("PCI error: slot reset callback!!\n");
>>
>> + /* wait for asic to come out of reset */
>> + msleep(500);
>> +
> I wonder if other reset paths need this wait as well?
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
They already have this (see psp_v11_0_mode1_reset)
Andrey
>
>> pci_restore_state(pdev);
>>
>> - adev->in_pci_err_recovery = true;
>> + /* confirm ASIC came out of reset */
>> + for (i = 0; i < adev->usec_timeout; i++) {
>> + memsize = amdgpu_asic_get_config_memsize(adev);
>> +
>> + if (memsize != 0xffffffff)
>> + break;
>> + udelay(1);
>> + }
>> + if (memsize == 0xffffffff) {
>> + r = -ETIME;
>> + goto out;
>> + }
>> +
>> + /* TODO Call amdgpu_pre_asic_reset instead */
>> + adev->in_pci_err_recovery = true;
>> r = amdgpu_device_ip_suspend(adev);
>> adev->in_pci_err_recovery = false;
>> if (r)
>> --
>> 2.7.4
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx at lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Candrey.grodzovsky%40amd.com%7Cbcd9cce89b49498ecc9808d84b88ac73%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637342397661929023&sdata=imwQ%2F25z3XUPWlPtnP2UTCfRmv3Ejx04zWvOHn1Re7k%3D&reserved=0
More information about the amd-gfx
mailing list