Re: [PATCH 1/9] drm/xe: Rename survivability_mode to enable_survivability_mode

Gustavo Sousa
2026-05-04T13:29:51Z

Stuart Summers <stuart.summers@intel.com> writes:

> Rename the survivability_mode field in struct xe_config_device to
> enable_survivability_mode to be consistent with the enable_psmi naming
> convention used for similar boolean config flags.
>
> Signed-off-by: Stuart Summers <stuart.summers@intel.com>
> Assisted-by: Copilot:claude-opus-4.7
> ---
> drivers/gpu/drm/xe/xe_configfs.c | 39 +++++++++++-----------
> drivers/gpu/drm/xe/xe_configfs.h | 4 +--
> drivers/gpu/drm/xe/xe_survivability_mode.c | 2 +-
> 3 files changed, 23 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
> index 32102600a148..69abc69ec0f3 100644
> --- a/drivers/gpu/drm/xe/xe_configfs.c
> +++ b/drivers/gpu/drm/xe/xe_configfs.c
> @@ -58,7 +58,7 @@
> * │   └── ...
> * :
> * └── 0000:03:00.0
> - * ├── survivability_mode
> + * ├── enable_survivability_mode
> * ├── gt_types_allowed
> * ├── engines_allowed
> * └── enable_psmi
> @@ -79,7 +79,7 @@
> * Enable survivability mode on supported cards. This setting only takes
> * effect when probing the device. Example to enable it::
> *
> - * # echo 1 > /sys/kernel/config/xe/0000:03:00.0/survivability_mode
> + * # echo 1 > /sys/kernel/config/xe/0000:03:00.0/enable_survivability_mode

I think we have not documented our configfs structure in the kernel ABI
documentation. Are we supposed to do that? Is that not yet done
because we do not consider our configfs stable enough to be classified
as proper ABI?

In this example, we would be potentially changing what some would call
ABI, hence my questions above.

--
Gustavo Sousa

