Skip to content

Commit b3bb6b8

Browse files
digetxjoergroedel
authored andcommitted
memory: tegra: Read client ID on GART page fault
With the device tree binding changes, now Memory Controller has access to GART registers. Hence it is now possible to read client ID on GART page fault to get information about what memory client causes the fault. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 96efa11 commit b3bb6b8

File tree

1 file changed

+10
-2
lines changed
  • drivers/memory/tegra

1 file changed

+10
-2
lines changed

drivers/memory/tegra/mc.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#define MC_ERR_ADR 0x0c
4040

41+
#define MC_GART_ERROR_REQ 0x30
4142
#define MC_DECERR_EMEM_OTHERS_STATUS 0x58
4243
#define MC_SECURITY_VIOLATION_STATUS 0x74
4344

@@ -575,8 +576,15 @@ static __maybe_unused irqreturn_t tegra20_mc_irq(int irq, void *data)
575576
break;
576577

577578
case MC_INT_INVALID_GART_PAGE:
578-
dev_err_ratelimited(mc->dev, "%s\n", error);
579-
continue;
579+
reg = MC_GART_ERROR_REQ;
580+
value = mc_readl(mc, reg);
581+
582+
id = (value >> 1) & mc->soc->client_id_mask;
583+
desc = error_names[2];
584+
585+
if (value & BIT(0))
586+
direction = "write";
587+
break;
580588

581589
case MC_INT_SECURITY_VIOLATION:
582590
reg = MC_SECURITY_VIOLATION_STATUS;

0 commit comments

Comments
 (0)