From: Yaodong Li Subject: Re: [PATCH v12 5/6] drm/i915/guc: Check the locking status of GuC WOPCM registers Date: Tue, 13 Mar 2018 09:35:42 -0700 Message-ID: <01965110-2f73-e23e-c466-f229da21fbf0@intel.com> References: <1519949806-1138-1-git-send-email-yaodong.li@intel.com> <1519949806-1138-5-git-send-email-yaodong.li@intel.com> <466b9074-2716-f3e8-161a-95b9ca03a06a@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0626164029==" Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EBCA6E5A2 for ; Tue, 13 Mar 2018 16:37:35 +0000 (UTC) In-Reply-To: <466b9074-2716-f3e8-161a-95b9ca03a06a@intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Joonas Lahtinen , "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============0626164029== Content-Type: multipart/alternative; boundary="------------9E824E24DAC71230F52A039F" Content-Language: en-US This is a multi-part message in MIME format. --------------9E824E24DAC71230F52A039F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Failed to receive this mail for 5/6 patch (couldn't find it in my mailbox). So pasted the comments from patchwork. > Quoting Jackie Li (2018-03-02 02:16:45) > > +++ b/drivers/gpu/drm/i915/intel_wopcm.c > > @@ -219,3 +219,67 @@ int intel_wopcm_init(struct intel_wopcm *wopcm) > > > > return 0; > > } > > + > > +static inline int write_and_verify(struct drm_i915_private *dev_priv, > > + i915_reg_t reg, u32 val, u32 mask, > > + u32 locked_bit) > > +{ > > + u32 reg_val; > > + > > + GEM_BUG_ON(val & ~mask); > > + > > + I915_WRITE(reg, val); > > + > > + reg_val = I915_READ(reg); > > I guess I would have expected the error message here, with the wanted > value vs. what was in the register. > > > > +err_out: > > + DRM_ERROR("Failed to init WOPCM registers:\n"); > > + DRM_ERROR("DMA_GUC_WOPCM_OFFSET=%#x\n", > > + I915_READ(DMA_GUC_WOPCM_OFFSET)); > > + DRM_ERROR("GUC_WOPCM_SIZE=%#x\n", I915_READ(GUC_WOPCM_SIZE)); > > As this doesn't really give information what were the computed write > values. But if you see this is most useful for debuggin, this is; Thanks for the comments! This is for debugging. and the consideration was to print both the offset and size register values for any reg update errors,  the calculated values were printed as debug messages during wopcm partitioning (wopcm_init) Regards, -Jackie > Reviewed-by: Joonas Lahtinen --------------9E824E24DAC71230F52A039F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Failed to receive this mail for 5/6 patch (couldn't find it in my mailbox).
So pasted the comments from patchwork.
Quoting Jackie Li (2018-03-02 02:16:45)
> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
> @@ -219,3 +219,67 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
>  
>         return 0;
>  }
> +
> +static inline int write_and_verify(struct drm_i915_private *dev_priv,
> +                                  i915_reg_t reg, u32 val, u32 mask,
> +                                  u32 locked_bit)
> +{
> +       u32 reg_val;
> +
> +       GEM_BUG_ON(val & ~mask);
> +
> +       I915_WRITE(reg, val);
> +
> +       reg_val = I915_READ(reg);

I guess I would have expected the error message here, with the wanted
value vs. what was in the register.

<SNIP>

> +err_out:
> +       DRM_ERROR("Failed to init WOPCM registers:\n");
> +       DRM_ERROR("DMA_GUC_WOPCM_OFFSET=%#x\n",
> +                 I915_READ(DMA_GUC_WOPCM_OFFSET));
> +       DRM_ERROR("GUC_WOPCM_SIZE=%#x\n", I915_READ(GUC_WOPCM_SIZE));

As this doesn't really give information what were the computed write
values. But if you see this is most useful for debuggin, this is;
Thanks for the comments!

This is for debugging. and the consideration was to print both the
offset and size register values for any reg update errors,  the
calculated values were printed as debug messages during wopcm
partitioning (wopcm_init)

Regards,
-Jackie
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>


--------------9E824E24DAC71230F52A039F-- --===============0626164029== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0626164029==--