[Intel-gfx] [bug report] drm/i915/uc: prefer intel_gt over i915 in GuC/HuC paths

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Tue Jul 23 15:08:49 UTC 2019



On 7/23/2019 8:00 AM, Dan Carpenter wrote:
> Hello Daniele Ceraolo Spurio,
>
> The patch 84b1ca2f0e68: "drm/i915/uc: prefer intel_gt over i915 in
> GuC/HuC paths" from Jul 13, 2019, leads to the following static
> checker warning:
>
> 	drivers/gpu/drm/i915/gt/uc/intel_huc.c:173 intel_huc_check_status()
> 	warn: masking a bool
>
> drivers/gpu/drm/i915/gt/uc/intel_huc.c
>     161  int intel_huc_check_status(struct intel_huc *huc)
>     162  {
>     163          struct intel_gt *gt = huc_to_gt(huc);
>     164          intel_wakeref_t wakeref;
>     165          bool status = false;
>                  ^^^^^^^^^^^^^^^^^^^
>     166
>     167          if (!intel_uc_is_using_huc(&gt->uc))
>     168                  return -ENODEV;
>     169
>     170          with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
>     171                  status = intel_uncore_read(gt->uncore, huc->status.reg);
>     172
>     173          return (status & huc->status.mask) == huc->status.value;
>                          ^^^^^^
>
> It definitely looks like status should be a u32 or something.

Yes, definitely wrong. Will send a fix soon.
This highlights even more the lack of testing we have around HuC.

Daniele

>     174  }
>
> regards,
> dan carpenter



More information about the Intel-gfx mailing list