Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/gpu: Skip retired submits in recover worker

If we somehow raced with submit retiring, either while waiting for
worker to have a chance to run or acquiring the gpu lock, then the
recover worker should just bail.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/568034/

+22 -19
+22 -19
drivers/gpu/drm/msm/msm_gpu.c
··· 365 365 DRM_DEV_ERROR(dev->dev, "%s: hangcheck recover!\n", gpu->name); 366 366 367 367 submit = find_submit(cur_ring, cur_ring->memptrs->fence + 1); 368 - if (submit) { 369 - /* Increment the fault counts */ 370 - submit->queue->faults++; 371 - if (submit->aspace) 372 - submit->aspace->faults++; 373 368 374 - get_comm_cmdline(submit, &comm, &cmd); 369 + /* 370 + * If the submit retired while we were waiting for the worker to run, 371 + * or waiting to acquire the gpu lock, then nothing more to do. 372 + */ 373 + if (!submit) 374 + goto out_unlock; 375 375 376 - if (comm && cmd) { 377 - DRM_DEV_ERROR(dev->dev, "%s: offending task: %s (%s)\n", 378 - gpu->name, comm, cmd); 376 + /* Increment the fault counts */ 377 + submit->queue->faults++; 378 + if (submit->aspace) 379 + submit->aspace->faults++; 379 380 380 - msm_rd_dump_submit(priv->hangrd, submit, 381 - "offending task: %s (%s)", comm, cmd); 382 - } else { 383 - msm_rd_dump_submit(priv->hangrd, submit, NULL); 384 - } 381 + get_comm_cmdline(submit, &comm, &cmd); 382 + 383 + if (comm && cmd) { 384 + DRM_DEV_ERROR(dev->dev, "%s: offending task: %s (%s)\n", 385 + gpu->name, comm, cmd); 386 + 387 + msm_rd_dump_submit(priv->hangrd, submit, 388 + "offending task: %s (%s)", comm, cmd); 385 389 } else { 386 - /* 387 - * We couldn't attribute this fault to any particular context, 388 - * so increment the global fault count instead. 389 - */ 390 - gpu->global_faults++; 390 + DRM_DEV_ERROR(dev->dev, "%s: offending task: unknown\n", gpu->name); 391 + 392 + msm_rd_dump_submit(priv->hangrd, submit, NULL); 391 393 } 392 394 393 395 /* Record the crash state */ ··· 442 440 443 441 pm_runtime_put(&gpu->pdev->dev); 444 442 443 + out_unlock: 445 444 mutex_unlock(&gpu->lock); 446 445 447 446 msm_gpu_retire(gpu);