diff options
author | Sushmita Susheelendra <ssusheel@codeaurora.org> | 2017-12-15 15:59:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-19 09:53:39 -0500 |
commit | d6b246bb7a29703f53aa4c050b8b3205d749caee (patch) | |
tree | 77fe162f20c56d2c389df44dc17f41c9ebd06aae | |
parent | f292b9b28097d8fe870336108e91bd95a14294bf (diff) |
staging: android: ion: Fix dma direction for dma_sync_sg_for_cpu/device
Use the direction argument passed into begin_cpu_access
and end_cpu_access when calling the dma_sync_sg_for_cpu/device.
The actual cache primitive called depends on the direction
passed in.
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/android/ion/ion.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index a7d9b0e98572..f480885e346b 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c | |||
@@ -346,7 +346,7 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, | |||
346 | mutex_lock(&buffer->lock); | 346 | mutex_lock(&buffer->lock); |
347 | list_for_each_entry(a, &buffer->attachments, list) { | 347 | list_for_each_entry(a, &buffer->attachments, list) { |
348 | dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents, | 348 | dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents, |
349 | DMA_BIDIRECTIONAL); | 349 | direction); |
350 | } | 350 | } |
351 | mutex_unlock(&buffer->lock); | 351 | mutex_unlock(&buffer->lock); |
352 | 352 | ||
@@ -368,7 +368,7 @@ static int ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf, | |||
368 | mutex_lock(&buffer->lock); | 368 | mutex_lock(&buffer->lock); |
369 | list_for_each_entry(a, &buffer->attachments, list) { | 369 | list_for_each_entry(a, &buffer->attachments, list) { |
370 | dma_sync_sg_for_device(a->dev, a->table->sgl, a->table->nents, | 370 | dma_sync_sg_for_device(a->dev, a->table->sgl, a->table->nents, |
371 | DMA_BIDIRECTIONAL); | 371 | direction); |
372 | } | 372 | } |
373 | mutex_unlock(&buffer->lock); | 373 | mutex_unlock(&buffer->lock); |
374 | 374 | ||