[PATCH v2 01/23] drm/xe: Error handling in xe_force_wake_get()

Jani Nikula jani.nikula at linux.intel.com
Wed Sep 18 14:50:00 UTC 2024


On Wed, 18 Sep 2024, Jani Nikula <jani.nikula at linux.intel.com> wrote:
> If you end up replicating intel_wakeref_t from i915, and go as deep as
> the rabbit hole goes, you'll realize intel_wakeref_t is a pointer
> disguised as an unsigned long. It's a struct ref_tracker * when you have
> certain configs enabled.
>
> You could just use struct ref_tracker * everywhere. It's an opaque type
> to start with.

Inspired by this discussion, I converted i915

 -typedef unsigned long intel_wakeref_t;
 +typedef struct ref_tracker *intel_wakeref_t;

and it promptly found a number of issues [1]. Maybe the typedef around
an integral type isn't the hottest idea. Though I'm not suggesting to
use a typedef for the pointer either, it's just that i915 has
intel_wakeref_t littered absolutely everywhere.

BR,
Jani.

[1] https://lore.kernel.org/r/cover.1726658138.git.jani.nikula@intel.com

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list