diff mbox series

drm/i915/gt: perform uc late init after probe error injection

Message ID 20230314151920.1065847-1-andrzej.hajda@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/gt: perform uc late init after probe error injection | expand

Commit Message

Andrzej Hajda March 14, 2023, 3:19 p.m. UTC
Probe pseudo errors should be injected only in places where real errors
can be encountered, otherwise unwinding code can be broken.
Placing intel_uc_init_late before i915_inject_probe_error violated
this rule, resulting in following bug:
__intel_gt_disable:655 GEM_BUG_ON(intel_gt_pm_is_awake(gt))

Fixes: 481d458caede ("drm/i915/guc: Add golden context to GuC ADS")
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andi Shyti March 14, 2023, 3:33 p.m. UTC | #1
On Tue, Mar 14, 2023 at 04:19:20PM +0100, Andrzej Hajda wrote:
> Probe pseudo errors should be injected only in places where real errors
> can be encountered, otherwise unwinding code can be broken.
> Placing intel_uc_init_late before i915_inject_probe_error violated
> this rule, resulting in following bug:
> __intel_gt_disable:655 GEM_BUG_ON(intel_gt_pm_is_awake(gt))
> 
> Fixes: 481d458caede ("drm/i915/guc: Add golden context to GuC ADS")
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Andi
Nirmoy Das March 15, 2023, 10:05 a.m. UTC | #2
On 3/14/2023 4:19 PM, Andrzej Hajda wrote:
> Probe pseudo errors should be injected only in places where real errors
> can be encountered, otherwise unwinding code can be broken.
> Placing intel_uc_init_late before i915_inject_probe_error violated
> this rule, resulting in following bug:
> __intel_gt_disable:655 GEM_BUG_ON(intel_gt_pm_is_awake(gt))
>
> Fixes: 481d458caede ("drm/i915/guc: Add golden context to GuC ADS")
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 6ca944d01eb677..38c62e4ad3eba2 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -736,12 +736,12 @@ int intel_gt_init(struct intel_gt *gt)
>   	if (err)
>   		goto err_gt;
>   
> -	intel_uc_init_late(&gt->uc);
> -
>   	err = i915_inject_probe_error(gt->i915, -EIO);
>   	if (err)
>   		goto err_gt;
>   
> +	intel_uc_init_late(&gt->uc);
> +
>   	intel_migrate_init(&gt->migrate, gt);
>   
>   	goto out_fw;
Andrzej Hajda March 17, 2023, 9:15 a.m. UTC | #3
On 15.03.2023 11:05, Das, Nirmoy wrote:
> 
> On 3/14/2023 4:19 PM, Andrzej Hajda wrote:
>> Probe pseudo errors should be injected only in places where real errors
>> can be encountered, otherwise unwinding code can be broken.
>> Placing intel_uc_init_late before i915_inject_probe_error violated
>> this rule, resulting in following bug:
>> __intel_gt_disable:655 GEM_BUG_ON(intel_gt_pm_is_awake(gt))
>>
>> Fixes: 481d458caede ("drm/i915/guc: Add golden context to GuC ADS")
>> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> Acked-by: Nirmoy Das <nirmoy.das@intel.com>

Thx Nirmoy and Andi, pushed.

Regards
Andrzej

>> ---
>>   drivers/gpu/drm/i915/gt/intel_gt.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c 
>> b/drivers/gpu/drm/i915/gt/intel_gt.c
>> index 6ca944d01eb677..38c62e4ad3eba2 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
>> @@ -736,12 +736,12 @@ int intel_gt_init(struct intel_gt *gt)
>>       if (err)
>>           goto err_gt;
>> -    intel_uc_init_late(&gt->uc);
>> -
>>       err = i915_inject_probe_error(gt->i915, -EIO);
>>       if (err)
>>           goto err_gt;
>> +    intel_uc_init_late(&gt->uc);
>> +
>>       intel_migrate_init(&gt->migrate, gt);
>>       goto out_fw;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 6ca944d01eb677..38c62e4ad3eba2 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -736,12 +736,12 @@  int intel_gt_init(struct intel_gt *gt)
 	if (err)
 		goto err_gt;
 
-	intel_uc_init_late(&gt->uc);
-
 	err = i915_inject_probe_error(gt->i915, -EIO);
 	if (err)
 		goto err_gt;
 
+	intel_uc_init_late(&gt->uc);
+
 	intel_migrate_init(&gt->migrate, gt);
 
 	goto out_fw;