[PATCH 4/4] drm/i915/guc: Inject probe errors for CT send

Michal Wajdeczko michal.wajdeczko at intel.com
Tue Oct 12 15:12:45 UTC 2021



On 11.10.2021 20:00, Matthew Brost wrote:
> On Mon, Oct 11, 2021 at 08:51:06PM +0530, Thanneeru Srinivasulu wrote:
>> Inject probe errors -ENXIO, -EBUSY for CT send.
>>
>> Signed-off-by: Thanneeru Srinivasulu <thanneeru.srinivasulu at intel.com>
>> ---
>>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
>> index 83764db0fd6d..8ffef3abd3da 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
>> @@ -765,6 +765,14 @@ int intel_guc_ct_send(struct intel_guc_ct *ct, const u32 *action, u32 len,
>>  	u32 status = ~0; /* undefined */
>>  	int ret;
>>  
>> +	ret = i915_inject_probe_error(ct_to_i915(ct), -ENXIO);
>> +	if (ret)
>> +		return ret;
>> +
> 
> I don't see where -ENXIO is returned during an error that we handle
> unless I am missing something. If we don't return -ENXIO anywhere else I
> don't think we need to inject this error.

but the point of this exercise is not to handle such error but to
gracefully abort probe without panic or leaks. note that we are already
using -ENXIO in many other injected failure points (mostly in uc code)

thus for me above change is also fine and the whole series is:

Reviewed-by: Michal Wajdeczko <michal.wajdeczko at intel.com>

-Michal

> 
> Matt 
> 
>> +	ret = i915_inject_probe_error(ct_to_i915(ct), -EBUSY);
>> +	if (ret)
>> +		return ret;
>> +
>>  	if (unlikely(!ct->enabled)) {
>>  		struct intel_guc *guc = ct_to_guc(ct);
>>  		struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
>> -- 
>> 2.25.1
>>


More information about the dri-devel mailing list