Skip to content

Commit e7e7b98

Browse files
committed
drm/v3d: Add module parameter to enable MMU error logging
MMU error messages are useful to help developers quickly identify issues in userspace graphics drivers, but always printing them can swamp the kernel log. Add a module parameter, ``debug_mmu``, to gate MMU error logging. Logging is disabled by default and can be enabled when needed with ``v3d.debug_mmu=1``. Signed-off-by: Maíra Canal <mcanal@igalia.com>
1 parent d15f719 commit e7e7b98

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

drivers/gpu/drm/v3d/v3d_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ module_param_named(super_pages, super_pages, bool, 0400);
4747
MODULE_PARM_DESC(super_pages, "Enable/Disable Super Pages support.");
4848
#endif
4949

50+
bool debug_mmu = false;
51+
module_param(debug_mmu, bool, 0644);
52+
MODULE_PARM_DESC(debug_mmu, "Enable/Disable MMU error logging");
53+
5054
static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
5155
struct drm_file *file_priv)
5256
{

drivers/gpu/drm/v3d/v3d_irq.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ v3d_hub_irq(int irq, void *arg)
183183
"GMP",
184184
};
185185
const char *client = "?";
186+
extern bool debug_mmu;
186187

187188
V3D_WRITE(V3D_MMU_CTL, V3D_READ(V3D_MMU_CTL));
188189

@@ -192,14 +193,17 @@ v3d_hub_irq(int irq, void *arg)
192193
client = v3d41_axi_ids[axi_id];
193194
}
194195

195-
dev_err(v3d->drm.dev, "MMU error from client %s (%d) at 0x%llx%s%s%s\n",
196-
client, axi_id, (long long)vio_addr,
197-
((intsts & V3D_HUB_INT_MMU_WRV) ?
198-
", write violation" : ""),
199-
((intsts & V3D_HUB_INT_MMU_PTI) ?
200-
", pte invalid" : ""),
201-
((intsts & V3D_HUB_INT_MMU_CAP) ?
202-
", cap exceeded" : ""));
196+
if (debug_mmu) {
197+
dev_err(v3d->drm.dev, "MMU error from client %s (%d) at 0x%llx%s%s%s\n",
198+
client, axi_id, (long long)vio_addr,
199+
((intsts & V3D_HUB_INT_MMU_WRV) ?
200+
", write violation" : ""),
201+
((intsts & V3D_HUB_INT_MMU_PTI) ?
202+
", pte invalid" : ""),
203+
((intsts & V3D_HUB_INT_MMU_CAP) ?
204+
", cap exceeded" : ""));
205+
}
206+
203207
status = IRQ_HANDLED;
204208
}
205209

0 commit comments

Comments
 (0)