All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grodzovsky, Andrey" <Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>
To: "Zhou1, Tao" <Tao.Zhou1-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"Chen, Guchun" <Guchun.Chen-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: Fix mutex lock from atomic context.
Date: Wed, 11 Sep 2019 14:41:12 +0000	[thread overview]
Message-ID: <603add77-1476-ebc8-69f9-2cf88a788a6b@amd.com> (raw)
In-Reply-To: <d35cc3f6-ff46-175e-3a92-5f7948f97bef-5C7GfCeVMHo@public.gmane.org>

On second though this will break  what about reserving bad pages when 
resetting GPU for non RAS error reason such as manual reset ,S3 or ring 
timeout, (amdgpu_ras_resume->amdgpu_ras_reset_gpu) so i will keep the 
code as is.

Another possible issue in existing code - looks like no reservation will 
take place in those case even now as amdgpu_ras_reserve_bad_pages 
data->last_reserved will be equal to data->count , no ? Looks like for 
this case you need to add flag to FORCE reservation for all pages from  
0 to data->counnt.

Andrey

On 9/11/19 10:19 AM, Andrey Grodzovsky wrote:
> I like this much more, I will relocate to 
> amdgpu_umc_process_ras_data_cb an push.
>
> Andrey
>
> On 9/10/19 11:08 PM, Zhou1, Tao wrote:
>> amdgpu_ras_reserve_bad_pages is only used by umc block, so another 
>> approach is to move it into amdgpu_umc_process_ras_data_cb.
>> Anyway, either way is OK and the patch is:
>>
>> Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
>>
>>> -----Original Message-----
>>> From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>>> Sent: 2019年9月11日 3:41
>>> To: amd-gfx@lists.freedesktop.org
>>> Cc: Chen, Guchun <Guchun.Chen@amd.com>; Zhou1, Tao
>>> <Tao.Zhou1@amd.com>; Deucher, Alexander
>>> <Alexander.Deucher@amd.com>; Grodzovsky, Andrey
>>> <Andrey.Grodzovsky@amd.com>
>>> Subject: [PATCH] drm/amdgpu: Fix mutex lock from atomic context.
>>>
>>> Problem:
>>> amdgpu_ras_reserve_bad_pages was moved to amdgpu_ras_reset_gpu
>>> because writing to EEPROM during ASIC reset was unstable.
>>> But for ERREVENT_ATHUB_INTERRUPT amdgpu_ras_reset_gpu is called
>>> directly from ISR context and so locking is not allowed. Also it's 
>>> irrelevant for
>>> this partilcular interrupt as this is generic RAS interrupt and not 
>>> memory
>>> errors specific.
>>>
>>> Fix:
>>> Avoid calling amdgpu_ras_reserve_bad_pages if not in task context.
>>>
>>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
>>> index 012034d..dd5da3c 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
>>> @@ -504,7 +504,9 @@ static inline int amdgpu_ras_reset_gpu(struct
>>> amdgpu_device *adev,
>>>       /* save bad page to eeprom before gpu reset,
>>>        * i2c may be unstable in gpu reset
>>>        */
>>> -    amdgpu_ras_reserve_bad_pages(adev);
>>> +    if (in_task())
>>> +        amdgpu_ras_reserve_bad_pages(adev);
>>> +
>>>       if (atomic_cmpxchg(&ras->in_recovery, 0, 1) == 0)
>>>           schedule_work(&ras->recovery_work);
>>>       return 0;
>>> -- 
>>> 2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-09-11 14:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 19:41 [PATCH] drm/amdgpu: Fix mutex lock from atomic context Andrey Grodzovsky
     [not found] ` <1568144487-27802-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-09-11  3:08   ` Zhou1, Tao
     [not found]     ` <MN2PR12MB3054A0B4D399377417213B76B0B10-rweVpJHSKTqnT25eLM+iUQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-09-11 14:19       ` Grodzovsky, Andrey
     [not found]         ` <d35cc3f6-ff46-175e-3a92-5f7948f97bef-5C7GfCeVMHo@public.gmane.org>
2019-09-11 14:41           ` Grodzovsky, Andrey [this message]
     [not found]             ` <603add77-1476-ebc8-69f9-2cf88a788a6b-5C7GfCeVMHo@public.gmane.org>
2019-09-12  1:53               ` Chen, Guchun
     [not found]                 ` <SN6PR12MB2813F0DFFE8EC027AAF6D6DAF1B00-kxOKjb6HO/Hw8A9fYknAbAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-09-12  2:32                   ` Grodzovsky, Andrey
     [not found]                     ` <MWHPR12MB14533B06E13B86E54520E991EAB00-Gy0DoCVfaSWZBIDmKHdw+wdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-09-12 11:35                       ` Zhou1, Tao
     [not found]                         ` <MN2PR12MB3054CE8F6F6097847B188457B0B00-rweVpJHSKTqnT25eLM+iUQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-09-12 14:09                           ` Grodzovsky, Andrey
     [not found]                             ` <1caeca1e-40e7-9b59-37f9-47704903655f-5C7GfCeVMHo@public.gmane.org>
2019-09-12 15:15                               ` Christian König
     [not found]                                 ` <91382817-97b0-9ca5-24c6-e7880c4bdb55-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-09-12 15:19                                   ` Grodzovsky, Andrey
2019-09-11  6:54   ` Chen, Guchun

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=603add77-1476-ebc8-69f9-2cf88a788a6b@amd.com \
    --to=andrey.grodzovsky-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Guchun.Chen-5C7GfCeVMHo@public.gmane.org \
    --cc=Tao.Zhou1-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 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.