diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 9086e468..1bf38080 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -1545,7 +1545,7 @@ clean_up: | |||
1545 | return 0; | 1545 | return 0; |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | static bool gk20a_fifo_handle_mmu_fault( | 1548 | static bool gk20a_fifo_handle_mmu_fault_locked( |
1549 | struct gk20a *g, | 1549 | struct gk20a *g, |
1550 | u32 mmu_fault_engines, /* queried from HW if 0 */ | 1550 | u32 mmu_fault_engines, /* queried from HW if 0 */ |
1551 | u32 hw_id, /* queried from HW if ~(u32)0 OR mmu_fault_engines == 0*/ | 1551 | u32 hw_id, /* queried from HW if ~(u32)0 OR mmu_fault_engines == 0*/ |
@@ -1783,6 +1783,32 @@ static bool gk20a_fifo_handle_mmu_fault( | |||
1783 | return verbose; | 1783 | return verbose; |
1784 | } | 1784 | } |
1785 | 1785 | ||
1786 | static bool gk20a_fifo_handle_mmu_fault( | ||
1787 | struct gk20a *g, | ||
1788 | u32 mmu_fault_engines, /* queried from HW if 0 */ | ||
1789 | u32 hw_id, /* queried from HW if ~(u32)0 OR mmu_fault_engines == 0*/ | ||
1790 | bool id_is_tsg) | ||
1791 | { | ||
1792 | u32 rlid; | ||
1793 | bool verbose; | ||
1794 | |||
1795 | nvgpu_log_fn(g, " "); | ||
1796 | |||
1797 | nvgpu_log_info(g, "acquire runlist_lock for all runlists"); | ||
1798 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { | ||
1799 | nvgpu_mutex_acquire(&g->fifo.runlist_info[rlid].runlist_lock); | ||
1800 | } | ||
1801 | |||
1802 | verbose = gk20a_fifo_handle_mmu_fault_locked(g, mmu_fault_engines, | ||
1803 | hw_id, id_is_tsg); | ||
1804 | |||
1805 | nvgpu_log_info(g, "release runlist_lock for all runlists"); | ||
1806 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { | ||
1807 | nvgpu_mutex_release(&g->fifo.runlist_info[rlid].runlist_lock); | ||
1808 | } | ||
1809 | return verbose; | ||
1810 | } | ||
1811 | |||
1786 | static void gk20a_fifo_get_faulty_id_type(struct gk20a *g, int engine_id, | 1812 | static void gk20a_fifo_get_faulty_id_type(struct gk20a *g, int engine_id, |
1787 | u32 *id, u32 *type) | 1813 | u32 *id, u32 *type) |
1788 | { | 1814 | { |
@@ -1906,6 +1932,12 @@ void gk20a_fifo_teardown_ch_tsg(struct gk20a *g, u32 __engine_ids, | |||
1906 | u32 ref_id_is_tsg = false; | 1932 | u32 ref_id_is_tsg = false; |
1907 | bool id_is_known = (id_type != ID_TYPE_UNKNOWN) ? true : false; | 1933 | bool id_is_known = (id_type != ID_TYPE_UNKNOWN) ? true : false; |
1908 | bool id_is_tsg = (id_type == ID_TYPE_TSG) ? true : false; | 1934 | bool id_is_tsg = (id_type == ID_TYPE_TSG) ? true : false; |
1935 | u32 rlid; | ||
1936 | |||
1937 | nvgpu_log_info(g, "acquire runlist_lock for all runlists"); | ||
1938 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { | ||
1939 | nvgpu_mutex_acquire(&g->fifo.runlist_info[rlid].runlist_lock); | ||
1940 | } | ||
1909 | 1941 | ||
1910 | if (id_is_known) { | 1942 | if (id_is_known) { |
1911 | engine_ids = gk20a_fifo_engines_on_id(g, hw_id, id_is_tsg); | 1943 | engine_ids = gk20a_fifo_engines_on_id(g, hw_id, id_is_tsg); |
@@ -1963,7 +1995,7 @@ void gk20a_fifo_teardown_ch_tsg(struct gk20a *g, u32 __engine_ids, | |||
1963 | fifo_intr_0_sched_error_reset_f()); | 1995 | fifo_intr_0_sched_error_reset_f()); |
1964 | 1996 | ||
1965 | g->ops.fifo.trigger_mmu_fault(g, engine_ids); | 1997 | g->ops.fifo.trigger_mmu_fault(g, engine_ids); |
1966 | gk20a_fifo_handle_mmu_fault(g, mmu_fault_engines, ref_id, | 1998 | gk20a_fifo_handle_mmu_fault_locked(g, mmu_fault_engines, ref_id, |
1967 | ref_id_is_tsg); | 1999 | ref_id_is_tsg); |
1968 | 2000 | ||
1969 | val = gk20a_readl(g, fifo_intr_en_0_r()); | 2001 | val = gk20a_readl(g, fifo_intr_en_0_r()); |
@@ -1971,6 +2003,11 @@ void gk20a_fifo_teardown_ch_tsg(struct gk20a *g, u32 __engine_ids, | |||
1971 | | fifo_intr_en_0_sched_error_f(1); | 2003 | | fifo_intr_en_0_sched_error_f(1); |
1972 | gk20a_writel(g, fifo_intr_en_0_r(), val); | 2004 | gk20a_writel(g, fifo_intr_en_0_r(), val); |
1973 | } | 2005 | } |
2006 | |||
2007 | nvgpu_log_info(g, "release runlist_lock for all runlists"); | ||
2008 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { | ||
2009 | nvgpu_mutex_release(&g->fifo.runlist_info[rlid].runlist_lock); | ||
2010 | } | ||
1974 | } | 2011 | } |
1975 | 2012 | ||
1976 | void gk20a_fifo_recover(struct gk20a *g, u32 __engine_ids, | 2013 | void gk20a_fifo_recover(struct gk20a *g, u32 __engine_ids, |