[bug report] drm/msm: Add SDM845 DPU support
Dan Carpenter
dan.carpenter at oracle.com
Mon Oct 1 09:38:56 UTC 2018
Hello Jeykumar Sankaran,
The patch 25fdd5933e4c: "drm/msm: Add SDM845 DPU support" from Jun
27, 2018, leads to the following static checker warning:
drivers/gpu/drm/msm/msm_drv.c:562 msm_drm_init()
warn: 'priv->disp_thread[i].thread' isn't an ERR_PTR
drivers/gpu/drm/msm/msm_drv.c
540 /**
541 * this priority was found during empiric testing to have appropriate
542 * realtime scheduling to process display updates and interact with
543 * other real time and normal priority task
544 */
545 param.sched_priority = 16;
546 for (i = 0; i < priv->num_crtcs; i++) {
547
548 /* initialize display thread */
549 priv->disp_thread[i].crtc_id = priv->crtcs[i]->base.id;
550 kthread_init_worker(&priv->disp_thread[i].worker);
551 priv->disp_thread[i].dev = ddev;
552 priv->disp_thread[i].thread =
^^^^^^^^^^^^^^^^^^^^^^^^^^^
553 kthread_run(kthread_worker_fn,
554 &priv->disp_thread[i].worker,
555 "crtc_commit:%d", priv->disp_thread[i].crtc_id);
556 ret = sched_setscheduler(priv->disp_thread[i].thread,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Only pass valid pointers to this because it's going to dereference it.
557 SCHED_FIFO, ¶m);
558 if (ret)
559 pr_warn("display thread priority update failed: %d\n",
560 ret);
561
562 if (IS_ERR(priv->disp_thread[i].thread)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Too late.
563 dev_err(dev, "failed to create crtc_commit kthread\n");
564 priv->disp_thread[i].thread = NULL;
565 }
566
567 /* initialize event thread */
568 priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id;
569 kthread_init_worker(&priv->event_thread[i].worker);
570 priv->event_thread[i].dev = ddev;
571 priv->event_thread[i].thread =
572 kthread_run(kthread_worker_fn,
573 &priv->event_thread[i].worker,
574 "crtc_event:%d", priv->event_thread[i].crtc_id);
regards,
dan carpenter
More information about the dri-devel
mailing list