diff mbox

drm/i915/guc: Skip cleaning up the doorbells on error-before-allocate

Message ID 20180712105830.20390-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 12, 2018, 10:58 a.m. UTC
If we fail the module load, we may try and cleanup before we even
allocate the GuC clients. KISS in order to try and re-enable
drv_module_reload for BAT.

Testcase: igt/drv_module_reload/basic-reload-inject
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_submission.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Michał Winiarski July 12, 2018, 1:12 p.m. UTC | #1
On Thu, Jul 12, 2018 at 11:58:30AM +0100, Chris Wilson wrote:
> If we fail the module load, we may try and cleanup before we even
> allocate the GuC clients. KISS in order to try and re-enable
> drv_module_reload for BAT.
> 
> Testcase: igt/drv_module_reload/basic-reload-inject
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

We want to fix the cleanup paths eventually though.

-Michał

> ---
>  drivers/gpu/drm/i915/intel_guc_submission.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
> index 3952656f4c9a..cd51be8ff025 100644
> --- a/drivers/gpu/drm/i915/intel_guc_submission.c
> +++ b/drivers/gpu/drm/i915/intel_guc_submission.c
> @@ -910,8 +910,12 @@ static void guc_clients_doorbell_fini(struct intel_guc *guc)
>  		__update_doorbell_desc(guc->preempt_client,
>  				       GUC_DOORBELL_INVALID);
>  	}
> -	__destroy_doorbell(guc->execbuf_client);
> -	__update_doorbell_desc(guc->execbuf_client, GUC_DOORBELL_INVALID);
> +
> +	if (guc->execbuf_client) {
> +		__destroy_doorbell(guc->execbuf_client);
> +		__update_doorbell_desc(guc->execbuf_client,
> +				       GUC_DOORBELL_INVALID);
> +	}
>  }
>  
>  /**
> -- 
> 2.18.0
>
Chris Wilson July 12, 2018, 2:34 p.m. UTC | #2
Quoting Michał Winiarski (2018-07-12 14:12:48)
> On Thu, Jul 12, 2018 at 11:58:30AM +0100, Chris Wilson wrote:
> > If we fail the module load, we may try and cleanup before we even
> > allocate the GuC clients. KISS in order to try and re-enable
> > drv_module_reload for BAT.
> > 
> > Testcase: igt/drv_module_reload/basic-reload-inject
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Michał Winiarski <michal.winiarski@intel.com>
> > Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> 
> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
> 
> We want to fix the cleanup paths eventually though.

Yes, this is just band aid so we can reenable the test to be sure we
don't break the module unload as we do so.

Pushed along with the other simple cleanups for drv_module_reload,
thanks for the review.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
index 3952656f4c9a..cd51be8ff025 100644
--- a/drivers/gpu/drm/i915/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/intel_guc_submission.c
@@ -910,8 +910,12 @@  static void guc_clients_doorbell_fini(struct intel_guc *guc)
 		__update_doorbell_desc(guc->preempt_client,
 				       GUC_DOORBELL_INVALID);
 	}
-	__destroy_doorbell(guc->execbuf_client);
-	__update_doorbell_desc(guc->execbuf_client, GUC_DOORBELL_INVALID);
+
+	if (guc->execbuf_client) {
+		__destroy_doorbell(guc->execbuf_client);
+		__update_doorbell_desc(guc->execbuf_client,
+				       GUC_DOORBELL_INVALID);
+	}
 }
 
 /**