summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 79c3fd09..32570d3d 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -33,7 +33,7 @@
33#include <linux/thermal.h> 33#include <linux/thermal.h>
34#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
35#include <linux/debugfs.h> 35#include <linux/debugfs.h>
36#include <linux/spinlock.h> 36#include <nvgpu/lock.h>
37#include <linux/clk/tegra.h> 37#include <linux/clk/tegra.h>
38#include <linux/kthread.h> 38#include <linux/kthread.h>
39#include <linux/platform/tegra/common.h> 39#include <linux/platform/tegra/common.h>
@@ -795,13 +795,13 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
795 795
796 gk20a_dbg_fn(""); 796 gk20a_dbg_fn("");
797 797
798 mutex_lock(&g->poweroff_lock); 798 nvgpu_mutex_acquire(&g->poweroff_lock);
799 799
800 if (!g->power_on) 800 if (!g->power_on)
801 goto done; 801 goto done;
802 802
803 if (gk20a_fifo_is_engine_busy(g)) { 803 if (gk20a_fifo_is_engine_busy(g)) {
804 mutex_unlock(&g->poweroff_lock); 804 nvgpu_mutex_release(&g->poweroff_lock);
805 return -EBUSY; 805 return -EBUSY;
806 } 806 }
807 gk20a_scale_suspend(dev); 807 gk20a_scale_suspend(dev);
@@ -844,7 +844,7 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
844 gk20a_lockout_registers(g); 844 gk20a_lockout_registers(g);
845 845
846done: 846done:
847 mutex_unlock(&g->poweroff_lock); 847 nvgpu_mutex_release(&g->poweroff_lock);
848 848
849 return ret; 849 return ret;
850} 850}
@@ -1373,9 +1373,9 @@ static int gk20a_pm_unrailgate(struct device *dev)
1373 trace_gk20a_pm_unrailgate(dev_name(dev)); 1373 trace_gk20a_pm_unrailgate(dev_name(dev));
1374 1374
1375 if (platform->unrailgate) { 1375 if (platform->unrailgate) {
1376 mutex_lock(&platform->railgate_lock); 1376 nvgpu_mutex_acquire(&platform->railgate_lock);
1377 ret = platform->unrailgate(dev); 1377 ret = platform->unrailgate(dev);
1378 mutex_unlock(&platform->railgate_lock); 1378 nvgpu_mutex_release(&platform->railgate_lock);
1379 } 1379 }
1380 1380
1381#ifdef CONFIG_DEBUG_FS 1381#ifdef CONFIG_DEBUG_FS
@@ -1896,11 +1896,11 @@ void gk20a_disable(struct gk20a *g, u32 units)
1896 1896
1897 gk20a_dbg(gpu_dbg_info, "pmc disable: %08x\n", units); 1897 gk20a_dbg(gpu_dbg_info, "pmc disable: %08x\n", units);
1898 1898
1899 spin_lock(&g->mc_enable_lock); 1899 nvgpu_spinlock_acquire(&g->mc_enable_lock);
1900 pmc = gk20a_readl(g, mc_enable_r()); 1900 pmc = gk20a_readl(g, mc_enable_r());
1901 pmc &= ~units; 1901 pmc &= ~units;
1902 gk20a_writel(g, mc_enable_r(), pmc); 1902 gk20a_writel(g, mc_enable_r(), pmc);
1903 spin_unlock(&g->mc_enable_lock); 1903 nvgpu_spinlock_release(&g->mc_enable_lock);
1904} 1904}
1905 1905
1906void gk20a_enable(struct gk20a *g, u32 units) 1906void gk20a_enable(struct gk20a *g, u32 units)
@@ -1909,12 +1909,12 @@ void gk20a_enable(struct gk20a *g, u32 units)
1909 1909
1910 gk20a_dbg(gpu_dbg_info, "pmc enable: %08x\n", units); 1910 gk20a_dbg(gpu_dbg_info, "pmc enable: %08x\n", units);
1911 1911
1912 spin_lock(&g->mc_enable_lock); 1912 nvgpu_spinlock_acquire(&g->mc_enable_lock);
1913 pmc = gk20a_readl(g, mc_enable_r()); 1913 pmc = gk20a_readl(g, mc_enable_r());
1914 pmc |= units; 1914 pmc |= units;
1915 gk20a_writel(g, mc_enable_r(), pmc); 1915 gk20a_writel(g, mc_enable_r(), pmc);
1916 gk20a_readl(g, mc_enable_r()); 1916 gk20a_readl(g, mc_enable_r());
1917 spin_unlock(&g->mc_enable_lock); 1917 nvgpu_spinlock_release(&g->mc_enable_lock);
1918 1918
1919 udelay(20); 1919 udelay(20);
1920} 1920}
@@ -1953,7 +1953,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
1953 down_write(&g->busy_lock); 1953 down_write(&g->busy_lock);
1954 1954
1955 /* acquire railgate lock to prevent unrailgate in midst of do_idle() */ 1955 /* acquire railgate lock to prevent unrailgate in midst of do_idle() */
1956 mutex_lock(&platform->railgate_lock); 1956 nvgpu_mutex_acquire(&platform->railgate_lock);
1957 1957
1958 /* check if it is already railgated ? */ 1958 /* check if it is already railgated ? */
1959 if (platform->is_railgated(dev)) 1959 if (platform->is_railgated(dev))
@@ -1963,7 +1963,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
1963 * release railgate_lock, prevent suspend by incrementing usage counter, 1963 * release railgate_lock, prevent suspend by incrementing usage counter,
1964 * re-acquire railgate_lock 1964 * re-acquire railgate_lock
1965 */ 1965 */
1966 mutex_unlock(&platform->railgate_lock); 1966 nvgpu_mutex_release(&platform->railgate_lock);
1967 pm_runtime_get_sync(dev); 1967 pm_runtime_get_sync(dev);
1968 1968
1969 /* 1969 /*
@@ -1975,7 +1975,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
1975 target_ref_cnt = 2; 1975 target_ref_cnt = 2;
1976 else 1976 else
1977 target_ref_cnt = 1; 1977 target_ref_cnt = 1;
1978 mutex_lock(&platform->railgate_lock); 1978 nvgpu_mutex_acquire(&platform->railgate_lock);
1979 1979
1980 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS, 1980 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS,
1981 NVGPU_TIMER_CPU_TIMER); 1981 NVGPU_TIMER_CPU_TIMER);
@@ -2052,7 +2052,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
2052fail_drop_usage_count: 2052fail_drop_usage_count:
2053 pm_runtime_put_noidle(dev); 2053 pm_runtime_put_noidle(dev);
2054fail_timeout: 2054fail_timeout:
2055 mutex_unlock(&platform->railgate_lock); 2055 nvgpu_mutex_release(&platform->railgate_lock);
2056 up_write(&g->busy_lock); 2056 up_write(&g->busy_lock);
2057 return -EBUSY; 2057 return -EBUSY;
2058} 2058}
@@ -2101,7 +2101,7 @@ int __gk20a_do_unidle(struct device *dev)
2101 } 2101 }
2102 2102
2103 /* release the lock and open up all other busy() calls */ 2103 /* release the lock and open up all other busy() calls */
2104 mutex_unlock(&platform->railgate_lock); 2104 nvgpu_mutex_release(&platform->railgate_lock);
2105 up_write(&g->busy_lock); 2105 up_write(&g->busy_lock);
2106 2106
2107 return 0; 2107 return 0;