Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dnyaneshwar Bhadane" <dnyaneshwar.bhadane@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 09/12] drm/xe/pat: Report missing PAT table using structured xe_log API
Date: Wed, 19 Aug 2026 19:23:14 +0000	[thread overview]
Message-ID: <20260819192314.CBCE31F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260819191442.1957986-10-dnyaneshwar.bhadane@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The fallback path for missing PAT tables does not abort execution, resulting in an uninitialized `xe->pat.ops` pointer being dereferenced.
--

--- Patch [9]: [PATCH 09/12] drm/xe/pat: Report missing PAT table using structured xe_log API ---
commit 08576418698c3b8696a3e32ba77fd4f46243b78e
Author: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>

drm/xe/pat: Report missing PAT table using structured xe_log API

Replace drm_err() with xe_log_err() using the PAT component tag
when a platform has no matching PAT table entry.

> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> index 4331ef097ba0c..66a2d76ea00b5 100644
> --- a/drivers/gpu/drm/xe/xe_pat.c
> +++ b/drivers/gpu/drm/xe/xe_pat.c

[ ... ]

> @@ -686,8 +687,9 @@ void xe_pat_init_early(struct xe_device *xe)
>  		 * raise an error rather than trying to silently inherit the
>  		 * most recent platform's behavior.
>  		 */
> -		drm_err(&xe->drm, "Missing PAT table for platform with graphics version %d.%02d!\n",
> -			GRAPHICS_VER(xe), GRAPHICS_VERx100(xe) % 100);
> +		xe_log_err(xe, PAT, -EINVAL,
> +			   "Missing PAT table for platform with graphics version %d.%02d!\n",
> +			   GRAPHICS_VER(xe), GRAPHICS_VERx100(xe) % 100);
>  	}
>  
>  	xe_assert(xe, xe->pat.ops);

[Severity: High]
This is a pre-existing issue, but since you are modifying this error path,
I wanted to ask about the missing early return here.

When a platform doesn't match any known PAT table (such as when force-probing
a new unconfigured PCI ID), xe_pat_init_early() logs an error but continues
execution. This leaves xe->pat.ops uninitialized.

In debug builds, this will immediately crash on the subsequent assertion:

	xe_assert(xe, xe->pat.ops->dump);

In non-debug builds, it propagates to xe_pat_init() where it unconditionally
dereferences the uninitialized pointer:

	if (xe_gt_is_media_type(gt))
		xe->pat.ops->program_media(gt, xe->pat.table, xe->pat.n_entries);
	else
		xe->pat.ops->program_graphics(gt, xe->pat.table, xe->pat.n_entries);

Should this error path abort initialization rather than continuing with an
uninitialized xe->pat.ops pointer?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260819191442.1957986-1-dnyaneshwar.bhadane@intel.com?part=9

  reply	other threads:[~2026-08-19 19:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 19:14 [PATCH 00/12] drm/xe: Convert IO_BUS errors to structured xe_log API Dnyaneshwar Bhadane
2026-08-19 19:14 ` [PATCH 01/12] drm/xe/log: Add VRAM, PAT, and HWMON DRIVER_HARDWARE components Dnyaneshwar Bhadane
2026-08-19 19:14 ` [PATCH 02/12] drm/xe/ggtt: Report GGTT errors using structured logging Dnyaneshwar Bhadane
2026-08-19 19:14 ` [PATCH 03/12] drm/xe/hwmon: Report errors using structured xe_log API Dnyaneshwar Bhadane
2026-08-19 19:23   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 04/12] drm/xe/mmio: Report BAR mapping " Dnyaneshwar Bhadane
2026-08-19 19:14 ` [PATCH 05/12] drm/xe/memirq: Report " Dnyaneshwar Bhadane
2026-08-19 19:22   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 06/12] drm/xe/reg_whitelist: Report whitelist overflow " Dnyaneshwar Bhadane
2026-08-19 19:22   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 07/12] drm/xe/reg_sr: Report save-restore errors " Dnyaneshwar Bhadane
2026-08-19 19:14 ` [PATCH 08/12] drm/xe/pat: Assert pat.ops before dereferencing members Dnyaneshwar Bhadane
2026-08-19 19:22   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 09/12] drm/xe/pat: Report missing PAT table using structured xe_log API Dnyaneshwar Bhadane
2026-08-19 19:23   ` sashiko-bot [this message]
2026-08-19 19:14 ` [PATCH 10/12] drm/xe/pci: Report unknown GMDID versions " Dnyaneshwar Bhadane
2026-08-19 19:27   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 11/12] drm/xe/lmtt: Report invalidation errors " Dnyaneshwar Bhadane
2026-08-19 19:28   ` sashiko-bot
2026-08-19 19:14 ` [PATCH 12/12] drm/xe/vram: Report VRAM " Dnyaneshwar Bhadane
2026-08-19 19:29   ` sashiko-bot
2026-08-19 19:23 ` ✓ CI.KUnit: success for drm/xe: Convert IO_BUS errors to " Patchwork
2026-08-19 20:45 ` ✓ Xe.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=20260819192314.CBCE31F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dnyaneshwar.bhadane@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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