Skip to content

Commit

Permalink
drm/xe: Check pat.ops before dumping PAT settings
Browse files Browse the repository at this point in the history
We may leave pat.ops unset when running on brand new platform or
when running as a VF.  While the former is unlikely, the latter
is valid (future) use case and will cause NPD when someone will
try to dump PAT settings by debugfs.

It's better to check pointer to pat.ops instead of specific .dump
hook, as we have this hook always defined for every .ops variant.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240409105106.1067-2-michal.wajdeczko@intel.com
  • Loading branch information
mwajdecz committed Apr 10, 2024
1 parent 5d66788 commit a918e77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
{
struct xe_device *xe = gt_to_xe(gt);

if (!xe->pat.ops->dump)
if (!xe->pat.ops)
return;

xe->pat.ops->dump(gt, p);
Expand Down

0 comments on commit a918e77

Please sign in to comment.