gpu: host1x: debug: Use dma_addr_t more consistently
authorThierry Reding <treding@nvidia.com>
Fri, 9 Jul 2021 16:55:18 +0000 (18:55 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 13 Aug 2021 16:23:32 +0000 (18:23 +0200)
The host1x debug code uses a mix of phys_addr_t, dma_addr_t and u32 to
represent addresses. However, these addresses are always DMA addresses
so use the appropriate type.

This fixes some issues with how these addresses are displayed, because
they could be truncated in some cases and not show the full address.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/hw/debug_hw.c

index 35952fd..387ac10 100644 (file)
@@ -156,9 +156,9 @@ static unsigned int show_channel_command(struct output *o, u32 val,
        }
 }
 
-static void show_gather(struct output *o, phys_addr_t phys_addr,
+static void show_gather(struct output *o, dma_addr_t phys_addr,
                        unsigned int words, struct host1x_cdma *cdma,
-                       phys_addr_t pin_addr, u32 *map_addr)
+                       dma_addr_t pin_addr, u32 *map_addr)
 {
        /* Map dmaget cursor to corresponding mem handle */
        u32 offset = phys_addr - pin_addr;
@@ -176,11 +176,11 @@ static void show_gather(struct output *o, phys_addr_t phys_addr,
        }
 
        for (i = 0; i < words; i++) {
-               u32 addr = phys_addr + i * 4;
+               dma_addr_t addr = phys_addr + i * 4;
                u32 val = *(map_addr + offset / 4 + i);
 
                if (!data_count) {
-                       host1x_debug_output(o, "%08x: %08x: ", addr, val);
+                       host1x_debug_output(o, "%pad: %08x: ", &addr, val);
                        data_count = show_channel_command(o, val, &payload);
                } else {
                        host1x_debug_cont(o, "%08x%s", val,