diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f6bb9445..10fa86a1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -767,6 +767,10 @@ static int gk20a_pm_prepare_poweroff(struct device *dev) | |||
767 | if (!g->power_on) | 767 | if (!g->power_on) |
768 | goto done; | 768 | goto done; |
769 | 769 | ||
770 | if (gk20a_fifo_is_engine_busy(g)) { | ||
771 | mutex_unlock(&g->poweroff_lock); | ||
772 | return -EBUSY; | ||
773 | } | ||
770 | gk20a_scale_suspend(dev); | 774 | gk20a_scale_suspend(dev); |
771 | 775 | ||
772 | /* cancel any pending cde work */ | 776 | /* cancel any pending cde work */ |
@@ -1353,6 +1357,7 @@ static int gk20a_pm_runtime_suspend(struct device *dev) | |||
1353 | fail_railgate: | 1357 | fail_railgate: |
1354 | gk20a_pm_finalize_poweron(dev); | 1358 | gk20a_pm_finalize_poweron(dev); |
1355 | fail: | 1359 | fail: |
1360 | pm_runtime_mark_last_busy(dev); | ||
1356 | return err; | 1361 | return err; |
1357 | } | 1362 | } |
1358 | 1363 | ||
@@ -1751,6 +1756,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset) | |||
1751 | msecs_to_jiffies(GK20A_WAIT_FOR_IDLE_MS); | 1756 | msecs_to_jiffies(GK20A_WAIT_FOR_IDLE_MS); |
1752 | int ref_cnt; | 1757 | int ref_cnt; |
1753 | bool is_railgated; | 1758 | bool is_railgated; |
1759 | int err = 0; | ||
1754 | 1760 | ||
1755 | /* acquire busy lock to block other busy() calls */ | 1761 | /* acquire busy lock to block other busy() calls */ |
1756 | down_write(&g->busy_lock); | 1762 | down_write(&g->busy_lock); |
@@ -1825,7 +1831,9 @@ int __gk20a_do_idle(struct device *dev, bool force_reset) | |||
1825 | */ | 1831 | */ |
1826 | 1832 | ||
1827 | /* Save the GPU state */ | 1833 | /* Save the GPU state */ |
1828 | gk20a_pm_prepare_poweroff(dev); | 1834 | err = gk20a_pm_prepare_poweroff(dev); |
1835 | if (err) | ||
1836 | goto fail_drop_usage_count; | ||
1829 | 1837 | ||
1830 | /* railgate GPU */ | 1838 | /* railgate GPU */ |
1831 | platform->railgate(dev); | 1839 | platform->railgate(dev); |