Re: [PATCH v4 22/32] drm/xe/survivability: Report 'Boot Mode enabled' status using SIGID

"Tauro, Riana" <[email protected]>
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
On 13-08-2026 16:31, Michal Wajdeczko wrote:
>
> On 8/13/2026 12:52 PM, Mallesh, Koujalagi wrote:
>> On 13-08-2026 12:44 am, Michal Wajdeczko wrote:
>>> Report 'Boot Mode' status or failure using various xe_log() helpers.
>>>
>>> Signed-off-by: Michal Wajdeczko <[email protected]>
>>> Cc: Rodrigo Vivi <[email protected]>
>>> Cc: Riana Tauro <[email protected]>
>>> Cc: Aravind Iddamsetty <[email protected]>
>>> Cc: Mallesh Koujalagi <[email protected]>
>>> ---
>>>    drivers/gpu/drm/xe/xe_survivability_mode.c | 21 +++++++++++++--------
>>>    1 file changed, 13 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> index 2d8c532157fd..ebd288986c11 100644
>>> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
>>> @@ -304,14 +304,13 @@ 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;
>>> +    int ret;
>>>          ret = create_survivability_sysfs(pdev);
>>>        if (ret)
>>> -        return ret;
>>> +        goto failed;
>>>          /* Make sure xe_heci_gsc_init() and xe_i2c_probe() are aware of survivability */
>>>        survivability->mode = true;
>>> @@ -323,19 +322,25 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev)
>>>        if (survivability->fdo_mode) {
>>>            ret = xe_nvm_init(xe);
>>>            if (ret)
>>> -            goto err;
>>> +            goto failed;
>>>        }
>>>          ret = xe_i2c_probe(xe);
>>>        if (ret)
>>> -        goto err;
>>> +        goto failed;
>>>    -    dev_err(dev, "In Survivability Mode\n");
>>> +    if (check_boot_failure(xe))
>>> +        xe_log_comp_fatal(pdev, SURVIVABILITY,
>>> +                  &survivability->boot_status,
>>> +                  sizeof(survivability->boot_status),
>>> +                  "Boot Mode enabled!\n");
Do we need this check? This function is only called if it is a boot failure.

We can have a error log with the type here. We don't need if else.

How about something like this? and remove else


<3> xe 0000:03:00.0: [drm] *ERROR* SIGID=<N> FATAL (01000000) 
SURVIVABILITY: mode=Boot
>> In case of fatal, will make sense to return "0" OR we can add return as -ENXIO right? any thoughts?

Mallesh, you cannot change return codes here. This defeats the purpose 
of survivability mode

> you're a reviewer here ;)
>
> but seriously, enable_boot_survivability_mode() is called from
> xe_survivability_mode_boot_enable() which says:
>
>   * Return: 0 if boot survivability mode is enabled or not requested, negative error
>   * code otherwise.
>
> so returning 0 as success code in enabling boot mode is the correct one
> returning -ENXIO will be no different than failing to enter boot mode
>
> @Riana, this is your code, can you please confirm that
>
>> After handling fatal case
>>
>> Reviewed-by: Mallesh Koujalagi <[email protected]>
>>
>>> +    else
>>> +        xe_log_info(pdev, SURVIVABILITY, "Boot Mode enabled!\n");
>>>          return 0;
>>>    -err:
>>> -    dev_err(dev, "Failed to enable Survivability Mode\n");
>>> +failed:
>>> +    xe_log_err_fatal(pdev, SURVIVABILITY, ret, "Failed to enable Boot Mode!\n");

Can we retain the previous dmesg?

Thanks
Riana

>>>        survivability->mode = false;
>>>        return ret;
>>>    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.