Skip to content

Commit 1fa8d07

Browse files
cyndisthierryreding
authored andcommitted
gpu: host1x: Skip reset assert on Tegra186
On Tegra186, secure world applications may need to access host1x during suspend/resume, and rely on the kernel to keep Host1x out of reset during the suspend cycle. As such, as a quirk, skip asserting Host1x's reset on Tegra186. We don't need to keep the clocks enabled, as BPMP ensures the clock stays on while Host1x is being used. On newer SoC's, the reset line is inaccessible, so there is no need for the quirk. Fixes: b7c00cd ("gpu: host1x: Enable system suspend callbacks") Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240222010517.1573931-1-cyndis@kapsi.fi
1 parent 2aa6f5b commit 1fa8d07

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

drivers/gpu/host1x/dev.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ static const struct host1x_info host1x06_info = {
169169
.num_sid_entries = ARRAY_SIZE(tegra186_sid_table),
170170
.sid_table = tegra186_sid_table,
171171
.reserve_vblank_syncpts = false,
172+
.skip_reset_assert = true,
172173
};
173174

174175
static const struct host1x_sid_entry tegra194_sid_table[] = {
@@ -680,13 +681,15 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev)
680681
host1x_intr_stop(host);
681682
host1x_syncpt_save(host);
682683

683-
err = reset_control_bulk_assert(host->nresets, host->resets);
684-
if (err) {
685-
dev_err(dev, "failed to assert reset: %d\n", err);
686-
goto resume_host1x;
687-
}
684+
if (!host->info->skip_reset_assert) {
685+
err = reset_control_bulk_assert(host->nresets, host->resets);
686+
if (err) {
687+
dev_err(dev, "failed to assert reset: %d\n", err);
688+
goto resume_host1x;
689+
}
688690

689-
usleep_range(1000, 2000);
691+
usleep_range(1000, 2000);
692+
}
690693

691694
clk_disable_unprepare(host->clk);
692695
reset_control_bulk_release(host->nresets, host->resets);

drivers/gpu/host1x/dev.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ struct host1x_info {
116116
* the display driver disables VBLANK increments.
117117
*/
118118
bool reserve_vblank_syncpts;
119+
/*
120+
* On Tegra186, secure world applications may require access to
121+
* host1x during suspend/resume. To allow this, we need to leave
122+
* host1x not in reset.
123+
*/
124+
bool skip_reset_assert;
119125
};
120126

121127
struct host1x {

0 commit comments

Comments
 (0)