Update the state HI header from rnndb commit a04283591a8a (rnndb: update MMU exception causes).
Changes in V2: - Only update state_hi.xml as suggested by Lucas Stach.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- drivers/gpu/drm/etnaviv/state_hi.xml.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/state_hi.xml.h b/drivers/gpu/drm/etnaviv/state_hi.xml.h index 41d8da2b6f4f..0f93dbbbaaeb 100644 --- a/drivers/gpu/drm/etnaviv/state_hi.xml.h +++ b/drivers/gpu/drm/etnaviv/state_hi.xml.h @@ -8,17 +8,17 @@ This file was generated by the rules-ng-ng headergen tool in this git repository git clone git://0x04.net/rules-ng-ng
The rules-ng-ng source files this header was generated from are: -- state.xml ( 26087 bytes, from 2017-12-18 16:51:59) -- common.xml ( 35468 bytes, from 2018-01-22 13:48:54) -- common_3d.xml ( 14615 bytes, from 2017-12-18 16:51:59) -- state_hi.xml ( 30232 bytes, from 2018-02-15 15:48:01) -- copyright.xml ( 1597 bytes, from 2016-12-08 16:37:56) -- state_2d.xml ( 51552 bytes, from 2016-12-08 16:37:56) -- state_3d.xml ( 79992 bytes, from 2017-12-18 16:51:59) -- state_blt.xml ( 13405 bytes, from 2017-12-18 16:51:59) -- state_vg.xml ( 5975 bytes, from 2016-12-08 16:37:56) - -Copyright (C) 2012-2018 by the following authors: +- state.xml ( 26666 bytes, from 2019-08-13 11:26:49) +- common.xml ( 35468 bytes, from 2018-02-10 13:09:26) +- common_3d.xml ( 14322 bytes, from 2019-08-20 20:31:50) +- state_hi.xml ( 30396 bytes, from 2019-08-20 20:34:03) +- copyright.xml ( 1597 bytes, from 2018-02-10 13:09:26) +- state_2d.xml ( 51552 bytes, from 2018-02-10 13:09:26) +- state_3d.xml ( 83505 bytes, from 2019-09-06 09:32:54) +- state_blt.xml ( 14252 bytes, from 2019-08-13 20:00:42) +- state_vg.xml ( 5975 bytes, from 2018-02-10 13:09:26) + +Copyright (C) 2012-2019 by the following authors: - Wladimir J. van der Laan laanwj@gmail.com - Christian Gmeiner christian.gmeiner@gmail.com - Lucas Stach l.stach@pengutronix.de @@ -48,6 +48,9 @@ DEALINGS IN THE SOFTWARE. #define MMU_EXCEPTION_SLAVE_NOT_PRESENT 0x00000001 #define MMU_EXCEPTION_PAGE_NOT_PRESENT 0x00000002 #define MMU_EXCEPTION_WRITE_VIOLATION 0x00000003 +#define MMU_EXCEPTION_OUT_OF_BOUND 0x00000004 +#define MMU_EXCEPTION_READ_SECURITY_VIOLATION 0x00000005 +#define MMU_EXCEPTION_WRITE_SECURITY_VIOLATION 0x00000006 #define VIVS_HI 0x00000000
#define VIVS_HI_CLOCK_CONTROL 0x00000000
Might be useful when debugging MMU exceptions.
Changes in V2: - Use a static array of string for error message as suggested by Lucas Stach.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index d47d1a8e0219..b8cd85153fe0 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1351,6 +1351,15 @@ static void sync_point_worker(struct work_struct *work)
static void dump_mmu_fault(struct etnaviv_gpu *gpu) { + static const char *errors[] = { + "slave not present", + "page not present", + "write violation", + "out of bound", + "read security violation", + "write security violation", + }; + u32 status_reg, status; int i;
@@ -1364,10 +1373,16 @@ static void dump_mmu_fault(struct etnaviv_gpu *gpu)
for (i = 0; i < 4; i++) { u32 address_reg; + const char *error = "unknown state";
if (!(status & (VIVS_MMUv2_STATUS_EXCEPTION0__MASK << (i * 4)))) continue;
+ if (status < ARRAY_SIZE(errors)) + error = errors[status]; + + dev_err_ratelimited(gpu->dev, "MMU %d %s\n", i, error); + if (gpu->sec_mode == ETNA_SEC_NONE) address_reg = VIVS_MMUv2_EXCEPTION_ADDR(i); else
On Fr, 2019-09-13 at 07:50 +0200, Christian Gmeiner wrote:
Might be useful when debugging MMU exceptions.
Changes in V2:
- Use a static array of string for error message as suggested by Lucas Stach.
Please move those changelogs below the 3 dashes, so they don't end up in the commit message. They don't really add any value to the persistent kernel history.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index d47d1a8e0219..b8cd85153fe0 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1351,6 +1351,15 @@ static void sync_point_worker(struct work_struct *work)
static void dump_mmu_fault(struct etnaviv_gpu *gpu) {
- static const char *errors[] = {
"slave not present",
"page not present",
"write violation",
"out of bound",
"read security violation",
"write security violation",
- };
- u32 status_reg, status; int i;
@@ -1364,10 +1373,16 @@ static void dump_mmu_fault(struct etnaviv_gpu *gpu)
for (i = 0; i < 4; i++) { u32 address_reg;
const char *error = "unknown state";
if (!(status & (VIVS_MMUv2_STATUS_EXCEPTION0__MASK << (i * 4)))) continue;
if (status < ARRAY_SIZE(errors))
error = errors[status];
Huh? This won't work. The status register is a bitfield, not an integer so you need to map the bit position to the array index via ffs() or something like that.
Regards, Lucas
dev_err_ratelimited(gpu->dev, "MMU %d %s\n", i, error);
- if (gpu->sec_mode == ETNA_SEC_NONE) address_reg = VIVS_MMUv2_EXCEPTION_ADDR(i); else
dri-devel@lists.freedesktop.org