From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Lucas De Marchi <lucas.demarchi@intel.com>,
Tejas Upadhyay <tejas.upadhyay@intel.com>
Subject: Re: [PATCH v2] drm/xe: Fix NPD in ggtt_node_remove()
Date: Wed, 28 Aug 2024 13:16:24 -0400 [thread overview]
Message-ID: <Zs9baD_hxnZECRkV@intel.com> (raw)
In-Reply-To: <20240828092229.3606503-1-himal.prasad.ghimiray@intel.com>
On Wed, Aug 28, 2024 at 02:52:29PM +0530, Himal Prasad Ghimiray wrote:
> Make sure that ggtt_node_remove() is invoked only if both node and ggtt
> are not null. Move the null checks to the caller function
> xe_ggtt_node_remove().
>
> v2: Move null check below declarations (Tejas)
>
> Fixes: 919bb54e989c ("drm/xe: Fix missing runtime outer protection for ggtt_remove_node")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
thank you both for the patch and review. pushed to drm-xe-next
> ---
> drivers/gpu/drm/xe/xe_ggtt.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index 86fc6afa43bd..f3fca5565d32 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
> @@ -286,9 +286,6 @@ static void ggtt_node_remove(struct xe_ggtt_node *node)
> bool bound;
> int idx;
>
> - if (!node || !node->ggtt)
> - return;
> -
> bound = drm_dev_enter(&xe->drm, &idx);
>
> mutex_lock(&ggtt->lock);
> @@ -328,8 +325,14 @@ static void ggtt_node_remove_work_func(struct work_struct *work)
> */
> void xe_ggtt_node_remove(struct xe_ggtt_node *node, bool invalidate)
> {
> - struct xe_ggtt *ggtt = node->ggtt;
> - struct xe_device *xe = tile_to_xe(ggtt->tile);
> + struct xe_ggtt *ggtt;
> + struct xe_device *xe;
> +
> + if (!node || !node->ggtt)
> + return;
> +
> + ggtt = node->ggtt;
> + xe = tile_to_xe(ggtt->tile);
>
> node->invalidate_on_remove = invalidate;
>
> --
> 2.34.1
>
prev parent reply other threads:[~2024-08-28 17:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 9:22 [PATCH v2] drm/xe: Fix NPD in ggtt_node_remove() Himal Prasad Ghimiray
2024-08-28 10:14 ` ✓ CI.Patch_applied: success for " Patchwork
2024-08-28 10:15 ` ✓ CI.checkpatch: " Patchwork
2024-08-28 10:16 ` ✓ CI.KUnit: " Patchwork
2024-08-28 10:27 ` ✓ CI.Build: " Patchwork
2024-08-28 10:30 ` ✓ CI.Hooks: " Patchwork
2024-08-28 10:31 ` ✓ CI.checksparse: " Patchwork
2024-08-28 10:59 ` ✓ CI.BAT: " Patchwork
2024-08-28 16:33 ` ✓ CI.FULL: " Patchwork
2024-08-28 17:16 ` Rodrigo Vivi [this message]
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=Zs9baD_hxnZECRkV@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=tejas.upadhyay@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;
as well as URLs for NNTP newsgroup(s).