Loading drivers/staging/android/ion/ion.c +7 −2 Original line number Diff line number Diff line Loading @@ -126,6 +126,9 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, if (!(heap->flags & ION_HEAP_FLAG_DEFER_FREE)) goto err2; if (ret == -EINTR) goto err2; ion_heap_freelist_drain(heap, 0); ret = heap->ops->allocate(heap, buffer, len, flags); if (ret) Loading Loading @@ -559,8 +562,10 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl, sg_dma_addr = sg_dma_address(sg); len += sg->length; if (len <= offset) if (len <= offset) { sg_dma_addr += sg->length; continue; } sg_left = len - offset; sg_offset = sg->length - sg_left; Loading Loading @@ -1062,7 +1067,7 @@ struct dma_buf *ion_alloc_dmabuf(size_t len, unsigned int heap_id_mask, if (!((1 << heap->id) & heap_id_mask)) continue; buffer = ion_buffer_create(heap, dev, len, flags); if (!IS_ERR(buffer)) if (!IS_ERR(buffer) || PTR_ERR(buffer) == -EINTR) break; } up_read(&dev->lock); Loading drivers/staging/android/ion/ion_page_pool.c +4 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/swap.h> #include <linux/sched/signal.h> #include "ion.h" Loading Loading @@ -81,6 +82,9 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool, bool *from_pool) BUG_ON(!pool); if (fatal_signal_pending(current)) return ERR_PTR(-EINTR); if (*from_pool && mutex_trylock(&pool->mutex)) { if (pool->high_count) page = ion_page_pool_remove(pool, true); Loading Loading
drivers/staging/android/ion/ion.c +7 −2 Original line number Diff line number Diff line Loading @@ -126,6 +126,9 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, if (!(heap->flags & ION_HEAP_FLAG_DEFER_FREE)) goto err2; if (ret == -EINTR) goto err2; ion_heap_freelist_drain(heap, 0); ret = heap->ops->allocate(heap, buffer, len, flags); if (ret) Loading Loading @@ -559,8 +562,10 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl, sg_dma_addr = sg_dma_address(sg); len += sg->length; if (len <= offset) if (len <= offset) { sg_dma_addr += sg->length; continue; } sg_left = len - offset; sg_offset = sg->length - sg_left; Loading Loading @@ -1062,7 +1067,7 @@ struct dma_buf *ion_alloc_dmabuf(size_t len, unsigned int heap_id_mask, if (!((1 << heap->id) & heap_id_mask)) continue; buffer = ion_buffer_create(heap, dev, len, flags); if (!IS_ERR(buffer)) if (!IS_ERR(buffer) || PTR_ERR(buffer) == -EINTR) break; } up_read(&dev->lock); Loading
drivers/staging/android/ion/ion_page_pool.c +4 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/swap.h> #include <linux/sched/signal.h> #include "ion.h" Loading Loading @@ -81,6 +82,9 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool, bool *from_pool) BUG_ON(!pool); if (fatal_signal_pending(current)) return ERR_PTR(-EINTR); if (*from_pool && mutex_trylock(&pool->mutex)) { if (pool->high_count) page = ion_page_pool_remove(pool, true); Loading