[bug report] drm/xe: Introduce a new DRM driver for Intel GPUs

Dan Carpenter dan.carpenter at linaro.org
Wed Feb 19 09:29:13 UTC 2025


Hello Matthew Brost,

Commit dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel
GPUs") from Mar 30, 2023 (linux-next), leads to the following Smatch
static checker warning:

drivers/gpu/drm/xe/xe_guc.c:1241 xe_guc_suspend() warn: passing possitive error code '(-110),(-71),(-6),1-268435455' to 'ERR_PTR'
drivers/gpu/drm/i915/gt/uc/intel_guc.c:698 intel_guc_suspend() warn: passing non-max range '1-268435455' to 'ERR_PTR'

drivers/gpu/drm/xe/xe_guc.c
    1231 int xe_guc_suspend(struct xe_guc *guc)
    1232 {
    1233         struct xe_gt *gt = guc_to_gt(guc);
    1234         u32 action[] = {
    1235                 XE_GUC_ACTION_CLIENT_SOFT_RESET,
    1236         };
    1237         int ret;
    1238 
    1239         ret = xe_guc_mmio_send(guc, action, ARRAY_SIZE(action));

The xe_guc_mmio_send() function returns this:

  1388          /* Use data from the GuC response as our return value */
  1389          return FIELD_GET(GUC_HXG_RESPONSE_MSG_0_DATA0, header);

All we know about it is that it's a positive number between 0-0xfffffff.

    1240         if (ret) {
--> 1241                 xe_gt_err(gt, "GuC suspend failed: %pe\n", ERR_PTR(ret));
                                                                            ^^^
passing positives to ERR_PTR() is verboten.

    1242                 return ret;
    1243         }
    1244 
    1245         xe_guc_sanitize(guc);
    1246         return 0;
    1247 }

regards,
dan carpenter


More information about the Intel-xe mailing list