diff options
author | Aurora pro automerger <aurora-pro-automerger@google.com> | 2023-03-14 02:07:34 +0000 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-03-28 22:19:52 -0700 |
commit | ec2e64f0bb54d942059d75ccc7c4ab6daa775f78 (patch) | |
tree | ce23e15e88a8c51e74a637916f0404087ac5459b /gxp-mapping.c | |
parent | 0ffef44f5b07977a5608985c66e7eeaadc29b426 (diff) | |
download | gs201-ec2e64f0bb54d942059d75ccc7c4ab6daa775f78.tar.gz |
gxp: [Copybara Auto Merge] Merge branch 'gs201-u' into 'android13-gs-pixel-5.10-udc'android-u-beta-4_r0.7android-u-beta-4_r0.5android-u-beta-4_r0.4android-u-beta-4_r0.3android-u-beta-4_r0.2android-u-beta-4_r0.1android-u-beta-3_r0.3android-u-beta-3_r0.2android-u-beta-2.1_r0.4android-u-beta-2.1_r0.3android-u-beta-2.1_r0.2android-gs-tangorpro-5.10-u-beta4android-gs-raviole-5.10-u-beta4android-gs-raviole-5.10-u-beta3android-gs-raviole-5.10-u-beta2android-gs-pantah-5.10-u-beta4android-gs-pantah-5.10-u-beta2android-gs-lynx-5.10-u-beta4android-gs-felix-5.10-u-beta4android-gs-bluejay-5.10-u-beta4android-gs-bluejay-5.10-u-beta3android-gs-bluejay-5.10-u-beta2
gxp: fix compiler warning in gxp-thermal
gxp: move fw_rw_section into if-guard
gxp: fix memory leak with invalid telemetry type
Bug: 273254318
gxp: remove unneeded checks in vd.c
gxp: skip configuring when missing VD config
gxp: remove unused host-dev structs
Bug: 265748027
gxp: remove unused range-alloc module
gxp: entirely remove app_metadata
Bug: 265748027 (repeat)
gxp: remove legacy firmware data init
Bug: 265748027 (repeat)
gxp: remove legacy telemetry descriptor
Bug: 265748027 (repeat)
gxp: move system cfg population to device probe
Bug: 265748027 (repeat)
gxp: add gxp_fw_data_system_cfg
Bug: 265748027 (repeat)
gxp: add gxp_fw_data_resource
Bug: 265748027 (repeat)
gxp: bump version 1.11
Bugs:
gxp: fix panic on buffer flushing
Bug: 268389591
gxp: Do not put core in reset if already in ACG
Bug: 272664140
gxp: add cached core telemetry desc
Bug: 265748027 (repeat)
gxp: Adpot GCIP thermal
Bug: 264729080
Bug: 213272324
gxp: remove core_boot parameter
Bug: 251612313
gxp: use GPL-2.0-only license
Bug: 271797962
gxp: authenticates firmware through GSA
Bug: 260533620
gxp: Enable debug dump for imageconfig 2.
Bug: 271371895
gxp: Add size check while loading image to memory
Bug: 265105909
gxp: refactor MCU firmware life cycle
Bug: 233159020
gxp: Create a function for gxp_core_boot
Bug: 271716712
gxp: Increase UCI command timeout to 2 seconds
Bug: 271622596
gxp: remove checks of data_mgr
gxp: skip mapping core resources in MCU mode
gxp: add gxp_firmware_loader module
gxp: log a warning on failing to map CMU reg
gxp: disable out-dated auth mechanism in MCU mode
Bug: 260533620 (repeat)
gxp: refactor core firmware loading
gxp: stop mapping core->TPU queues
gxp: get core_count by counting bits
Bug: 270097855
gxp: set SSMT to bypass in both mode
Bug: 269855604
gxp: Skip gxp_vd_block_unready if gxp_vd_block_ready was not executed
Bug: 268427254
gcip: Make gcip_pm_{get_count,is_powered} lockless
Bug: 271756295
gcip: generalize mem_pool
gcip: utilize mock files on unittests
Bug: 272216562
gcip: use GPL-2.0-only license
Bug: 271797962 (repeat)
gcip: Remove gcip_pm_put_async
Bug: 271756295 (repeat)
gcip: Only call .power_up if needed
gcip: Print GCIP_FW_LOG_LEVEL_FATAL as error message
Bug: 271596603
gcip: Postfix gcip_firmware_tracing_restore
gcip: fix undefined variable on !THERMAL
gcip: always return NULL on domain alloc error
gcip: Add gcip_thermal_destroy
Bug; 264729080 (repeat)
gcip: Add thermal votes
Bug: 271194361
Bug: 264729080 (repeat)
gcip: Cleanup abandoned domains on domain-pool destroy
gcip: Prefix MAX_NUM_THERMAL_STATES
Bug: 264729080 (repeat)
gcip: Add const to thermal_cooling_device_ops
Bug: 264729080 (repeat)
gcip: Add thermal support
Bug: 264729080 (repeat)
gcip: remove redundant else in pm.c
GCIP_MAIN_REV_ID: a5b6843ab58f30d6ce086016214cbf56a46610a8
gcip: Add gcip_pm_lock
Bug: 264729080 (repeat)
gcip: Make gcip_pm_{get_count,is_powered} lockless
Bug: 271756295 (repeat)
gcip: generalize mem_pool
gcip: use GPL-2.0-only license
Bug: 271797962 (repeat)
gcip: Remove gcip_pm_put_async
Bug: 271756295 (repeat)
gcip: Add gcip_pm_trylock
Bug: 271756295 (repeat)
gcip: Add level -3 (FATAL) for firmware log
Bug: 271596603 (repeat)
gcip: Update outdated comments
gcip: Postfix gcip_firmware_tracing_restore
gcip: Add gcip_thermal_destroy
Bug: 264729080 (repeat)
gcip: Add thermal votes
Bug: 271194361 (repeat)
Bug: 264729080 (repeat)
gcip: Add missing includes to gcip-domain-pool.h
gcip: Add list of dynamic domains to domain-pool
gcip: Prefix MAX_NUM_THERMAL_STATES
Bug: 264729080 (repeat)
gcip: add watchdog timeout crash type
Bug:255416846
gcip: Add thermal header
Bug: 264729080 (repeat)
GCIP_HEADERS_REV_ID: 126a2bd1e5ac72231c88425fbddb4b9fe2fd85b1
GitOrigin-RevId: 03d9970af576cb6267f25715de67d4ffd3e2934c
Change-Id: Ia0e7a0d8113d209e0bb57e160bc3f2d89b1d4c5e
Diffstat (limited to 'gxp-mapping.c')
-rw-r--r-- | gxp-mapping.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gxp-mapping.c b/gxp-mapping.c index 398ff05..1a89b1c 100644 --- a/gxp-mapping.c +++ b/gxp-mapping.c @@ -272,6 +272,13 @@ int gxp_mapping_sync(struct gxp_mapping *mapping, u32 offset, u32 size, } /* + * Since the scatter-gather list of the mapping is modified while it is + * being synced, only one sync for a given mapping can occur at a time. + * Rather than maintain a mutex for every mapping, lock the mapping list + * mutex, making all syncs mutually exclusive. + */ + mutex_lock(&mapping->sync_lock); + /* * Mappings are created at a PAGE_SIZE granularity, however other data * which is not part of the mapped buffer may be present in the first * and last pages of the buffer's scattergather list. @@ -302,17 +309,9 @@ int gxp_mapping_sync(struct gxp_mapping *mapping, u32 offset, u32 size, /* Make sure a valid starting scatterlist was found for the start */ if (!start_sg) { ret = -EINVAL; - goto out; + goto out_unlock; } - /* - * Since the scatter-gather list of the mapping is modified while it is - * being synced, only one sync for a given mapping can occur at a time. - * Rather than maintain a mutex for every mapping, lock the mapping list - * mutex, making all syncs mutually exclusive. - */ - mutex_lock(&mapping->sync_lock); - start_sg->offset += start_diff; start_sg->dma_address += start_diff; start_sg->length -= start_diff; @@ -336,8 +335,8 @@ int gxp_mapping_sync(struct gxp_mapping *mapping, u32 offset, u32 size, start_sg->length += start_diff; start_sg->dma_length += start_diff; +out_unlock: mutex_unlock(&mapping->sync_lock); - out: gxp_mapping_put(mapping); |