Hi Nirmoy, On Tue, Apr 23, 2024 at 11:02:06AM +0200, Nirmoy Das wrote: > On 4/17/2024 12:49 AM, Andi Shyti wrote: ... > void intel_engines_driver_register(struct drm_i915_private *i915) > { > - u16 name_instance, other_instance = 0; > + u16 class_instance[I915_LAST_UABI_ENGINE_CLASS + 2] = { }; > > +2 is confusing here. I think we need a better macro. This is to avoid buffer overflow, otherwise we will always hit the GEM_BUG_ON below. > struct legacy_ring ring = {}; > struct list_head *it, *next; > struct rb_node **p, *prev; ... > + GEM_BUG_ON(uabi_class >= > + ARRAY_SIZE(i915->engine_uabi_class_count)); > + i915->engine_uabi_class_count[uabi_class]++; > > Shouldn't this be i915->engine_uabi_class_count[uabi_class] = class_instance > [uabi_class]; ? that's mostly a counter, we don't really need to be on sync with the real instance of the engines. > What I see is that this patch mainly adding this class_instance array and rest > looks the same. > May be it make sense to add other upcoming patches to better understand why we > need this patch. yes, this patch simplifies the coming patches and the logic inside, as well. I just wanted to anticipate some of the refactorings so that we could speed up the reviews. There is no functional change in here, that's why I thought it was harmless. Thanks for taking a look into it. Andi