Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Raag Jadav <raag.jadav@intel.com>, <lucas.demarchi@intel.com>,
	<rodrigo.vivi@intel.com>, <jani.nikula@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <riana.tauro@intel.com>,
	<matthew.brost@intel.com>, <badal.nilawar@intel.com>,
	<ville.syrjala@linux.intel.com>, <karthik.poosa@intel.com>,
	<anshuman.gupta@intel.com>
Subject: Re: [PATCH v1 1/4] drm/xe/pcode: Introduce xe_pcode_read_probe()
Date: Tue, 18 Nov 2025 20:38:36 +0100	[thread overview]
Message-ID: <eaa98b23-cf40-45c0-969a-b84beced6315@intel.com> (raw)
In-Reply-To: <20251118090012.608250-2-raag.jadav@intel.com>



On 11/18/2025 9:59 AM, Raag Jadav wrote:
> If the device is running older pcode firmware, it is possible that newer
> mailbox commands are not supported by it. The respective functionality
> isn't useful in that case but nor is error logging, as it doesn't
> particularly signify anything wrong with pcode firmware or device as a
> whole. Introduce xe_pcode_read_probe() which allows the caller to check
> for mailbox command support and determine if the respective functionality
> exists on the device without it being reported as an error. This is useful
> in cases where we want to make functionality decisions in the driver based
> on pcode return codes and a relatively simpler design choice compared to
> other solutions like checking pcode firmware version, which comes with
> additional complexity of binding every single command to a specific version
> and deems pcode commands useless in case the driver fails to obtain it for
> reasons unrelated to pcode.

s/pcode/PCODE

as in the message below you are using "PCODE", so IMO the same naming should everywhere, including commit message

> 
> This only silences command related failures and still reports other
> failures as errors, so we don't end up hiding the genuine ones.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pcode.c | 42 ++++++++++++++++++++++++-----------
>  drivers/gpu/drm/xe/xe_pcode.h |  1 +
>  2 files changed, 30 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index 0d33c14ea0cf..797b757f7a68 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -30,7 +30,7 @@
>   * - PCODE for display operations
>   */
>  
> -static int pcode_mailbox_status(struct xe_tile *tile)
> +static int pcode_mailbox_status(struct xe_tile *tile, bool probe)
>  {
>  	const char *err_str;
>  	int err_decode;
> @@ -57,8 +57,12 @@ static int pcode_mailbox_status(struct xe_tile *tile)
>  	}
>  
>  	if (err) {
> -		drm_err(&tile_to_xe(tile)->drm, "PCODE Mailbox failed: %d %s",
> -			err_decode, err_str);
> +		if (probe && err_decode == -ENXIO)
> +			drm_dbg(&tile_to_xe(tile)->drm, "PCODE Mailbox unsupported: %d %s",
> +				err_decode, err_str);
> +		else
> +			drm_err(&tile_to_xe(tile)->drm, "PCODE Mailbox failed: %d %s",
> +				err_decode, err_str);

for tile-related messages, we have dedicated tile-specific helpers:

#include "xe_tile_printk.h"

	xe_tile_err(tile, ....)
	xe_tile_dbg(tile, ....)



  parent reply	other threads:[~2025-11-18 19:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18  8:59 [PATCH v1 0/4] Introduce xe_pcode_read_probe() Raag Jadav
2025-11-18  8:59 ` [PATCH v1 1/4] drm/xe/pcode: " Raag Jadav
2025-11-18 13:42   ` Rodrigo Vivi
2025-11-18 15:38     ` Raag Jadav
2025-11-18 15:47       ` Rodrigo Vivi
2025-11-20 15:02       ` Lucas De Marchi
2025-11-21  8:33         ` Raag Jadav
2025-11-25  5:04           ` Raag Jadav
2025-11-25 17:41             ` Rodrigo Vivi
2025-11-27  4:51               ` Raag Jadav
2025-12-01  5:06                 ` Raag Jadav
2025-11-18 19:38   ` Michal Wajdeczko [this message]
2025-11-18  8:59 ` [PATCH v1 2/4] drm/xe/sysfs: Use xe_pcode_read_probe() to check for mailbox command support Raag Jadav
2025-11-18  8:59 ` [PATCH v1 3/4] drm/xe/hwmon: " Raag Jadav
2025-11-18  8:59 ` [PATCH v1 4/4] drm/xe/late_bind: " Raag Jadav
2025-11-18  9:09 ` ✓ CI.KUnit: success for Introduce xe_pcode_read_probe() Patchwork
2025-11-18  9:47 ` ✓ Xe.CI.BAT: " Patchwork
2025-11-18 11:56 ` ✗ 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=eaa98b23-cf40-45c0-969a-b84beced6315@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=karthik.poosa@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.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