habanalabs: user mappings can be 64-bit
authorOded Gabbay <ogabbay@kernel.org>
Tue, 29 Jun 2021 15:12:46 +0000 (18:12 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 29 Aug 2021 06:47:45 +0000 (09:47 +0300)
Increase the size variable in the userptr structure to 64-bit. That
variable describes the size of the memory allocation of the user that
is now being mapped into the device. The mapping can be larger than
4GB, so we need to support it.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/debugfs.c
drivers/misc/habanalabs/common/habanalabs.h

index fd44c3b66d3bc5366f0ca8e4ea0a086ccdb0b7b5..77f7c2aa571da89f73ca2bd597bbc0fff13129e0 100644 (file)
@@ -213,7 +213,7 @@ static int userptr_show(struct seq_file *s, void *data)
                        seq_puts(s, "----------------------------------------------------------\n");
                }
                seq_printf(s,
-                       "    0x%-14llx      %-10u    %-30s\n",
+                       "    0x%-14llx      %-10llu    %-30s\n",
                        userptr->addr, userptr->size, dma_dir[userptr->dir]);
        }
 
@@ -261,7 +261,7 @@ static int vm_show(struct seq_file *s, void *data)
                        if (*vm_type == VM_TYPE_USERPTR) {
                                userptr = hnode->ptr;
                                seq_printf(s,
-                                       "    0x%-14llx      %-10u\n",
+                                       "    0x%-14llx      %-10llu\n",
                                        hnode->vaddr, userptr->size);
                        } else {
                                phys_pg_pack = hnode->ptr;
index 31fda9e41fe7118ce08004adc6cdecd7a0f935f9..5ae95d2abaa6adf3f86fb2db0787651715fb2b88 100644 (file)
@@ -1429,7 +1429,7 @@ struct hl_userptr {
        enum dma_data_direction dir;
        struct list_head        debugfs_list;
        u64                     addr;
-       u32                     size;
+       u64                     size;
        u8                      dma_mapped;
 };