[PATCH 1/4] drm/amdkfd: refine event_interrupt_poison_consumption

Zhou1, Tao Tao.Zhou1 at amd.com
Thu Mar 17 02:13:01 UTC 2022


[AMD Official Use Only]



> -----Original Message-----
> From: Kuehling, Felix <Felix.Kuehling at amd.com>
> Sent: Wednesday, March 16, 2022 10:04 PM
> To: Zhou1, Tao <Tao.Zhou1 at amd.com>; amd-gfx at lists.freedesktop.org; Zhang,
> Hawking <Hawking.Zhang at amd.com>; Yang, Stanley
> <Stanley.Yang at amd.com>; Chai, Thomas <YiPeng.Chai at amd.com>
> Subject: Re: [PATCH 1/4] drm/amdkfd: refine
> event_interrupt_poison_consumption
> 
> Am 2022-03-16 um 05:26 schrieb Tao Zhou:
> > Combine reading and setting poison flag as one atomic operation and
> > add print message for the function.
> >
> > Signed-off-by: Tao Zhou <tao.zhou1 at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c | 11 +++++------
> >   1 file changed, 5 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
> > b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
> > index 7eedbcd14828..a992798ff8b6 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
> > @@ -93,20 +93,19 @@ enum SQ_INTERRUPT_ERROR_TYPE {
> >   static void event_interrupt_poison_consumption(struct kfd_dev *dev,
> >   				uint16_t pasid, uint16_t source_id)
> >   {
> > -	int ret = -EINVAL;
> > +	int old_poison, ret = -EINVAL;
> >   	struct kfd_process *p = kfd_lookup_process_by_pasid(pasid);
> >
> >   	if (!p)
> >   		return;
> >
> >   	/* all queues of a process will be unmapped in one time */
> > -	if (atomic_read(&p->poison)) {
> > -		kfd_unref_process(p);
> > +	old_poison = atomic_cmpxchg(&p->poison, 0, 1);
> > +	kfd_unref_process(p);
> > +	if (old_poison)
> >   		return;
> > -	}
> >
> > -	atomic_set(&p->poison, 1);
> > -	kfd_unref_process(p);
> > +	pr_warn("RAS poison consumption handling\n");
> 
> If this left over from debugging? Or did you mean to add a warning message
> here? Either way, the patch is

Both are my intention, poison consumption will be executed quietly if everything goes well, the message is helpful for debug and QA's test.

> 
> Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>
> 
> 
> >
> >   	switch (source_id) {
> >   	case SOC15_INTSRC_SQ_INTERRUPT_MSG:


More information about the amd-gfx mailing list