Re: [PATCH v7 5/6] drm/i915/guc: Check the locking status of GuC WOPCM registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Jackie Li (2018-01-19 01:29:31)
> GuC WOPCM registers are write-once registers. Current driver code
> accesses these registers without checking the accessibility to these
> registers, this will lead unpredictable driver behaviors if these
> registers were touch by other components (such as faulty BIOS code).
> 
> This patch moves the GuC WOPCM register updating operations into
> intel_guc_wopcm.c and adds checks before and after the write to GuC
> WOPCM registers to make sure the driver is in a known state before
> and after writing to these write-once registers.
> 
> v6:
>  - Made sure module reloading won't bug the kernel while doing
>    locking status checking
> 
> v7:
>  - Fixed patch format issues
> 
> Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Signed-off-by: Jackie Li <yaodong.li@xxxxxxxxx>
> ---
> +static inline bool __reg_locked(struct drm_i915_private *dev_priv,
> +                               i915_reg_t reg)
> +{
> +       return !!(I915_READ(reg) & GUC_WOPCM_REG_LOCKED);

Why the double cast to bool?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux