All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>,
	Summers Stuart <stuart.summers@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Riana Tauro <riana.tauro@intel.com>,
	Aravind Iddamsetty <aravind.iddamsetty@intel.com>
Subject: Re: [PATCH v3 18/23] drm/xe: Report 'Survivability Mode' errors using SIGID
Date: Wed, 12 Aug 2026 10:17:03 +0530	[thread overview]
Message-ID: <1f767000-73da-4075-8577-374ddf1cf9fa@intel.com> (raw)
In-Reply-To: <092a6287-e2ff-478c-8d33-ca65ed5b3c30@intel.com>

[-- Attachment #1: Type: text/plain, Size: 6968 bytes --]


On 07-08-2026 05:44 pm, Michal Wajdeczko wrote:
>
> On 8/7/2026 1:18 PM, Mallesh, Koujalagi wrote:
>> On 30-07-2026 08:51 pm, Michal Wajdeczko wrote:
>>> Report various 'Survivability Mode' errors using xe_log() helpers.
>>>
>>> Signed-off-by: Michal Wajdeczko<michal.wajdeczko@intel.com>
>>> Cc: Rodrigo Vivi<rodrigo.vivi@intel.com>
>>> Cc: Riana Tauro<riana.tauro@intel.com>
>>> Cc: Aravind Iddamsetty<aravind.iddamsetty@intel.com>
>>> Cc: Mallesh Koujalagi<mallesh.koujalagi@intel.com>
>>> ---
>>>   drivers/gpu/drm/xe/xe_survivability_mode.c | 24 +++++++++++++---------
>>>   1 file changed, 14 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> index 4c506027fa94..788b7e8137a9 100644
>>> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> @@ -14,9 +14,11 @@
>>>   #include "xe_device.h"
>>>   #include "xe_heci_gsc.h"
>>>   #include "xe_i2c.h"
>>> +#include "xe_log.h"
>>>   #include "xe_mmio.h"
>>>   #include "xe_nvm.h"
>>>   #include "xe_pcode_api.h"
>>> +#include "xe_printk.h"
>>>   #include "xe_vsec.h"
>>>   
>>>   /**
>>> @@ -179,11 +181,11 @@ static void log_survivability_info(struct pci_dev *pdev)
>>>   	u32 *info = survivability->info;
>>>   	int id;
>>>   
>>> -	dev_info(&pdev->dev, "Survivability Boot Status : Critical Failure (%d)\n",
>>> -		 survivability->boot_status);
>>> +	xe_log_info(xe, SURVIVABILITY, "Boot Status : Critical Failure (%d)\n",
>>> +		    survivability->boot_status);
> btw, is it OK that we use INFO level for "critical failure" ?

Good catch! We log the message when the device has a critical boot 
failure and the survivability is too old to handle if (version < 2)

so the driver is about to abort with -ENXIO. Using xe_log_info for that 
situation is wrong one. Using

xe_log_err_fatal(xe, SURVIVABILITY, -ENXIO, ...); we can fix it.

>
>>>   	for (id = 0; id < MAX_SCRATCH_REG; id++) {
>>>   		if (info[id])
>>> -			dev_info(&pdev->dev, "%s: 0x%x\n", reg_map[id], info[id]);
>>> +			xe_log_info(xe, SURVIVABILITY, "%s: 0x%x\n", reg_map[id], info[id]);
>>>   	}
>>>   }
>>>   
>>> @@ -316,7 +318,6 @@ static int create_survivability_sysfs(struct pci_dev *pdev)
>>>   
>>>   static int enable_boot_survivability_mode(struct pci_dev *pdev)
>>>   {
>>> -	struct device *dev = &pdev->dev;
>>>   	struct xe_device *xe = pdev_to_xe_device(pdev);
>>>   	struct xe_survivability *survivability = &xe->survivability;
>>>   	int ret = 0;
>>> @@ -342,12 +343,12 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev)
>>>   	if (ret)
>>>   		goto err;
>>>   
>>> -	dev_err(dev, "In Survivability Mode\n");
>>> -
>>> +	xe_log_emit(pdev, check_boot_failure(xe) ? CPER_SEV_FATAL : CPER_SEV_INFORMATIONAL,
>>> +		    XE_SIGID_SURVIVABILITY, 0, 0, 0, 0, "In Survivability Boot Mode\n");
>> Please make it cleaner and simpler.
> sure
>
> it was one of the earliest examples of the new xe_log API,
> and that's why it was using the base xe_log function
>> if(check_boot_failure(xe))
>>
>>      xe_log_err_fatal(xe, SURVIVABILITY, .. );
>>
>> else
>>
>>       xe_log_info(xe, SURVIVABILITY, .. );
>>
>>
>> OR
>>
>> xe_log_emit(xe_any_to_pdev(xe),
> we do have pdev already, no need to cast back to xe
Agreed!
>
>>              check_boot_failure(xe) ? CPER_SEV_FATAL : CPER_SEV_INFORMATIONAL,
>>              XE_SIGID_SURVIVABILITY, XE_LOG_COMPONENT_SURVIVABILITY,
>>              xe_log_location(xe),
>>              &survivability->boot_status, sizeof(survivability->boot_status),
> cool, but isn't this already printed in log_survivability_info() ?
it's not print both, either it print log_survivability_info() (based on 
condition and return) or enable_boot_survivability_mode.
>
>>              "In Survivability Boot Mode\n");
> btw, as we use SURVIVABILITY component, the dmesg will already
> have "SURVIVABILITY: " decoration, so maybe this msg should be:
>
> 	"Boot mode enabled!\n"
>
> with dmesg:
>
> 	<3> [drm] ERROR SIGID=103 FATAL (04) SURVIVABILITY: Boot mode enabled!
> or
> 	<6> [drm] SIGID=103 SURVIVABILITY: Boot mode enabled!
Agreed!
>
>>>   	return 0;
>>>   
>>>   err:
>>> -	dev_err(dev, "Failed to enable Survivability Mode\n");
>>> +	xe_log_err_fatal(xe, SURVIVABILITY, ret, "Failed to enable Survivability Mode\n");
> and here:
>
> 	"Failed to enter Boot mode!\n"
>
> with dmesg:
>
> 	<3> [drm] ERROR SIGID=103 FATAL (-ENOMEM) SURVIVABILITY: Failed to enter Boot mode!
>
Make sense.
>>>   	survivability->mode = false;
>>>   	return ret;
>>>   }
>>> @@ -412,7 +413,7 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
>>>   	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
>>>   
>>>   	if (!IS_DGFX(xe) || IS_SRIOV_VF(xe) || xe->info.platform < XE_BATTLEMAGE) {
>>> -		dev_err(&pdev->dev, "Runtime Survivability Mode not supported\n");
>>> +		xe_log_info(xe, SURVIVABILITY, "Runtime Mode not supported!\n");
>> We can add xe_log_err(xe, SURVIVABILITY, -EOPNOTSUPP, ...);
> hmm, actually I was wondering if this dev_err() was correct
> maybe it should be just xe_dbg() as we are not doing anything
> related to SURVIVABILITY ?

That function is called in runtime survivability, so debugger will get 
the context easily and figure it out

what cause it.

>
>>>   		return;
>>>   	}
>>>   
>>> @@ -422,11 +423,14 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
>>>   		dev_err(&pdev->dev, "Failed to create survivability sysfs\n");
>> need to use xe_log_err(xe, SURVIVABILITY. -EIO, ... );
>>>   
>>>   	survivability->type = XE_SURVIVABILITY_TYPE_RUNTIME;
>>> -	dev_err(&pdev->dev, "Runtime Survivability mode enabled\n");
>>> +	xe_log_err_fatal(xe, SURVIVABILITY, 0, "Runtime Mode enabled!\n");
>> hmm, Logging error as fatal, however passing err=0 (Success). is it right? or simply we can log as xe_log_err or xe_log_info ? any thoughts.
Already I checked with Arch team, better to provide as xe_log_info 
rather than fatal. Just indicate to user it's Runtime survivability mode 
in such case.
> passing 0 instead of errno to xe_log_err() helpers will just omit
> printing anything in ( ), no %pe nor %phN
>
> whether this should be info/fatal/recoverable it's not me to answer
> your initial documentation [1] was saying that all XE_SIG_SURVIVABILITY
> should have CPER_SEV_FATAL
>
> [1]https://patchwork.freedesktop.org/patch/732271/?series=168333&rev=1
>
>>>   
>>>   	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_VENDOR);
>>>   	xe_device_declare_wedged(xe);
>>> -	dev_err(&pdev->dev, "Firmware flash required, Please refer to the userspace documentation for more details!\n");
>>> +
>>> +	xe_log_err_fatal(xe, SURVIVABILITY, 0, "Firmware flash required!\n");
>> ditto
> ditto ;)
ditto ;)
>>> +	xe_info(xe, "Please refer to the userspace documentation for more details how to flash the firmware on %s!\n",
>>> +		xe->info.platform_name);
>>>   }
>>>   
>>>   /**

[-- Attachment #2: Type: text/html, Size: 11877 bytes --]

  reply	other threads:[~2026-08-12  4:47 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 15:20 [PATCH v3 00/23] drm/xe: Add structured SIGID error logging infrastructure Michal Wajdeczko
2026-07-30 15:20 ` [PATCH v3 02/23] drm/xe/log: " Michal Wajdeczko
2026-08-04 15:00   ` Tauro, Riana
2026-08-04 18:52     ` Rodrigo Vivi
2026-08-05 17:23       ` Michal Wajdeczko
2026-08-05 18:58         ` Rodrigo Vivi
2026-08-04 21:21   ` Summers, Stuart
2026-08-04 21:22     ` Summers, Stuart
2026-08-05  1:39       ` Rodrigo Vivi
2026-08-05  1:36     ` Rodrigo Vivi
2026-08-05 22:24       ` Summers, Stuart
2026-08-06 11:31         ` Michal Wajdeczko
2026-08-06 19:10           ` Summers, Stuart
2026-08-06 19:46             ` Rodrigo Vivi
2026-08-07 12:31   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 05/23] drm/xe/log: Add SIGID log helpers for severity Michal Wajdeczko
2026-08-03  8:23   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 06/23] drm/xe/log: Add SIGID log helpers for location Michal Wajdeczko
2026-08-03  8:50   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 07/23] drm/xe/log: Add SIGID log helpers for location & severity Michal Wajdeczko
2026-08-03  8:58   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 08/23] drm/xe/log: Add SIGID log helpers for components Michal Wajdeczko
2026-08-03 12:42   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 09/23] drm/xe/log: Add SIGID log helpers for errno-only Michal Wajdeczko
2026-08-04  4:56   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 10/23] drm/xe/log: Add hardware error signatures Michal Wajdeczko
2026-07-31 11:41   ` Mallesh, Koujalagi
2026-08-04 15:56     ` Michal Wajdeczko
2026-08-12  7:00       ` Tauro, Riana
2026-08-12  8:24         ` Michal Wajdeczko
2026-07-30 15:21 ` [PATCH v3 12/23] drm/xe/ras: Check RAS and LOG component definitions Michal Wajdeczko
2026-08-10 11:31   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 13/23] drm/xe/kunit: Setup driver data in the test device Michal Wajdeczko
2026-08-11 14:25   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 14/23] drm/xe/tests: Add Kunit tests for xe_log Michal Wajdeczko
2026-07-30 15:21 ` [PATCH v3 16/23] drm/xe: Report 'probe blocked' error using SIGID Michal Wajdeczko
2026-08-11  9:11   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 17/23] drm/xe: Report 'device wedged' errors " Michal Wajdeczko
2026-08-07  9:56   ` Mallesh, Koujalagi
2026-08-07 10:24     ` Michal Wajdeczko
2026-08-12  0:32       ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 18/23] drm/xe: Report 'Survivability Mode' " Michal Wajdeczko
2026-08-07 11:18   ` Mallesh, Koujalagi
2026-08-07 12:14     ` Michal Wajdeczko
2026-08-12  4:47       ` Mallesh, Koujalagi [this message]
2026-07-30 15:21 ` [PATCH v3 20/23] drm/xe/pcode: Report 'Mailbox failed' error " Michal Wajdeczko
2026-08-11  9:54   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 22/23] drm/xe/gt: Report 'pagefault' errors " Michal Wajdeczko
2026-08-12  6:40   ` Mallesh, Koujalagi
2026-07-30 15:21 ` [PATCH v3 23/23] drm/xe/pci: Report 'cannot re-enable' error " Michal Wajdeczko
2026-08-12  6:58   ` Mallesh, Koujalagi
2026-07-30 15:40 ` ✗ CI.checkpatch: warning for drm/xe: Add structured SIGID error logging infrastructure (rev3) Patchwork
2026-07-30 15:41 ` ✓ CI.KUnit: success " Patchwork
2026-07-30 16:17 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-04 16:00   ` Michal Wajdeczko
2026-07-30 18:31 ` ✗ Xe.CI.FULL: " Patchwork
2026-08-04 16:05   ` Michal Wajdeczko
     [not found] ` <20260730152121.576-4-michal.wajdeczko@intel.com>
2026-08-03  8:00   ` [PATCH v3 03/23] drm/xe/log: Introduce structured component/location identifiers Mallesh, Koujalagi
2026-08-04 15:19     ` Michal Wajdeczko
2026-08-12  0:09       ` Mallesh, Koujalagi
     [not found] ` <20260730152121.576-12-michal.wajdeczko@intel.com>
2026-08-04  6:05   ` [PATCH v3 11/23] drm/xe/log: Extend components list with hardware items Mallesh, Koujalagi
2026-08-12  6:55     ` Tauro, Riana
     [not found] ` <20260730152121.576-22-michal.wajdeczko@intel.com>
2026-08-12  6:31   ` [PATCH v3 21/23] drm/xe/gt: Report 'reset failed' errors using SIGID Mallesh, Koujalagi

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=1f767000-73da-4075-8577-374ddf1cf9fa@intel.com \
    --to=mallesh.koujalagi@intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=stuart.summers@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.