Skip to content

Commit

Permalink
Merge tag 'drm/tegra/for-5.2-rc1' of git://anongit.freedesktop.org/te…
Browse files Browse the repository at this point in the history
…gra/linux into drm-next

drm/tegra: Changes for v5.2-rc1

This contains a fix for the usage of shared resets that previously
generated a WARN on boot. In addition, there's a fix for CPU cache
maintenance of GEM buffers allocated using get_pages().

(airlied: contains a merge from a shared tegra tree)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190418151447.9430-1-thierry.reding@gmail.com
  • Loading branch information
Dave Airlie committed Apr 24, 2019
2 parents 8d8f6f7 + 61b51fb commit 6e865c7
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 44 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/tegra/gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void tegra_bo_free(struct drm_device *drm, struct tegra_bo *bo)
{
if (bo->pages) {
dma_unmap_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
DMA_BIDIRECTIONAL);
DMA_FROM_DEVICE);
drm_gem_put_pages(&bo->gem, bo->pages, true, true);
sg_free_table(bo->sgt);
kfree(bo->sgt);
Expand All @@ -230,7 +230,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)
}

err = dma_map_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
DMA_BIDIRECTIONAL);
DMA_FROM_DEVICE);
if (err == 0) {
err = -EFAULT;
goto free_sgt;
Expand Down
21 changes: 20 additions & 1 deletion drivers/gpu/drm/tegra/sor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,13 @@ static int tegra_sor_init(struct host1x_client *client)
* kernel is possible.
*/
if (sor->rst) {
err = reset_control_acquire(sor->rst);
if (err < 0) {
dev_err(sor->dev, "failed to acquire SOR reset: %d\n",
err);
return err;
}

err = reset_control_assert(sor->rst);
if (err < 0) {
dev_err(sor->dev, "failed to assert SOR reset: %d\n",
Expand All @@ -2894,6 +2901,8 @@ static int tegra_sor_init(struct host1x_client *client)
err);
return err;
}

reset_control_release(sor->rst);
}

err = clk_prepare_enable(sor->clk_safe);
Expand Down Expand Up @@ -3331,7 +3340,7 @@ static int tegra_sor_probe(struct platform_device *pdev)
goto remove;
}

sor->rst = devm_reset_control_get(&pdev->dev, "sor");
sor->rst = devm_reset_control_get_exclusive_released(&pdev->dev, "sor");
if (IS_ERR(sor->rst)) {
err = PTR_ERR(sor->rst);

Expand Down Expand Up @@ -3519,6 +3528,8 @@ static int tegra_sor_suspend(struct device *dev)
dev_err(dev, "failed to assert reset: %d\n", err);
return err;
}

reset_control_release(sor->rst);
}

usleep_range(1000, 2000);
Expand All @@ -3542,9 +3553,17 @@ static int tegra_sor_resume(struct device *dev)
usleep_range(1000, 2000);

if (sor->rst) {
err = reset_control_acquire(sor->rst);
if (err < 0) {
dev_err(dev, "failed to acquire reset: %d\n", err);
clk_disable_unprepare(sor->clk);
return err;
}

err = reset_control_deassert(sor->rst);
if (err < 0) {
dev_err(dev, "failed to deassert reset: %d\n", err);
reset_control_release(sor->rst);
clk_disable_unprepare(sor->clk);
return err;
}
Expand Down
Loading

0 comments on commit 6e865c7

Please sign in to comment.