]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/staging/android/ion/ion.c
Merge remote-tracking branch 'dma-buf/for-next'
[karo-tx-linux.git] / drivers / staging / android / ion / ion.c
index 204860a36c29178e96c975f16ae555ff14824f86..b0b96ab31954a98718d1af05121656abc1533e17 100644 (file)
@@ -566,8 +566,8 @@ int ion_phys(struct ion_client *client, struct ion_handle *handle,
        buffer = handle->buffer;
 
        if (!buffer->heap->ops->phys) {
-               pr_err("%s: ion_phys is not implemented by this heap.\n",
-                      __func__);
+               pr_err("%s: ion_phys is not implemented by this heap (name=%s, type=%d).\n",
+                       __func__, buffer->heap->name, buffer->heap->type);
                mutex_unlock(&client->lock);
                return -ENODEV;
        }
@@ -1400,7 +1400,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
        size_t total_size = 0;
        size_t total_orphaned_size = 0;
 
-       seq_printf(s, "%16.s %16.s %16.s\n", "client", "pid", "size");
+       seq_printf(s, "%16s %16s %16s\n", "client", "pid", "size");
        seq_puts(s, "----------------------------------------------------\n");
 
        for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
@@ -1414,10 +1414,10 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
                        char task_comm[TASK_COMM_LEN];
 
                        get_task_comm(task_comm, client->task);
-                       seq_printf(s, "%16.s %16u %16zu\n", task_comm,
+                       seq_printf(s, "%16s %16u %16zu\n", task_comm,
                                   client->pid, size);
                } else {
-                       seq_printf(s, "%16.s %16u %16zu\n", client->name,
+                       seq_printf(s, "%16s %16u %16zu\n", client->name,
                                   client->pid, size);
                }
        }
@@ -1431,7 +1431,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
                        continue;
                total_size += buffer->size;
                if (!buffer->handle_count) {
-                       seq_printf(s, "%16.s %16u %16zu %d %d\n",
+                       seq_printf(s, "%16s %16u %16zu %d %d\n",
                                   buffer->task_comm, buffer->pid,
                                   buffer->size, buffer->kmap_cnt,
                                   atomic_read(&buffer->ref.refcount));
@@ -1440,11 +1440,11 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
        }
        mutex_unlock(&dev->buffer_lock);
        seq_puts(s, "----------------------------------------------------\n");
-       seq_printf(s, "%16.s %16zu\n", "total orphaned",
+       seq_printf(s, "%16s %16zu\n", "total orphaned",
                   total_orphaned_size);
-       seq_printf(s, "%16.s %16zu\n", "total ", total_size);
+       seq_printf(s, "%16s %16zu\n", "total ", total_size);
        if (heap->flags & ION_HEAP_FLAG_DEFER_FREE)
-               seq_printf(s, "%16.s %16zu\n", "deferred free",
+               seq_printf(s, "%16s %16zu\n", "deferred free",
                                heap->free_list_size);
        seq_puts(s, "----------------------------------------------------\n");
 
@@ -1513,6 +1513,9 @@ void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap)
                pr_err("%s: can not add heap with invalid ops struct.\n",
                       __func__);
 
+       spin_lock_init(&heap->free_lock);
+       heap->free_list_size = 0;
+
        if (heap->flags & ION_HEAP_FLAG_DEFER_FREE)
                ion_heap_init_deferred_free(heap);