Skip to content

Commit d0e4c65

Browse files
txenoomairacanal
authored andcommitted
drm/v3d: fix client obtained from axi_ids on V3D 4.1
In the case of MMU errors caused by the TFU unit, the client that causes the MMU error is expected to be reported. But in the case of MMU TFU errors, a non existing client was being reported. This happened because the client calculation was taking into account more than the bits 0-7 from the axi_id that were representing the client. [ 27.845132] v3d fec00000.v3d: MMU error from client ? (13) at 0x3bb1000, pte invalid Masking the bits and using the correct axi_id ranges fixes the calculation to report the real guilty client on V3D 4.1 and 4.2. Make the MMU error print axi_id with hexadecimal as used in the ranges. Fixes: 38c2c79 ("drm/v3d: Fix and extend MMU error handling.") Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20250425122522.18425-1-jmcasanova@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
1 parent 0e7db50 commit d0e4c65

1 file changed

Lines changed: 24 additions & 13 deletions

File tree

drivers/gpu/drm/v3d/v3d_irq.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,27 +186,38 @@ v3d_hub_irq(int irq, void *arg)
186186
u32 axi_id = V3D_READ(V3D_MMU_VIO_ID);
187187
u64 vio_addr = ((u64)V3D_READ(V3D_MMU_VIO_ADDR) <<
188188
(v3d->va_width - 32));
189-
static const char *const v3d41_axi_ids[] = {
190-
"L2T",
191-
"PTB",
192-
"PSE",
193-
"TLB",
194-
"CLE",
195-
"TFU",
196-
"MMU",
197-
"GMP",
189+
static const struct {
190+
u32 begin;
191+
u32 end;
192+
const char *client;
193+
} v3d41_axi_ids[] = {
194+
{0x00, 0x20, "L2T"},
195+
{0x20, 0x21, "PTB"},
196+
{0x40, 0x41, "PSE"},
197+
{0x60, 0x80, "TLB"},
198+
{0x80, 0x88, "CLE"},
199+
{0xA0, 0xA1, "TFU"},
200+
{0xC0, 0xE0, "MMU"},
201+
{0xE0, 0xE1, "GMP"},
198202
};
199203
const char *client = "?";
200204

201205
V3D_WRITE(V3D_MMU_CTL, V3D_READ(V3D_MMU_CTL));
202206

203207
if (v3d->ver >= V3D_GEN_41) {
204-
axi_id = axi_id >> 5;
205-
if (axi_id < ARRAY_SIZE(v3d41_axi_ids))
206-
client = v3d41_axi_ids[axi_id];
208+
size_t i;
209+
210+
axi_id = axi_id & 0xFF;
211+
for (i = 0; i < ARRAY_SIZE(v3d41_axi_ids); i++) {
212+
if (axi_id >= v3d41_axi_ids[i].begin &&
213+
axi_id < v3d41_axi_ids[i].end) {
214+
client = v3d41_axi_ids[i].client;
215+
break;
216+
}
217+
}
207218
}
208219

209-
dev_err(v3d->drm.dev, "MMU error from client %s (%d) at 0x%llx%s%s%s\n",
220+
dev_err(v3d->drm.dev, "MMU error from client %s (0x%x) at 0x%llx%s%s%s\n",
210221
client, axi_id, (long long)vio_addr,
211222
((intsts & V3D_HUB_INT_MMU_WRV) ?
212223
", write violation" : ""),

0 commit comments

Comments
 (0)