diff options
author | Neela Chithirala <chithiralan@google.com> | 2022-03-03 05:17:38 +0000 |
---|---|---|
committer | Neela Chithirala <chithiralan@google.com> | 2022-03-07 05:11:37 +0000 |
commit | 6d71338807ebff13916d2285d67ce59f261eab3e (patch) | |
tree | dd3bbbaab5286ec315807569c72fe790f8fea61d /gxp-mapping.c | |
parent | 49087428c8fea8eb57a4f57f4fe83e0d2f26b113 (diff) | |
download | gs201-6d71338807ebff13916d2285d67ce59f261eab3e.tar.gz |
Merge branch 'gs201-release' to android13-gs-pixel-5.10
* gs201-release:
gxp: create own queue for power state transition
Bug: 221187219
gxp: Fix checkpatch errors
gxp: lower the default power state
Bug: 201600514
gxp: support memory power state operation
Bug: 201600514
gxp: change power state asynchronously
Bug: 221187219
gxp: Support for mapping and unmapping dma-bufs
Bug: 177224744
gxp: Remove extra call to gxp_pm_init() on probe
gxp: support power state voting by wakelock IOCTL
Bug: 201600514
gxp: add firmware authentication support
Bug: 218949590
GitOrigin-RevId: ae2f794c392b0357bbad0f6b84c71896b9e61185
Change-Id: I42bf2d5a834700059b4e8f145b8a78a27aa7b668
Signed-off-by: Neela Chithirala <chithiralan@google.com>
Change-Id: Id2ea88150f661804c06455924b799640c38b0480
Diffstat (limited to 'gxp-mapping.c')
-rw-r--r-- | gxp-mapping.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gxp-mapping.c b/gxp-mapping.c index 95873c0..5db126b 100644 --- a/gxp-mapping.c +++ b/gxp-mapping.c @@ -324,6 +324,12 @@ struct gxp_mapping *gxp_mapping_get_host(struct gxp_dev *gxp, u64 host_address) mutex_lock(&gxp->mappings->lock); + if (!host_address) { + dev_warn(gxp->dev, + "Unable to get dma-buf mapping by host address\n"); + return NULL; + } + /* Iterate through the elements in the rbtree */ for (node = rb_first(&gxp->mappings->rb); node; node = rb_next(node)) { this = rb_entry(node, struct gxp_mapping, node); @@ -340,5 +346,9 @@ struct gxp_mapping *gxp_mapping_get_host(struct gxp_dev *gxp, u64 host_address) void gxp_mapping_remove(struct gxp_dev *gxp, struct gxp_mapping *map) { + mutex_lock(&gxp->mappings->lock); + rb_erase(&map->node, &gxp->mappings->rb); + + mutex_unlock(&gxp->mappings->lock); } |