ivpu_mmu.c (929acfb9c53986d5ba37cfb9e1172ad79735f8eb) | ivpu_mmu.c (27d19268cf394f2c78db732be0cb31852eeadb0a) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2020-2023 Intel Corporation 4 */ 5 6#include <linux/circ_buf.h> 7#include <linux/highmem.h> 8 --- 873 unchanged lines hidden (view full) --- 882 evtq->cons = (evtq->cons + 1) & IVPU_MMU_Q_WRAP_MASK; 883 REGV_WR32(IVPU_MMU_REG_EVTQ_CONS_SEC, evtq->cons); 884 885 return evt; 886} 887 888void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev) 889{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2020-2023 Intel Corporation 4 */ 5 6#include <linux/circ_buf.h> 7#include <linux/highmem.h> 8 --- 873 unchanged lines hidden (view full) --- 882 evtq->cons = (evtq->cons + 1) & IVPU_MMU_Q_WRAP_MASK; 883 REGV_WR32(IVPU_MMU_REG_EVTQ_CONS_SEC, evtq->cons); 884 885 return evt; 886} 887 888void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev) 889{ |
890 bool schedule_recovery = false; | |
891 u32 *event; 892 u32 ssid; 893 894 ivpu_dbg(vdev, IRQ, "MMU event queue\n"); 895 896 while ((event = ivpu_mmu_get_event(vdev)) != NULL) { 897 ivpu_mmu_dump_event(vdev, event); 898 899 ssid = FIELD_GET(IVPU_MMU_EVT_SSID_MASK, event[0]); | 890 u32 *event; 891 u32 ssid; 892 893 ivpu_dbg(vdev, IRQ, "MMU event queue\n"); 894 895 while ((event = ivpu_mmu_get_event(vdev)) != NULL) { 896 ivpu_mmu_dump_event(vdev, event); 897 898 ssid = FIELD_GET(IVPU_MMU_EVT_SSID_MASK, event[0]); |
900 if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID) 901 schedule_recovery = true; 902 else 903 ivpu_mmu_user_context_mark_invalid(vdev, ssid); 904 } | 899 if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID) { 900 ivpu_pm_trigger_recovery(vdev, "MMU event"); 901 return; 902 } |
905 | 903 |
906 if (schedule_recovery) 907 ivpu_pm_schedule_recovery(vdev); | 904 ivpu_mmu_user_context_mark_invalid(vdev, ssid); 905 } |
908} 909 910void ivpu_mmu_evtq_dump(struct ivpu_device *vdev) 911{ 912 u32 *event; 913 914 while ((event = ivpu_mmu_get_event(vdev)) != NULL) 915 ivpu_mmu_dump_event(vdev, event); --- 48 unchanged lines hidden --- | 906} 907 908void ivpu_mmu_evtq_dump(struct ivpu_device *vdev) 909{ 910 u32 *event; 911 912 while ((event = ivpu_mmu_get_event(vdev)) != NULL) 913 ivpu_mmu_dump_event(vdev, event); --- 48 unchanged lines hidden --- |