From 0ffef44f5b07977a5608985c66e7eeaadc29b426 Mon Sep 17 00:00:00 2001 From: Aurora pro automerger Date: Fri, 17 Feb 2023 09:18:51 +0000 Subject: gxp: [Copybara Auto Merge] Merge branch 'gs201-u' into 'android13-gs-pixel-5.10-udc' gcip: fixup: Use devm_* for gcip-pm Bug: 265870718 gcip: Use devm_* for gcip-pm Bug: 265870718 (repeat) gcip: Remove the start log of async power down Bug: 265870718 (repeat) gcip: Add firmware dynamic tracing support Bug: 262916889 gcip: Add PM support Bug: 265870718 (repeat) GCIP_MAIN_REV_ID: c359c8b4c8e11ff2655dbfd8457605b760db383c gxp: remove redundant domain_attach from vd resume Bug: 269587251 gxp: bump version 1.10 Bug: 269587251 (repeat) gxp: move domain detach to block_unready Bug: 269587251 (repeat) gxp: add mcu_crashed flag to gxp_virtual_device Bug: 269587251 (repeat) gxp: use MCU PSM to handle MCU fw crash Bug: 264621513 gxp: add IDs to VD suspend/resume log gxp: skip suspend/resume in full MCU mode Bug: 269717931 gxp: load core FW only once per image Bug: 267713927 gxp: Adopt GCIP PM Bug: 265870718 (repeat) gxp: Log the clients with a wakelock in gxp_platform_suspend Bug: 265870718 (repeat) gxp: Remove suspended from gxp_wakelock_manager Bug: 265870718 (repeat) gxp: support loading DSP core FW in raw binary format Bug: 259215977 gxp: introduce gxp_vd_invalidate_with_client_id Bug: 263994153 gxp: introduce gxp_vd_generate_debug_dump Bug: 263994153 (repeat) gxp: move vd_invalid_eventfd from client to vd Bug: 263994153 (repeat) gxp: gxp_vd_block_unready needs vd_semaphore write lock Bug: 263994153 (repeat) gxp: bump to version 1.9 Bug: 245751727 Bug: 268449263 gxp: unittest: add a unittest for gxp_mapping_iova_log Bug: 245751727 (repeat) gxp: Add a module flag to enable IOVA-space logging Bug: 245751727 (repeat) gxp: introduce debug_dump_lock per vd Bug: 234172464 gxp: gxp_vd_{run,stop} holds vd_sema for writing Bug: 234172464 (repeat) gxp: pass vd to the static functions of debug dump Bug: 234172464 (repeat) gcip: Add a comment about suspend/resume in gcip-pm Bug: 265870718 (repeat) gcip: Add firmware dynamic tracing header Bug: 262916889 (repeat) gcip: Add PM header Bug: 265870718 (repeat) GCIP_HEADERS_REV_ID: 21105099cc4be7a0fec32f06f34cce5026015601 GitOrigin-RevId: 775c7ff3381a68301beb1d3b790d0954e211244c Change-Id: I9637cc7a2ef6bc3b8b184035834ac1ab13ebafb4 --- gxp-mapping.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'gxp-mapping.c') diff --git a/gxp-mapping.c b/gxp-mapping.c index 0188fad..398ff05 100644 --- a/gxp-mapping.c +++ b/gxp-mapping.c @@ -6,16 +6,51 @@ */ #include +#include #include #include +#include #include #include +#include "gxp-client.h" #include "gxp-debug-dump.h" #include "gxp-dma.h" #include "gxp-internal.h" #include "gxp-mapping.h" +#if IS_ENABLED(CONFIG_GXP_TEST) +/* expose this variable to have unit tests set it dynamically */ +bool gxp_log_iova; +#else +static bool gxp_log_iova; +#endif + +module_param_named(log_iova, gxp_log_iova, bool, 0660); + +void gxp_mapping_iova_log(struct gxp_client *client, struct gxp_mapping *map, + u8 mask) +{ + static bool is_first_log = true; + struct device *dev = client->gxp->dev; + const char *op = mask & GXP_IOVA_LOG_MAP ? "MAP" : "UNMAP"; + const char *buf_type = mask & GXP_IOVA_LOG_DMABUF ? "DMABUF" : "BUFFER"; + + if (likely(!gxp_log_iova)) + return; + + if (is_first_log) { + dev_info( + dev, + "iova_log_start: operation, buf_type, tgid, pid, host_address, device_address, size"); + is_first_log = false; + } + + dev_info(dev, "iova_log: %s, %s, %d, %d, %#llx, %#llx, %zu", op, + buf_type, client->pid, client->tgid, map->host_address, + map->device_address, map->size); +} + /* Destructor for a mapping created with `gxp_mapping_create()` */ static void destroy_mapping(struct gxp_mapping *mapping) { -- cgit v1.2.3