OSDN Git Service

msm: kgsl: Don't read stale crashdumper data
authorLynus Vaz <lvaz@codeaurora.org>
Wed, 13 Sep 2017 14:51:07 +0000 (20:21 +0530)
committerLynus Vaz <lvaz@codeaurora.org>
Mon, 25 Sep 2017 05:42:12 +0000 (11:12 +0530)
After the crashdumper runs once, and the user sets the
snapshot_crashdumper sysfs node to 0, it is possible that stale data
is saved off into the snapshot. Check the value of the sysfs node at
the appropriate place to force a re-read of the data through the
legacy path.

Change-Id: Icf27c39b68d786003c33fd0eb22bd3e8b9a036be
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
drivers/gpu/msm/adreno_a5xx_snapshot.c

index 496fc6a..09effbd 100644 (file)
@@ -765,6 +765,8 @@ static void _a5xx_do_crashdump(struct kgsl_device *device)
 
        crash_dump_valid = false;
 
+       if (!device->snapshot_crashdumper)
+               return;
        if (capturescript.gpuaddr == 0 || registers.gpuaddr == 0)
                return;
 
@@ -870,8 +872,7 @@ void a5xx_snapshot(struct adreno_device *adreno_dev,
                ARRAY_SIZE(a5xx_vbif_snapshot_registers));
 
        /* Try to run the crash dumper */
-       if (device->snapshot_crashdumper)
-               _a5xx_do_crashdump(device);
+       _a5xx_do_crashdump(device);
 
        kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_REGS,
                snapshot, a5xx_snapshot_registers, NULL);