All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <michal.wajdeczko@intel.com>
Subject: Re: [PATCH 2/4] drm/xe: Validate wedged_mode modparam input
Date: Fri, 25 Apr 2025 10:20:18 -0400	[thread overview]
Message-ID: <aAuaIkqA_7XZ2IFb@intel.com> (raw)
In-Reply-To: <20250424143043.937-3-lukasz.laguna@intel.com>

On Thu, Apr 24, 2025 at 04:30:41PM +0200, Lukasz Laguna wrote:
> Check correctness of the wedged_mode module parameter input. If the
> value is out of the expected range (>2), set the default (1) and log a
> debug message.
> 
> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_device.c      | 7 ++++++-
>  drivers/gpu/drm/xe/xe_guc_capture.c | 2 +-
>  drivers/gpu/drm/xe/xe_module.c      | 2 +-
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 75e753e0a682..d2de6936cc20 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -731,7 +731,12 @@ int xe_device_probe_early(struct xe_device *xe)
>  	if (err)
>  		return err;
>  
> -	xe->wedged.mode = xe_modparam.wedged_mode;
> +	if (xe_modparam.wedged_mode > 2) {
> +		drm_dbg(&xe->drm, "Used wedged_mode value is invalid. Setting default (1)\n");
> +		xe->wedged.mode = 1; /* default */
> +	} else {
> +		xe->wedged.mode = xe_modparam.wedged_mode;
> +	}
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/xe/xe_guc_capture.c b/drivers/gpu/drm/xe/xe_guc_capture.c
> index 859a3ba91be5..a471cf55ad8d 100644
> --- a/drivers/gpu/drm/xe/xe_guc_capture.c
> +++ b/drivers/gpu/drm/xe/xe_guc_capture.c
> @@ -1856,7 +1856,7 @@ xe_guc_capture_get_matching_and_lock(struct xe_exec_queue *q)
>  		return NULL;
>  
>  	xe = gt_to_xe(q->gt);
> -	if (xe->wedged.mode >= 2 || !xe_device_uc_enabled(xe) || IS_SRIOV_VF(xe))
> +	if (xe->wedged.mode == 2 || !xe_device_uc_enabled(xe) || IS_SRIOV_VF(xe))
>  		return NULL;
>  
>  	ss = &xe->devcoredump.snapshot;
> diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
> index 05c7d0ae6d83..b1b9bb2056ae 100644
> --- a/drivers/gpu/drm/xe/xe_module.c
> +++ b/drivers/gpu/drm/xe/xe_module.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(max_vfs,
>  		 "(0 = no VFs [default]; N = allow up to N VFs)");
>  #endif
>  
> -module_param_named_unsafe(wedged_mode, xe_modparam.wedged_mode, int, 0600);
> +module_param_named_unsafe(wedged_mode, xe_modparam.wedged_mode, uint, 0600);
>  MODULE_PARM_DESC(wedged_mode,
>  		 "Module's default policy for the wedged mode - 0=never, 1=upon-critical-errors[default], 2=upon-any-hang");
>  
> -- 
> 2.40.0
> 

  parent reply	other threads:[~2025-04-25 14:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 14:30 [PATCH 0/4] drm/xe: Improve wedged mode handling Lukasz Laguna
2025-04-24 14:30 ` [PATCH 1/4] drm/xe: Don't update wedged mode in case of an error Lukasz Laguna
2025-04-24 21:37   ` Matthew Brost
2025-04-25 14:18   ` Rodrigo Vivi
2025-04-24 14:30 ` [PATCH 2/4] drm/xe: Validate wedged_mode modparam input Lukasz Laguna
2025-04-24 21:42   ` Matthew Brost
2025-04-25 14:20   ` Rodrigo Vivi [this message]
2025-05-12  8:18   ` Michal Wajdeczko
2025-04-24 14:30 ` [PATCH 3/4] drm/xe/vf: Disallow setting wedged_mode=2 Lukasz Laguna
2025-04-24 21:43   ` Matthew Brost
2025-04-25 14:21   ` Rodrigo Vivi
2025-05-12  8:25   ` Michal Wajdeczko
2025-04-24 14:30 ` [PATCH 4/4] drm/xe/pf: Allow wedged_mode=2 only in debug config Lukasz Laguna
2025-05-12  8:29   ` Michal Wajdeczko
2025-04-24 18:34 ` ✓ CI.Patch_applied: success for drm/xe: Improve wedged mode handling Patchwork
2025-04-24 18:35 ` ✓ CI.checkpatch: " Patchwork
2025-04-24 18:36 ` ✓ CI.KUnit: " Patchwork
2025-04-24 18:44 ` ✓ CI.Build: " Patchwork
2025-04-24 18:46 ` ✗ CI.Hooks: failure " Patchwork
2025-04-24 18:48 ` ✓ CI.checksparse: success " Patchwork
2025-04-24 19:28 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-25 16:27 ` ✗ Xe.CI.Full: 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=aAuaIkqA_7XZ2IFb@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lukasz.laguna@intel.com \
    --cc=michal.wajdeczko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.