> *
> * This attribute can only be set before binding to the device.
> *
> @@ -260,7 +260,7 @@ struct xe_config_group_device {
> u64 engines_allowed;
> struct wa_bb ctx_restore_post_bb[XE_ENGINE_CLASS_MAX];
> struct wa_bb ctx_restore_mid_bb[XE_ENGINE_CLASS_MAX];
> - bool survivability_mode;
> + bool enable_survivability_mode;
> bool enable_psmi;
> struct {
> unsigned int max_vfs;
> @@ -279,7 +279,7 @@ struct xe_config_group_device {
> static const struct xe_config_device device_defaults = {
> .gt_types_allowed = U64_MAX,
> .engines_allowed = U64_MAX,
> - .survivability_mode = false,
> + .enable_survivability_mode = false,
> .enable_psmi = false,
> .sriov = {
> .max_vfs = XE_DEFAULT_MAX_VFS,
> @@ -357,20 +357,21 @@ static bool is_bound(struct xe_config_group_device *dev)
> return ret;
> }
>
> -static ssize_t survivability_mode_show(struct config_item *item, char *page)
> +static ssize_t enable_survivability_mode_show(struct config_item *item, char *page)
> {
> struct xe_config_device *dev = to_xe_config_device(item);
>
> - return sprintf(page, "%d\n", dev->survivability_mode);
> + return sprintf(page, "%d\n", dev->enable_survivability_mode);
> }
>
> -static ssize_t survivability_mode_store(struct config_item *item, const char *page, size_t len)
> +static ssize_t enable_survivability_mode_store(struct config_item *item, const char *page,
> + size_t len)
> {
> struct xe_config_group_device *dev = to_xe_config_group_device(item);
> - bool survivability_mode;
> + bool enable_survivability_mode;
> int ret;
>
> - ret = kstrtobool(page, &survivability_mode);
> + ret = kstrtobool(page, &enable_survivability_mode);
> if (ret)
> return ret;
>
> @@ -378,7 +379,7 @@ static ssize_t survivability_mode_store(struct config_item *item, const char *pa
> if (is_bound(dev))
> return -EBUSY;
>
> - dev->config.survivability_mode = survivability_mode;
> + dev->config.enable_survivability_mode = enable_survivability_mode;
>
> return len;
> }
> @@ -815,7 +816,7 @@ CONFIGFS_ATTR(, ctx_restore_post_bb);
> CONFIGFS_ATTR(, enable_psmi);
> CONFIGFS_ATTR(, engines_allowed);
> CONFIGFS_ATTR(, gt_types_allowed);
> -CONFIGFS_ATTR(, survivability_mode);
> +CONFIGFS_ATTR(, enable_survivability_mode);
>
> static struct configfs_attribute *xe_config_device_attrs[] = {
> &attr_ctx_restore_mid_bb,
> @@ -823,7 +824,7 @@ static struct configfs_attribute *xe_config_device_attrs[] = {
> &attr_enable_psmi,
> &attr_engines_allowed,
> &attr_gt_types_allowed,
> - &attr_survivability_mode,
> + &attr_enable_survivability_mode,
> NULL,
> };
>
> @@ -847,7 +848,7 @@ static bool xe_config_device_is_visible(struct config_item *item,
> {
> struct xe_config_group_device *dev = to_xe_config_group_device(item);
>
> - if (attr == &attr_survivability_mode) {
> + if (attr == &attr_enable_survivability_mode) {
> if (!dev->desc->is_dgfx || dev->desc->platform < XE_BATTLEMAGE)
> return false;
> }
> @@ -1098,7 +1099,7 @@ static void dump_custom_dev_config(struct pci_dev *pdev,
> PRI_CUSTOM_ATTR("%llx", gt_types_allowed);
> PRI_CUSTOM_ATTR("%llx", engines_allowed);
> PRI_CUSTOM_ATTR("%d", enable_psmi);
> - PRI_CUSTOM_ATTR("%d", survivability_mode);
> + PRI_CUSTOM_ATTR("%d", enable_survivability_mode);
> PRI_CUSTOM_ATTR("%u", sriov.admin_only_pf);
>
> #undef PRI_CUSTOM_ATTR
> @@ -1128,20 +1129,20 @@ void xe_configfs_check_device(struct pci_dev *pdev)
> }
>
> /**
> - * xe_configfs_get_survivability_mode - get configfs survivability mode attribute
> + * xe_configfs_get_enable_survivability_mode - get configfs survivability mode attribute
> * @pdev: pci device
> *
> - * Return: survivability_mode attribute in configfs
> + * Return: enable_survivability_mode attribute in configfs
> */
> -bool xe_configfs_get_survivability_mode(struct pci_dev *pdev)
> +bool xe_configfs_get_enable_survivability_mode(struct pci_dev *pdev)
> {
> struct xe_config_group_device *dev = find_xe_config_group_device(pdev);
> bool mode;
>
> if (!dev)
> - return device_defaults.survivability_mode;
> + return device_defaults.enable_survivability_mode;
>
> - mode = dev->config.survivability_mode;
> + mode = dev->config.enable_survivability_mode;
> config_group_put(&dev->group);
>
> return mode;
> diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h
> index 07d62bf0c152..517de4946d35 100644
> --- a/drivers/gpu/drm/xe/xe_configfs.h
> +++ b/drivers/gpu/drm/xe/xe_configfs.h
> @@ -18,7 +18,7 @@ struct pci_dev;
> int xe_configfs_init(void);
> void xe_configfs_exit(void);
> void xe_configfs_check_device(struct pci_dev *pdev);
> -bool xe_configfs_get_survivability_mode(struct pci_dev *pdev);
> +bool xe_configfs_get_enable_survivability_mode(struct pci_dev *pdev);
> bool xe_configfs_primary_gt_allowed(struct pci_dev *pdev);
> bool xe_configfs_media_gt_allowed(struct pci_dev *pdev);
> u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev);
> @@ -37,7 +37,7 @@ bool xe_configfs_admin_only_pf(struct pci_dev *pdev);
> static inline int xe_configfs_init(void) { return 0; }
> static inline void xe_configfs_exit(void) { }
> static inline void xe_configfs_check_device(struct pci_dev *pdev) { }
> -static inline bool xe_configfs_get_survivability_mode(struct pci_dev *pdev) { return false; }
> +static inline bool xe_configfs_get_enable_survivability_mode(struct pci_dev *pdev) { return false; }
> static inline bool xe_configfs_primary_gt_allowed(struct pci_dev *pdev) { return true; }
> static inline bool xe_configfs_media_gt_allowed(struct pci_dev *pdev) { return true; }
> static inline u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev) { return U64_MAX; }
> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
> index db64cac39c94..7c85bdb267af 100644
> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
> @@ -377,7 +377,7 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
> if (!IS_DGFX(xe) || IS_SRIOV_VF(xe) || xe->info.platform < XE_BATTLEMAGE)
> return false;
>
> - survivability_mode = xe_configfs_get_survivability_mode(pdev);
> + survivability_mode = xe_configfs_get_enable_survivability_mode(pdev);
> /* Enable survivability mode if set via configfs */
> if (survivability_mode)
> return true;
> --
> 2.43.0