Commit 1fa8d07a authored by Mikko Perttunen's avatar Mikko Perttunen Committed by Thierry Reding

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: b7c00cdf ("gpu: host1x: Enable system suspend callbacks")
Signed-off-by: default avatarMikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222010517.1573931-1-cyndis@kapsi.fi
parent 2aa6f5b0
...@@ -169,6 +169,7 @@ static const struct host1x_info host1x06_info = { ...@@ -169,6 +169,7 @@ static const struct host1x_info host1x06_info = {
.num_sid_entries = ARRAY_SIZE(tegra186_sid_table), .num_sid_entries = ARRAY_SIZE(tegra186_sid_table),
.sid_table = tegra186_sid_table, .sid_table = tegra186_sid_table,
.reserve_vblank_syncpts = false, .reserve_vblank_syncpts = false,
.skip_reset_assert = true,
}; };
static const struct host1x_sid_entry tegra194_sid_table[] = { static const struct host1x_sid_entry tegra194_sid_table[] = {
...@@ -680,6 +681,7 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev) ...@@ -680,6 +681,7 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev)
host1x_intr_stop(host); host1x_intr_stop(host);
host1x_syncpt_save(host); host1x_syncpt_save(host);
if (!host->info->skip_reset_assert) {
err = reset_control_bulk_assert(host->nresets, host->resets); err = reset_control_bulk_assert(host->nresets, host->resets);
if (err) { if (err) {
dev_err(dev, "failed to assert reset: %d\n", err); dev_err(dev, "failed to assert reset: %d\n", err);
...@@ -687,6 +689,7 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev) ...@@ -687,6 +689,7 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev)
} }
usleep_range(1000, 2000); usleep_range(1000, 2000);
}
clk_disable_unprepare(host->clk); clk_disable_unprepare(host->clk);
reset_control_bulk_release(host->nresets, host->resets); reset_control_bulk_release(host->nresets, host->resets);
......
...@@ -116,6 +116,12 @@ struct host1x_info { ...@@ -116,6 +116,12 @@ struct host1x_info {
* the display driver disables VBLANK increments. * the display driver disables VBLANK increments.
*/ */
bool reserve_vblank_syncpts; bool reserve_vblank_syncpts;
/*
* On Tegra186, secure world applications may require access to
* host1x during suspend/resume. To allow this, we need to leave
* host1x not in reset.
*/
bool skip_reset_assert;
}; };
struct host1x { struct host1x {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment