gpu: host1x: Correct host1x_job_pin() error handling
In case of relocations / waitchecks patching failure the jobs pins stay referenced till DRM file get closed, wasting memory. Add the missed unpinning. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
3833d16f16
commit
e5855aa3e6
@ -592,22 +592,20 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
|
|||||||
|
|
||||||
err = do_relocs(job, g->bo);
|
err = do_relocs(job, g->bo);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
goto out;
|
||||||
|
|
||||||
err = do_waitchks(job, host, g->bo);
|
err = do_waitchks(job, host, g->bo);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && !err) {
|
if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL))
|
||||||
err = copy_gathers(job, dev);
|
goto out;
|
||||||
if (err) {
|
|
||||||
host1x_job_unpin(job);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
err = copy_gathers(job, dev);
|
||||||
out:
|
out:
|
||||||
|
if (err)
|
||||||
|
host1x_job_unpin(job);
|
||||||
wmb();
|
wmb();
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
Loading…
Reference in New Issue
Block a user