[PATCH v8 1/4] drm: Introduce device wedged event

Jani Nikula jani.nikula at linux.intel.com
Mon Oct 28 08:50:02 UTC 2024


On Fri, 25 Oct 2024, Jani Nikula <jani.nikula at linux.intel.com> wrote:
> On Fri, 25 Oct 2024, Raag Jadav <raag.jadav at intel.com> wrote:
>> @@ -70,6 +73,16 @@ static struct dentry *drm_debugfs_root;
>>  
>>  DEFINE_STATIC_SRCU(drm_unplug_srcu);
>>  
>> +/*
>> + * Available recovery methods for wedged device. To be sent along with device
>> + * wedged uevent.
>> + */
>> +static const char *const drm_wedge_recovery_opts[] = {
>> +	[ffs(DRM_WEDGE_RECOVERY_REBIND) - 1]	= "rebind",
>> +	[ffs(DRM_WEDGE_RECOVERY_BUS_RESET) - 1]	= "bus-reset",
>> +};
>> +static_assert(ARRAY_SIZE(drm_wedge_recovery_opts) == ffs(DRM_WEDGE_RECOVERY_BUS_RESET));
>
> This might work in most cases, but you also might end up finding that
> there's an arch and compiler combo out there that just won't be able to
> figure out ffs() at compile time, and the array initialization fails.

And the kernel test robot hits exactly this.

BR,
Jani.


-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list