[Intel-gfx] [PATCH] drm/i915: make CSR firmware messages less verbose

Chris Wilson chris at chris-wilson.co.uk
Sat Sep 12 00:58:35 PDT 2015


On Fri, Sep 11, 2015 at 09:49:32AM -0700, Jesse Barnes wrote:
> On 09/11/2015 01:29 AM, Chris Wilson wrote:
> > On Thu, Sep 10, 2015 at 08:20:28AM -0700, Jesse Barnes wrote:
> >> Use WARN_ONCE in a bunch of places and demote a message that would
> >> continually spam us.
> >>
> >> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> >> ---
> >>  drivers/gpu/drm/i915/intel_csr.c        | 12 +++++------
> >>  drivers/gpu/drm/i915/intel_runtime_pm.c | 36 ++++++++++++++++-----------------
> >>  2 files changed, 24 insertions(+), 24 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> >> index ba1ae03..765dfcd 100644
> >> --- a/drivers/gpu/drm/i915/intel_csr.c
> >> +++ b/drivers/gpu/drm/i915/intel_csr.c
> >> @@ -454,10 +454,10 @@ void intel_csr_ucode_fini(struct drm_device *dev)
> >>  
> >>  void assert_csr_loaded(struct drm_i915_private *dev_priv)
> >>  {
> >> -	WARN(intel_csr_load_status_get(dev_priv) != FW_LOADED,
> >> -	     "CSR is not loaded.\n");
> >> -	WARN(!I915_READ(CSR_PROGRAM_BASE),
> >> -				"CSR program storage start is NULL\n");
> >> -	WARN(!I915_READ(CSR_SSP_BASE), "CSR SSP Base Not fine\n");
> >> -	WARN(!I915_READ(CSR_HTP_SKL), "CSR HTP Not fine\n");
> >> +	WARN_ONCE(intel_csr_load_status_get(dev_priv) != FW_LOADED,
> >> +		  "CSR is not loaded.\n");
> >> +	WARN_ONCE(!I915_READ(CSR_PROGRAM_BASE),
> >> +		  "CSR program storage start is NULL\n");
> >> +	WARN_ONCE(!I915_READ(CSR_SSP_BASE), "CSR SSP Base Not fine\n");
> >> +	WARN_ONCE(!I915_READ(CSR_HTP_SKL), "CSR HTP Not fine\n");
> > 
> > But why more than one warn in the function? If more than one fire,
> > trying to get the information about what happened is a nightmare.
> > 
> > static int assert_once;
> > if (assert_once)
> >   return;
> > 
> > assert_once |= DRM_ERROR_ON(cond, "message");
> > ...
> > if (assert_once)
> >     WARN("CSR not loaded");
> 
> I'm ok with getting fancier too, as long as the warnings only happen
> one.  How about an ack or r-b on this one and/or a patch to make the
> code more sensible?

Once x 10 is better than ad infinitum x 10, so
Acked-by: Chris Wilson <chris at chris-wilson.co.uk>

Just muttering that we took a serious mistep with the WARNs and forgot
to ask ourselves if adding more makes a problem easier to debug
postmortem or harder. I think we have erred on the latter.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list