[PATCH v2 3/3] drm/xe: Initialize mei-gsc and vsec in survivability mode

Riana Tauro riana.tauro at intel.com
Thu Jan 16 09:52:20 UTC 2025



On 1/10/2025 8:56 PM, Rodrigo Vivi wrote:
> On Wed, Jan 08, 2025 at 04:09:59PM +0530, Riana Tauro wrote:
>> Initialize mei-gsc in survivability mode and disable HECI
>> interrupts. Also initialize vsec in survivability mode
>>
>> Signed-off-by: Riana Tauro <riana.tauro at intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_heci_gsc.c           | 3 ++-
>>   drivers/gpu/drm/xe/xe_survivability_mode.c | 7 +++++++
>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c
>> index d765bfd3636b..06dc78d3a812 100644
>> --- a/drivers/gpu/drm/xe/xe_heci_gsc.c
>> +++ b/drivers/gpu/drm/xe/xe_heci_gsc.c
>> @@ -12,6 +12,7 @@
>>   #include "xe_drv.h"
>>   #include "xe_heci_gsc.h"
>>   #include "xe_platform_types.h"
>> +#include "xe_survivability_mode.h"
>>   
>>   #define GSC_BAR_LENGTH  0x00000FFC
>>   
>> @@ -200,7 +201,7 @@ void xe_heci_gsc_init(struct xe_device *xe)
>>   		return;
>>   	}
>>   
>> -	if (!def->use_polling) {
>> +	if (!def->use_polling && !xe_survivability_mode_enabled(xe)) {
> 
> perhaps this could be avoided by adding a new argument to the
> function? It gets strange that in this path we came from that component
> and we need to peek back there...
> 
> otoh I know that sometimes these calls with true/false in arguments
> can lead to confusion... and this is done really only once or twice
> during probe, so not so hard feelings here...
yeah that is the reason i used the function here. One of my previous 
patch, had got review comments against using boolean in arguments

Yeah this gets checked once during probe.

Thanks,
Riana
> 
> up to you:
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> 
>>   		ret = heci_gsc_irq_setup(xe);
>>   		if (ret)
>>   			goto fail;
>> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
>> index 4a978c7018c9..39ab898193a1 100644
>> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
>> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
>> @@ -13,8 +13,10 @@
>>   
>>   #include "xe_device.h"
>>   #include "xe_gt.h"
>> +#include "xe_heci_gsc.h"
>>   #include "xe_mmio.h"
>>   #include "xe_pcode_api.h"
>> +#include "xe_vsec.h"
>>   
>>   #define MAX_SCRATCH_MMIO 8
>>   
>> @@ -152,6 +154,10 @@ static void enable_survivability_mode(struct xe_device *xe)
>>   		drm_warn(&xe->drm, "Failed to create survivability sysfs files\n");
>>   		return;
>>   	}
>> +
>> +	xe_heci_gsc_init(xe);
>> +
>> +	xe_vsec_init(xe);
>>   }
>>   
>>   /**
>> @@ -203,6 +209,7 @@ void xe_survivability_mode_remove(struct xe_device *xe)
>>   	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
>>   
>>   	sysfs_remove_file(&xe->drm.dev->kobj, &dev_attr_survivability_mode.attr);
>> +	xe_heci_gsc_fini(xe);
>>   	kfree(survivability->info);
>>   	pci_set_drvdata(pdev, NULL);
>>   }
>> -- 
>> 2.47.1
>>



More information about the Intel-xe mailing list