Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-xe@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Matthew Auld <matthew.auld@intel.com>,
	Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH v2 2/2] drm/xe: Add a WARN_ON for NULL job in xe_sync_entry_signal
Date: Wed, 20 Mar 2024 14:07:26 +0100	[thread overview]
Message-ID: <1ebfbec2-ae11-4ac3-8395-17031146dff8@linux.intel.com> (raw)
In-Reply-To: <ghya5zsi2nxf4rx3253d3yh7btwybd2k6pdxeps26wnqabyf3d@yrghhvwbu57t>


On 3/20/2024 4:20 AM, Lucas De Marchi wrote:
> On Mon, Mar 18, 2024 at 07:41:56PM +0100, Nirmoy Das wrote:
>>
>> On 3/18/2024 6:41 PM, Michal Wajdeczko wrote:
>>>
>>> On 18.03.2024 17:43, Nirmoy Das wrote:
>>>> Add a warn for NULL job when sync->type is
>>>> DRM_XE_SYNC_TYPE_USER_FENCE. This should be a programming
>>>> error and should never happen so warn and let the kernel crash
>>>> if that ever happens.
>>> IMO adding WARN and then let kernel crash is pointless as you will have
>>> almost exactly the same report as from NPD
>>
>> WARN should give us the line number which is not the case for NDP I 
>> think.
>
> and a NPD will put the line with the NPD straight in the RIP line.

I always observed NPD to be func name + offset,  not the line number.


> So,
> to second what Michal said, what's the point?
>
> it would make sense if you were adding the warning earlier and make the
> driver still behave. The place it was added, not so much

I will not defend this patch much :) now that I think I have a better one

https://patchwork.freedesktop.org/series/131371/


Regards,

Nirmoy

>
> Lucas De Marchi
>
>>
>>
>> Regards,
>>
>> Nirmoy
>>
>>>
>>> for programming errors we should xe_assert() that will provide 
>>> necessary
>>> hint during code refactor but will be compiled on production builds
>>>
>>> only if you feel that that job could be still (but unlikely) NULL then
>>> you should use drm_WARN/xe_gt_WARN and provide necessary fallback
>>>
>>>> Cc: Matthew Auld <matthew.auld@intel.com>
>>>> Cc: Matthew Brost <matthew.brost@intel.com>
>>>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>>>> ---
>>>>  drivers/gpu/drm/xe/xe_sync.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/xe/xe_sync.c 
>>>> b/drivers/gpu/drm/xe/xe_sync.c
>>>> index 02c9577fe418..247505c3478d 100644
>>>> --- a/drivers/gpu/drm/xe/xe_sync.c
>>>> +++ b/drivers/gpu/drm/xe/xe_sync.c
>>>> @@ -255,6 +255,7 @@ void xe_sync_entry_signal(struct xe_sync_entry 
>>>> *sync, struct xe_sched_job *job,
>>>>              dma_fence_put(fence);
>>>>          }
>>>>      } else if (sync->type == DRM_XE_SYNC_TYPE_USER_FENCE) {
>>>> +        XE_WARN_ON(!job);
>>>>          job->user_fence.used = true;
>>>>          job->user_fence.addr = sync->addr;
>>>>          job->user_fence.value = sync->timeline_value;

  reply	other threads:[~2024-03-20 13:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 16:43 [PATCH v2 1/2] drm/xe: Fix potential integer overflow in page size calculation Nirmoy Das
2024-03-18 16:43 ` [PATCH v2 2/2] drm/xe: Add a WARN_ON for NULL job in xe_sync_entry_signal Nirmoy Das
2024-03-18 17:03   ` Matthew Brost
2024-03-18 17:41   ` Michal Wajdeczko
2024-03-18 18:41     ` Nirmoy Das
2024-03-20  3:20       ` Lucas De Marchi
2024-03-20 13:07         ` Nirmoy Das [this message]
2025-02-10 18:05   ` Upadhyay, Tejas
2025-02-10 18:14     ` Upadhyay, Tejas
2024-03-18 22:50 ` ✓ CI.Patch_applied: success for series starting with [v2,1/2] drm/xe: Fix potential integer overflow in page size calculation Patchwork
2024-03-18 22:50 ` ✓ CI.checkpatch: " Patchwork
2024-03-18 22:51 ` ✓ CI.KUnit: " Patchwork
2024-03-18 23:01 ` ✓ CI.Build: " Patchwork
2024-03-18 23:04 ` ✓ CI.Hooks: " Patchwork
2024-03-18 23:05 ` ✓ CI.checksparse: " Patchwork
2024-03-18 23:27 ` ✓ CI.BAT: " Patchwork

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=1ebfbec2-ae11-4ac3-8395-17031146dff8@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox