video: tegra: host: gk20a: Fix deferred mmu fault
Arto Merilainen [Fri, 7 Mar 2014 07:03:47 +0000 (09:03 +0200)]
Deferred MMU fault did not clear stored mmu_fault_engines variable
and this caused the MMU fault handler to handle subsequent MMU fault
as a fake fault.

This patch modifies the code so that we clear the mmu_fault_engines
variable if we need to continue fault handling on channel tear down.

Bug 1472328

Change-Id: Iabec72575072b207aef1b05ef2f661d7dc8f3c40
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/378792
(cherry picked from commit 25d1566063ae030124c28780fb825e982a5a24e2)
Reviewed-on: http://git-master/r/381534
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/video/tegra/host/gk20a/channel_gk20a.c

index 679aa22..53f361f 100644 (file)
@@ -14,9 +14,8 @@
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <linux/list.h>
@@ -624,6 +623,7 @@ void gk20a_free_channel(struct nvhost_hwctx *ctx, bool finish)
                nvhost_dbg(dbg_intr | dbg_gpu_dbg, "engine reset was"
                           " deferred, running now");
                fifo_gk20a_finish_mmu_fault_handling(g, g->fifo.mmu_fault_engines);
+               g->fifo.mmu_fault_engines = 0;
                g->fifo.deferred_reset_pending = false;
        }
        mutex_unlock(&f->deferred_reset_mutex);