[PATCH 0/9] drm/panthor: add devcoredump support

Chia-I Wu posted 9 patches 2 months, 2 weeks ago
drivers/gpu/drm/panthor/Makefile           |   2 +
drivers/gpu/drm/panthor/panthor_coredump.c | 617 +++++++++++++++++++++
drivers/gpu/drm/panthor/panthor_coredump.h | 178 ++++++
drivers/gpu/drm/panthor/panthor_device.h   |   6 +
drivers/gpu/drm/panthor/panthor_drv.c      |   3 +-
drivers/gpu/drm/panthor/panthor_mmu.c      |  54 +-
drivers/gpu/drm/panthor/panthor_mmu.h      |   4 +
drivers/gpu/drm/panthor/panthor_regs.h     |   6 +
drivers/gpu/drm/panthor/panthor_sched.c    | 104 ++++
drivers/gpu/drm/panthor/panthor_sched.h    |  14 +
include/uapi/drm/panthor_drm.h             |   7 +
11 files changed, 989 insertions(+), 6 deletions(-)
create mode 100644 drivers/gpu/drm/panthor/panthor_coredump.c
create mode 100644 drivers/gpu/drm/panthor/panthor_coredump.h
[PATCH 0/9] drm/panthor: add devcoredump support
Posted by Chia-I Wu 2 months, 2 weeks ago
This series adds devcoredump support to panthor.

This is written from scratch and is not based on the prior work[1]. The
main differences are

 - coredump triggers on all faulty/fatal/timeout events
 - state capture and state process are two separated steps, with
   GFP_NOWAIT being used for state capture
 - state capture captures both sw states and hw regs that are
   potentially interesting
 - coredump data is in text format, similar to what msm and xe do

A sample devcoredump can be found at
https://gitlab.freedesktop.org/panfrost/linux/-/issues/44

[1] https://lore.kernel.org/lkml/20240821143826.3720-1-daniel.almeida@collabora.com/

Chia-I Wu (9):
  drm/panthor: add devcoredump support
  drm/panthor: capture GPU state for devcoredump
  drm/panthor: capture GLB state for devcoredump
  drm/panthor: capture CSG state for devcoredump
  drm/panthor: capture CS state for devcoredump
  drm/panthor: capture AS state for devcoredump
  drm/panthor: capture VMA state for devcoredump
  drm/panthor: check bo offset alignment in vm bind
  drm/panthor: add DRM_PANTHOR_VM_BIND_OP_MAP_DUMPABLE

 drivers/gpu/drm/panthor/Makefile           |   2 +
 drivers/gpu/drm/panthor/panthor_coredump.c | 617 +++++++++++++++++++++
 drivers/gpu/drm/panthor/panthor_coredump.h | 178 ++++++
 drivers/gpu/drm/panthor/panthor_device.h   |   6 +
 drivers/gpu/drm/panthor/panthor_drv.c      |   3 +-
 drivers/gpu/drm/panthor/panthor_mmu.c      |  54 +-
 drivers/gpu/drm/panthor/panthor_mmu.h      |   4 +
 drivers/gpu/drm/panthor/panthor_regs.h     |   6 +
 drivers/gpu/drm/panthor/panthor_sched.c    | 104 ++++
 drivers/gpu/drm/panthor/panthor_sched.h    |  14 +
 include/uapi/drm/panthor_drm.h             |   7 +
 11 files changed, 989 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/panthor/panthor_coredump.c
 create mode 100644 drivers/gpu/drm/panthor/panthor_coredump.h

-- 
2.50.0.727.gbf7dc18ff4-goog
Re: [PATCH 0/9] drm/panthor: add devcoredump support
Posted by Daniel Almeida 2 months, 2 weeks ago
Hi Chia-I Wu :)

> On 19 Jul 2025, at 21:01, Chia-I Wu <olvaffe@gmail.com> wrote:
> 
> This series adds devcoredump support to panthor.
> 
> This is written from scratch and is not based on the prior work[1]. The
> main differences are

I wonder why this was started from scratch? IIRC, that work stopped, among
other things, because we were not sure about what exactly to include in the
dump. I don't think it warranted a completely new implementation, IMHO.

Do you plan to work on the userspace part as well?

-- Daniel
Re: [PATCH 0/9] drm/panthor: add devcoredump support
Posted by Chia-I Wu 2 months, 2 weeks ago
On Sat, Jul 19, 2025 at 5:41 PM Daniel Almeida
<daniel.almeida@collabora.com> wrote:
>
> Hi Chia-I Wu :)
>
> > On 19 Jul 2025, at 21:01, Chia-I Wu <olvaffe@gmail.com> wrote:
> >
> > This series adds devcoredump support to panthor.
> >
> > This is written from scratch and is not based on the prior work[1]. The
> > main differences are
>
> I wonder why this was started from scratch? IIRC, that work stopped, among
> other things, because we were not sure about what exactly to include in the
> dump. I don't think it warranted a completely new implementation, IMHO.
As noted in the listed differences, this impl triggers coredumps in
more places (e.g., mmu faults), captures lower-level hw regs,
separates capturing and processing, and outputs in text format.  It
turns out there is little code that can be inherited from the prior
work.

It also does not support dumping successful jobs.

>
> Do you plan to work on the userspace part as well?
Yes, there is a very early tool in
https://gitlab.freedesktop.org/panfrost/linux/-/issues/44.  There is
also a sample dump that shows the raw dump, the decoded one, and the
decoded ringbufs / cmdbufs.

>
> -- Daniel
>