diff options
author | Neela Chithirala <chithiralan@google.com> | 2022-01-17 04:41:54 +0000 |
---|---|---|
committer | Neela Chithirala <chithiralan@google.com> | 2022-02-03 06:27:20 +0000 |
commit | 3ccb2479717de3089dbbcb894ddd045b2ddc256c (patch) | |
tree | a577f284ff42d11b1fcfb7c338a7f0b59b10672a /gxp-debug-dump.c | |
parent | e14069f1739b05c7a7f60ae73c8ce14b91ef12e0 (diff) | |
download | gs201-3ccb2479717de3089dbbcb894ddd045b2ddc256c.tar.gz |
Merge branch 'gs201-release' to android13-gs-pixel-5.10
* gs201-release:
gxp: Fix multicore VDs not shutting down clean
Bug: 215303765
gxp: Rework VD locking and remove mailbox locking
Bug: 189018271
gxp: initial commit for thermal driver
Bug: 177217526
gxp: Add wakelock interface and make debugfs wakelock aware
Bug: 215192870
gxp: Hook-up pm ops for driver suspend/resume
Bug: 204924965
gxp: Dynamically power BLK_AUR on and off
Bug: 204924965
gxp: support GXP_PLATFORM=GEM5
Bug: 204942713
gxp: Remove delay waiting for FW mailbox init
Bug: 207037428
gxp: Fix infrequent crash during mailbox release
gxp: Release FW file on firmware loading errors
gxp: return GXP_RESP_CANCELLED if timeout occurs
Bug: 207432733
gxp: Remove initial 10ms delay when disabling telemetry
gxp: Cast telemetry buffer IOVAs to u32s before use
gxp: check sscoredump by CONFIG_SUBSYSTEM_COREDUMP
gxp: Fix double-lock hang in gxp_telemetry_vma_close
gxp: Log driver git commit hash on probe
Bug: 206744969
gxp: Add ioctl for reading the TOP global counter
gxp: Implement eventfd signalling for telemetry
gxp: Notify running cores of telemetry state changes
gxp: Add notification interface
Signed-off-by: Neela Chithirala <chithiralan@google.com>
Change-Id: Ic7cd7b81ee643371c600ac208ae33d6344ed7f1b
Diffstat (limited to 'gxp-debug-dump.c')
-rw-r--r-- | gxp-debug-dump.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/gxp-debug-dump.c b/gxp-debug-dump.c index ea0339d..5c7ae61 100644 --- a/gxp-debug-dump.c +++ b/gxp-debug-dump.c @@ -13,7 +13,7 @@ #include <linux/string.h> #include <linux/workqueue.h> -#ifdef CONFIG_ANDROID +#if IS_ENABLED(CONFIG_SUBSYSTEM_COREDUMP) #include <linux/platform_data/sscoredump.h> #endif @@ -21,7 +21,6 @@ #include "gxp-doorbell.h" #include "gxp-internal.h" #include "gxp-lpm.h" -#include "gxp-mailbox.h" #include "gxp-tmp.h" #define GXP_COREDUMP_PENDING 0xF @@ -251,7 +250,7 @@ static void gxp_handle_debug_dump(struct gxp_dev *gxp, struct gxp_core_dump_header *core_dump_header; struct gxp_core_header *core_header; int i; -#ifdef CONFIG_ANDROID +#if IS_ENABLED(CONFIG_SUBSYSTEM_COREDUMP) struct sscd_platform_data *pdata = (struct sscd_platform_data *)gxp->debug_dump_mgr->sscd_pdata; struct sscd_segment *segs; @@ -289,7 +288,7 @@ static void gxp_handle_debug_dump(struct gxp_dev *gxp, data_addr += segs[seg_idx].size; seg_idx++; } -#endif // CONFIG_ANDROID +#endif // CONFIG_SUBSYSTEM_COREDUMP /* Core */ for (i = 0; i < GXP_NUM_CORES; i++) { @@ -304,7 +303,7 @@ static void gxp_handle_debug_dump(struct gxp_dev *gxp, goto out; } -#ifdef CONFIG_ANDROID +#if IS_ENABLED(CONFIG_SUBSYSTEM_COREDUMP) /* Core Header */ segs[seg_idx].addr = core_header; segs[seg_idx].size = sizeof(struct gxp_core_header); @@ -347,7 +346,7 @@ static void gxp_handle_debug_dump(struct gxp_dev *gxp, */ msleep(1000); mutex_unlock(&gxp->debug_dump_mgr->sscd_lock); -#endif // CONFIG_ANDROID +#endif // CONFIG_SUBSYSTEM_COREDUMP /* This bit signals that core dump has been processed */ core_header->dump_available = 0; @@ -357,7 +356,7 @@ static void gxp_handle_debug_dump(struct gxp_dev *gxp, } out: -#ifdef CONFIG_ANDROID +#if IS_ENABLED(CONFIG_SUBSYSTEM_COREDUMP) kfree(segs); #endif return; @@ -430,10 +429,11 @@ static void gxp_wait_kernel_init_dump_work(struct work_struct *work) void gxp_debug_dump_process_dump(struct work_struct *work) { - struct gxp_mailbox *mailbox = container_of(work, struct gxp_mailbox, - debug_dump_work); - uint core_id = mailbox->core_id; - struct gxp_dev *gxp = mailbox->gxp; + struct gxp_debug_dump_work *debug_dump_work = + container_of(work, struct gxp_debug_dump_work, work); + + uint core_id = debug_dump_work->core_id; + struct gxp_dev *gxp = debug_dump_work->gxp; struct gxp_debug_dump_manager *mgr; struct gxp_core_dump *core_dump; struct gxp_core_dump_header *core_dump_header; @@ -473,6 +473,17 @@ void gxp_debug_dump_process_dump(struct work_struct *work) } } +struct work_struct *gxp_debug_dump_get_notification_handler(struct gxp_dev *gxp, + uint core) +{ + struct gxp_debug_dump_manager *mgr = gxp->debug_dump_mgr; + + if (!mgr) + return NULL; + + return &mgr->debug_dump_works[core].work; +} + int gxp_debug_dump_init(struct gxp_dev *gxp, void *sscd_dev, void *sscd_pdata) { struct resource r; @@ -513,6 +524,11 @@ int gxp_debug_dump_init(struct gxp_dev *gxp, void *sscd_dev, void *sscd_pdata) for (core = 0; core < GXP_NUM_CORES; core++) { core_dump_header = &mgr->core_dump->core_dump_header[core]; core_dump_header->core_header.dump_available = 0; + + mgr->debug_dump_works[core].gxp = gxp; + mgr->debug_dump_works[core].core_id = core; + INIT_WORK(&mgr->debug_dump_works[core].work, + gxp_debug_dump_process_dump); } /* No need for a DMA handle since the carveout is coherent */ |