diff mbox series

[02/29] drm/i915/guc: Replace WARN with a DRM_ERROR

Message ID 20190408091728.20207-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [01/29] drm/i915: Mark up ips for RCU protection | expand

Commit Message

Chris Wilson April 8, 2019, 9:17 a.m. UTC
Replace the WARN with a simple if() + error message to squech the sparse
warning that entire wait_for() macro was being stringified:

drivers/gpu/drm/i915/intel_guc_submission.c:658:9: error: too long token expansion

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_guc_submission.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Tvrtko Ursulin April 8, 2019, 2:26 p.m. UTC | #1
On 08/04/2019 10:17, Chris Wilson wrote:
> Replace the WARN with a simple if() + error message to squech the sparse
> warning that entire wait_for() macro was being stringified:
> 
> drivers/gpu/drm/i915/intel_guc_submission.c:658:9: error: too long token expansion
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_guc_submission.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
> index c58922226d47..42fcd622d7a3 100644
> --- a/drivers/gpu/drm/i915/intel_guc_submission.c
> +++ b/drivers/gpu/drm/i915/intel_guc_submission.c
> @@ -650,9 +650,10 @@ static void wait_for_guc_preempt_report(struct intel_engine_cs *engine)
>   	struct guc_ctx_report *report =
>   		&data->preempt_ctx_report[engine->guc_id];
>   
> -	WARN_ON(wait_for_atomic(report->report_return_status ==
> -				INTEL_GUC_REPORT_STATUS_COMPLETE,
> -				GUC_PREEMPT_POSTPROCESS_DELAY_MS));
> +	if (wait_for_atomic(report->report_return_status ==
> +			    INTEL_GUC_REPORT_STATUS_COMPLETE,
> +			    GUC_PREEMPT_POSTPROCESS_DELAY_MS))
> +		DRM_ERROR("Timed out waiting for GuC preemption report\n");
>   	/*
>   	 * GuC is expecting that we're also going to clear the affected context
>   	 * counter, let's also reset the return status to not depend on GuC
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
index c58922226d47..42fcd622d7a3 100644
--- a/drivers/gpu/drm/i915/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/intel_guc_submission.c
@@ -650,9 +650,10 @@  static void wait_for_guc_preempt_report(struct intel_engine_cs *engine)
 	struct guc_ctx_report *report =
 		&data->preempt_ctx_report[engine->guc_id];
 
-	WARN_ON(wait_for_atomic(report->report_return_status ==
-				INTEL_GUC_REPORT_STATUS_COMPLETE,
-				GUC_PREEMPT_POSTPROCESS_DELAY_MS));
+	if (wait_for_atomic(report->report_return_status ==
+			    INTEL_GUC_REPORT_STATUS_COMPLETE,
+			    GUC_PREEMPT_POSTPROCESS_DELAY_MS))
+		DRM_ERROR("Timed out waiting for GuC preemption report\n");
 	/*
 	 * GuC is expecting that we're also going to clear the affected context
 	 * counter, let's also reset the return status to not depend on GuC