summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Kalia <vinaykalia@google.com>2022-06-28 01:00:29 +0000
committerVinay Kalia <vinaykalia@google.com>2022-06-30 22:05:55 +0000
commita1c535151fb58e765ef327f9bcd408b2e4112876 (patch)
treeb90c7328b9c25ed1ff1afd43da1c828cea812f22
parent71f6ca8d99bb9b573359e91b435ba34a1288cbce (diff)
downloadgchips-a1c535151fb58e765ef327f9bcd408b2e4112876.tar.gz
bigocean: Allow unmapping of buffers while HW is busy
Revert the workaround made for b/180443732 as it is no longer applicable. bug: 233707844 Signed-off-by: Vinay Kalia <vinaykalia@google.com> Change-Id: I0e784cced9037f8e0f26097402b3f051a8756e77
-rw-r--r--bigo_iommu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/bigo_iommu.c b/bigo_iommu.c
index f59d279..029dd3d 100644
--- a/bigo_iommu.c
+++ b/bigo_iommu.c
@@ -15,16 +15,12 @@
#include "bigo_iommu.h"
-static void bigo_unmap_one(struct bigo_core *core, struct bufinfo *binfo)
+static void bigo_unmap_one(struct bufinfo *binfo)
{
- /* This lock is needed to unmap. Look @ b/180443732 */
- mutex_lock(&core->lock);
- binfo->attachment->dma_map_attrs |= DMA_ATTR_SKIP_LAZY_UNMAP;
dma_buf_unmap_attachment(binfo->attachment, binfo->sgt,
DMA_BIDIRECTIONAL);
dma_buf_detach(binfo->dmabuf, binfo->attachment);
dma_buf_put(binfo->dmabuf);
- mutex_unlock(&core->lock);
}
void bigo_unmap_all(struct bigo_inst *inst)
@@ -34,7 +30,7 @@ void bigo_unmap_all(struct bigo_inst *inst)
mutex_lock(&inst->lock);
list_for_each_entry_safe(curr, next, &inst->buffers, list) {
list_del(&curr->list);
- bigo_unmap_one(inst->core, curr);
+ bigo_unmap_one(curr);
kfree(curr);
}
mutex_unlock(&inst->lock);
@@ -136,7 +132,7 @@ int bigo_unmap(struct bigo_inst *inst, struct bigo_ioc_mapping *mapping)
if (!found)
return -ENOENT;
- bigo_unmap_one(inst->core, found);
+ bigo_unmap_one(found);
kfree(found);
return 0;
}