msm: kgsl: Dump both GMU and GPU state for GMU faults

GPU state especially command processor state is important
to debug GMU fault. If GPU is powered ON, dump both GMU
and GPU state for GMU faults to make sure all required
state needed for debug is captured.

Change-Id: I71b359cd944a12cb19c419bca0254fd2fa468328
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
This commit is contained in:
Deepak Kumar 2018-07-31 14:06:33 +05:30
commit 36f505230b
8 changed files with 22 additions and 46 deletions

View file

@ -3772,7 +3772,6 @@ static const struct kgsl_functable adreno_functable = {
.device_private_create = adreno_device_private_create,
.device_private_destroy = adreno_device_private_destroy,
/* Optional functions */
.snapshot_gmu = adreno_snapshot_gmu,
.drawctxt_create = adreno_drawctxt_create,
.drawctxt_detach = adreno_drawctxt_detach,
.drawctxt_destroy = adreno_drawctxt_destroy,

View file

@ -941,7 +941,6 @@ struct adreno_gpudev {
/* GPU specific function hooks */
void (*irq_trace)(struct adreno_device *, unsigned int status);
void (*snapshot)(struct adreno_device *, struct kgsl_snapshot *);
void (*snapshot_gmu)(struct adreno_device *, struct kgsl_snapshot *);
void (*platform_setup)(struct adreno_device *);
void (*init)(struct adreno_device *);
void (*remove)(struct adreno_device *);
@ -1123,9 +1122,6 @@ void adreno_snapshot(struct kgsl_device *device,
struct kgsl_snapshot *snapshot,
struct kgsl_context *context);
void adreno_snapshot_gmu(struct kgsl_device *device,
struct kgsl_snapshot *snapshot);
int adreno_reset(struct kgsl_device *device, int fault);
void adreno_fault_skipcmd_detached(struct adreno_device *adreno_dev,

View file

@ -3909,7 +3909,6 @@ struct adreno_gpudev adreno_a6xx_gpudev = {
.reg_offsets = &a6xx_reg_offsets,
.start = a6xx_start,
.snapshot = a6xx_snapshot,
.snapshot_gmu = a6xx_snapshot_gmu,
.irq = &a6xx_irq,
.snapshot_data = &a6xx_snapshot_data,
.irq_trace = trace_kgsl_a5xx_irq_status,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -129,8 +129,5 @@ void a6xx_preemption_context_destroy(struct kgsl_context *context);
void a6xx_snapshot(struct adreno_device *adreno_dev,
struct kgsl_snapshot *snapshot);
void a6xx_snapshot_gmu(struct adreno_device *adreno_dev,
struct kgsl_snapshot *snapshot);
void a6xx_crashdump_init(struct adreno_device *adreno_dev);
#endif

View file

@ -1456,7 +1456,7 @@ static void a6xx_snapshot_debugbus(struct kgsl_device *device,
* This is where all of the A6XX GMU specific bits and pieces are grabbed
* into the snapshot memory
*/
void a6xx_snapshot_gmu(struct adreno_device *adreno_dev,
static void a6xx_snapshot_gmu(struct adreno_device *adreno_dev,
struct kgsl_snapshot *snapshot)
{
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
@ -1479,8 +1479,6 @@ void a6xx_snapshot_gmu(struct adreno_device *adreno_dev,
a6xx_gmu_gx_registers,
ARRAY_SIZE(a6xx_gmu_gx_registers) / 2);
}
a6xx_snapshot_debugbus(device, snapshot);
}
/* a6xx_snapshot_sqe() - Dump SQE data in snapshot */
@ -1571,6 +1569,15 @@ void a6xx_snapshot(struct adreno_device *adreno_dev,
/* GMU TCM data dumped through AHB */
a6xx_snapshot_gmu(adreno_dev, snapshot);
/*
* Dump debugbus data here to capture it for both
* GMU and GPU snapshot. Debugbus data can be accessed
* even if the gx headswitch or sptprac is off. If gx
* headswitch is off, data for gx blocks will show as
* 0x5c00bd00.
*/
a6xx_snapshot_debugbus(device, snapshot);
sptprac_on = gpudev->sptprac_is_on(adreno_dev);
/* Return if the GX is off */

View file

@ -946,24 +946,6 @@ void adreno_snapshot(struct kgsl_device *device, struct kgsl_snapshot *snapshot,
}
/* adreno_snapshot_gmu - Snapshot the Adreno GMU state
* @device - KGSL device to snapshot
* @snapshot - Pointer to the snapshot instance
* This is a hook function called by kgsl_snapshot to snapshot the
* Adreno specific information for the GMU snapshot. In turn, this function
* calls the GMU specific snapshot function to get core specific information.
*/
void adreno_snapshot_gmu(struct kgsl_device *device,
struct kgsl_snapshot *snapshot)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
/* Add GMU specific sections */
if (gpudev->snapshot_gmu)
gpudev->snapshot_gmu(adreno_dev, snapshot);
}
/*
* adreno_snapshot_cp_roq - Dump CP merciu data in snapshot
* @device: Device being snapshotted

View file

@ -152,8 +152,6 @@ struct kgsl_functable {
unsigned int (*gpuid)(struct kgsl_device *device, unsigned int *chipid);
void (*snapshot)(struct kgsl_device *device,
struct kgsl_snapshot *snapshot, struct kgsl_context *context);
void (*snapshot_gmu)(struct kgsl_device *device,
struct kgsl_snapshot *snapshot);
irqreturn_t (*irq_handler)(struct kgsl_device *device);
int (*drain)(struct kgsl_device *device);
struct kgsl_device_private * (*device_private_create)(void);

View file

@ -704,22 +704,20 @@ void kgsl_device_snapshot(struct kgsl_device *device,
snapshot->size += sizeof(*header);
/* Build the Linux specific header */
/* We either want to only dump GMU, or we want to dump GPU and GMU */
if (gmu_fault) {
/* Dump only the GMU */
if (gmu_fault)
kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_OS,
snapshot, snapshot_os_no_ctxt, NULL);
if (device->ftbl->snapshot_gmu)
device->ftbl->snapshot_gmu(device, snapshot);
} else {
/* Dump GPU and GMU */
snapshot, snapshot_os_no_ctxt, NULL);
else
kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_OS,
snapshot, snapshot_os, NULL);
snapshot, snapshot_os, NULL);
if (device->ftbl->snapshot)
device->ftbl->snapshot(device, snapshot, context);
}
/*
* Trigger both GPU and GMU snapshot. GPU specific code
* will take care of whether to dumps full state or only
* GMU state based on current GPU power state.
*/
if (device->ftbl->snapshot)
device->ftbl->snapshot(device, snapshot, context);
/*
* The timestamp is the seconds since boot so it is easier to match to