RE: [PATCH] drm/amdgpu: return an error for hw access in INFO ioctl when in reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - Internal Distribution Only]

Hi, Christian and Alex
      Not only amdgpu ioctls, but amdkfd ioctls also have the same issue. 

Best Regards
Dennis Li
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Christian König
Sent: Wednesday, July 1, 2020 4:20 PM
To: Alex Deucher <alexdeucher@xxxxxxxxx>; amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>
Subject: Re: [PATCH] drm/amdgpu: return an error for hw access in INFO ioctl when in reset

I don't think this is a good idea, we should probably rather wait for the GPU reset to finish by taking the appropriate lock.

Christian.

Am 01.07.20 um 07:33 schrieb Alex Deucher:
> ping?
>
> On Fri, Jun 26, 2020 at 10:04 AM Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
>> When the GPU is in reset, accessing the hw is unreliable and could 
>> interfere with the reset.  Return an error in those cases.
>>
>> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> index 341d072edd95..fd51d6554ee2 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> @@ -684,6 +684,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
>>                  if (info->read_mmr_reg.count > 128)
>>                          return -EINVAL;
>>
>> +               if (adev->in_gpu_reset)
>> +                       return -EPERM;
>> +
>>                  regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs), GFP_KERNEL);
>>                  if (!regs)
>>                          return -ENOMEM; @@ -854,6 +857,9 @@ static 
>> int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
>>                  if (!adev->pm.dpm_enabled)
>>                          return -ENOENT;
>>
>> +               if (adev->in_gpu_reset)
>> +                       return -EPERM;
>> +
>>                  switch (info->sensor_info.type) {
>>                  case AMDGPU_INFO_SENSOR_GFX_SCLK:
>>                          /* get sclk in Mhz */
>> --
>> 2.25.4
>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CDe
> nnis.Li%40amd.com%7Cefeeda4b6d194660fbc508d81d9791a3%7C3dd8961fe4884e6
> 08e11a82d994e183d%7C0%7C0%7C637291884123360340&amp;sdata=GNPWQNndUJKx7
> 70fDTuRGBnJzfmRUQjD4B1HBie3xUQ%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CDennis.Li%40amd.com%7Cefeeda4b6d194660fbc508d81d9791a3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637291884123360340&amp;sdata=GNPWQNndUJKx770fDTuRGBnJzfmRUQjD4B1HBie3xUQ%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux