mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 22:08:33 -04:00
drm/xe/configfs: Don't expose survivability_mode if not applicable
The survivability_mode attribute is applicable only for DGFX and platforms newer than BATTLEMAGE. Use .is_visible() hook to hide this attribute when above conditions are not met. Remove code that was trying to fix such configuration during the runtime. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Stuart Summers <stuart.summers@intel.com> Link: https://lore.kernel.org/r/20250902131744.5076-4-michal.wajdeczko@intel.com
This commit is contained in:
@@ -369,7 +369,12 @@ static bool xe_config_device_is_visible(struct config_item *item,
|
||||
{
|
||||
struct xe_config_group_device *dev = to_xe_config_group_device(item);
|
||||
|
||||
return dev->desc; /* shall be always true */
|
||||
if (attr == &attr_survivability_mode) {
|
||||
if (!dev->desc->is_dgfx || dev->desc->platform < XE_BATTLEMAGE)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct configfs_group_operations xe_config_device_group_ops = {
|
||||
@@ -558,23 +563,6 @@ bool xe_configfs_get_survivability_mode(struct pci_dev *pdev)
|
||||
return mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_configfs_clear_survivability_mode - clear configfs survivability mode
|
||||
* @pdev: pci device
|
||||
*/
|
||||
void xe_configfs_clear_survivability_mode(struct pci_dev *pdev)
|
||||
{
|
||||
struct xe_config_group_device *dev = find_xe_config_group_device(pdev);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
guard(mutex)(&dev->lock);
|
||||
dev->config.survivability_mode = 0;
|
||||
|
||||
config_group_put(&dev->group);
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_configfs_get_engines_allowed - get engine allowed mask from configfs
|
||||
* @pdev: pci device
|
||||
|
||||
@@ -15,7 +15,6 @@ 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);
|
||||
void xe_configfs_clear_survivability_mode(struct pci_dev *pdev);
|
||||
u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev);
|
||||
bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev);
|
||||
#else
|
||||
@@ -23,7 +22,6 @@ 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 void xe_configfs_clear_survivability_mode(struct pci_dev *pdev) { }
|
||||
static inline u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev) { return U64_MAX; }
|
||||
static inline bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev) { return false; }
|
||||
#endif
|
||||
|
||||
@@ -289,19 +289,10 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
|
||||
u32 data;
|
||||
bool survivability_mode;
|
||||
|
||||
if (!IS_DGFX(xe) || IS_SRIOV_VF(xe))
|
||||
if (!IS_DGFX(xe) || IS_SRIOV_VF(xe) || xe->info.platform < XE_BATTLEMAGE)
|
||||
return false;
|
||||
|
||||
survivability_mode = xe_configfs_get_survivability_mode(pdev);
|
||||
|
||||
if (xe->info.platform < XE_BATTLEMAGE) {
|
||||
if (survivability_mode) {
|
||||
dev_err(&pdev->dev, "Survivability Mode is not supported on this card\n");
|
||||
xe_configfs_clear_survivability_mode(pdev);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Enable survivability mode if set via configfs */
|
||||
if (survivability_mode)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user