From b6ecf576cde309bbf6ba8faaf6464cb0aeb3bb19 Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Fri, 24 Feb 2012 13:11:10 -0800 Subject: [PATCH] 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 --- drivers/gpu/ion/ion.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 1146e7d5ceb..05dda04f6c2 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -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