[Intel-gfx] [PATCH v2] drm/i915: Add Guc/HuC firmware details to error state
Chris Wilson
chris at chris-wilson.co.uk
Thu Oct 19 19:27:14 UTC 2017
Quoting Michal Wajdeczko (2017-10-19 20:02:57)
> +static void i915_capture_uc_state(struct drm_i915_private *dev_priv,
> + struct i915_gpu_state *error)
> +{
> + error->guc_fw = dev_priv->guc.fw;
> + error->huc_fw = dev_priv->huc.fw;
> +
> + /* Make sure to capture custom firmware paths */
> + if (i915_modparams.guc_firmware_path) {
If we pretend we are not inside a stop_machine() right now...
i915_modparams may be overwritten at any point by userspace. So first of
all this perhaps should be if (error->params.guc_firmware_path) but then
what about that GEM_BUG_ON?
> + error->guc_fw.path = error->params.guc_firmware_path;
> + GEM_BUG_ON(strcmp(error->guc_fw.path, dev_priv->guc.fw.path));
> + }
Don't you just want to
error->guc_fw.path = kstrdup(dev_priv->guc.fw.path, GFP_ATOMIC)
? The goal is to take a copy of the parameters that match the firmware
at the time of the hang, which may not match the state of the modparam
at this moment in time.
-Chris
More information about the Intel-gfx
mailing list