From: Nirmoy Das <nirmoy.das@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH 2/2] drm/xe: Add a WARN_ON for NULL job in xe_sync_entry_signal
Date: Mon, 18 Mar 2024 15:27:24 +0100 [thread overview]
Message-ID: <6bec64bb-7ec0-4945-b3ff-411c739cbab5@intel.com> (raw)
In-Reply-To: <ZfhN8C+KN+Idi4nz@DUT025-TGLU.fm.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]
Hi Matt,
On 3/18/2024 3:21 PM, Matthew Brost wrote:
> On Mon, Mar 18, 2024 at 02:50:00PM +0100, 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.
>>
>> 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..2b45950aa0af 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);
> For a warn on you this inverted - a WARN_ON(true) will pop.
Thanks, that was stupid of me. I meant to do "WARN_ON(!job)"
>
> But I think we should actually use an xe_assert here which has this
> opposite behavior - pops on xe_assert(xe, false).
>
> So the I think it should be:
>
> xe_assert(xe, job);
xe_assert needed a xe device struct which I can't find a better way to
retrieve than to pass it on as new argument
I think that is bit too much change for it. I will resend with
WARN_ON(!job).
Regards,
Nirmoy
>
> Matt
>
>> job->user_fence.used = true;
>> job->user_fence.addr = sync->addr;
>> job->user_fence.value = sync->timeline_value;
>> --
>> 2.42.0
>>
[-- Attachment #2: Type: text/html, Size: 2948 bytes --]
next prev parent reply other threads:[~2024-03-18 14:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 13:49 [PATCH 1/2] drm/xe: Fix potential integer overflow in page size calculation Nirmoy Das
2024-03-18 13:50 ` [PATCH 2/2] drm/xe: Add a WARN_ON for NULL job in xe_sync_entry_signal Nirmoy Das
2024-03-18 14:21 ` Matthew Brost
2024-03-18 14:27 ` Nirmoy Das [this message]
2024-03-18 15:18 ` Matthew Brost
2024-03-18 21:09 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Fix potential integer overflow in page size calculation Patchwork
2024-03-18 21:09 ` ✓ CI.checkpatch: " Patchwork
2024-03-18 21:10 ` ✓ CI.KUnit: " Patchwork
2024-03-18 21:20 ` ✓ CI.Build: " Patchwork
2024-03-18 21:23 ` ✓ CI.Hooks: " Patchwork
2024-03-18 21:24 ` ✓ CI.checksparse: " Patchwork
2024-03-18 21:52 ` ✗ CI.BAT: failure " 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=6bec64bb-7ec0-4945-b3ff-411c739cbab5@intel.com \
--to=nirmoy.das@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@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