From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: <John.C.Harrison@Intel.com>, <Intel-GFX@Lists.FreeDesktop.Org>
Cc: DRI-Devel@Lists.FreeDesktop.Org
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915/guc: Fix a static analysis warning
Date: Thu, 22 Dec 2022 13:57:28 +0100 [thread overview]
Message-ID: <eb083fc2-8a0d-0ec6-0cd1-135fb9b9ef10@intel.com> (raw)
In-Reply-To: <20221221193031.687266-3-John.C.Harrison@Intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Daniele
On 12/21/2022 8:30 PM, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
>
> A static analyser was complaining about not checking for null
> pointers. However, the location of the complaint can only be reached
> in the first place if said pointer is non-null. Basically, if we are
> using a v69 GuC then the descriptor pool is guaranteed to be alocated
> at start of day or submission will be disabled with an ENOMEM error.
> And if we are using a later GuC that does not use a descriptor pool
> then the v69 submission function would not be called. So, not a
> possible null at that point in the code.
>
> Hence adding a GEM_BUG_ON(!ptr) to keep the tool happy.
>
> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> ---
> drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
> index 4682ec1dbd9c0..c93d0594bfd5e 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
> @@ -2538,6 +2538,7 @@ static void prepare_context_registration_info_v69(struct intel_context *ce)
> i915_gem_object_is_lmem(ce->ring->vma->obj));
>
> desc = __get_lrc_desc_v69(guc, ctx_id);
> + GEM_BUG_ON(!desc);
> desc->engine_class = engine_class_to_guc_class(engine->class);
> desc->engine_submit_mask = engine->logical_mask;
> desc->hw_context_desc = ce->lrc.lrca;
next prev parent reply other threads:[~2022-12-22 12:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 19:30 [Intel-gfx] [PATCH 0/3] Fixes for various UC related issues John.C.Harrison
2022-12-21 19:30 ` [Intel-gfx] [PATCH 1/3] drm/i915/guc: Fix missing return code checks in submission init John.C.Harrison
2022-12-22 12:56 ` Ceraolo Spurio, Daniele
2022-12-21 19:30 ` [Intel-gfx] [PATCH 2/3] drm/i915/guc: Fix a static analysis warning John.C.Harrison
2022-12-22 12:57 ` Ceraolo Spurio, Daniele [this message]
2022-12-21 19:30 ` [Intel-gfx] [PATCH 3/3] drm/i915/uc: Fix two issues with over-size firmware files John.C.Harrison
2022-12-22 11:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Fixes for various UC related issues (rev2) Patchwork
2022-12-22 11:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-12-22 11:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-22 16:43 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-12-20 2:41 [Intel-gfx] [PATCH 0/3] Fixes for various UC related issues John.C.Harrison
2022-12-20 2:41 ` [Intel-gfx] [PATCH 2/3] drm/i915/guc: Fix a static analysis warning John.C.Harrison
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=eb083fc2-8a0d-0ec6-0cd1-135fb9b9ef10@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=DRI-Devel@Lists.FreeDesktop.Org \
--cc=Intel-GFX@Lists.FreeDesktop.Org \
--cc=John.C.Harrison@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