gpu: ion: Do not allow cached IOMMU mappings.
Cached IOMMU mapping is not supported. Add check for clients trying to map buffers into IOMMU as cached and return error. Change-Id: Ic63a24bf651d613933633cd81143701f66df566c Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
243ec126f7
commit
b6ecf576cd
@@ -611,6 +611,11 @@ int ion_map_iommu(struct ion_client *client, struct ion_handle *handle,
|
||||
struct ion_iommu_map *iommu_map;
|
||||
int ret = 0;
|
||||
|
||||
if (ION_IS_CACHED(flags)) {
|
||||
pr_err("%s: Cannot map iommu as cached.\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&client->lock);
|
||||
if (!ion_handle_validate(client, handle)) {
|
||||
pr_err("%s: invalid handle passed to map_kernel.\n",
|
||||
@@ -629,11 +634,6 @@ int ion_map_iommu(struct ion_client *client, struct ion_handle *handle,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ion_validate_buffer_flags(buffer, flags)) {
|
||||
ret = -EEXIST;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* If clients don't want a custom iova length, just use whatever
|
||||
* the buffer size is
|
||||
|
||||
Reference in New Issue
Block a user