summaryrefslogtreecommitdiff
path: root/drivers/soc/ti/knav_qmss_queue.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-12-07 14:46:59 (GMT)
committerArnd Bergmann <arnd@arndb.de>2016-02-26 16:53:06 (GMT)
commitcc0336ec8a0cc7f83588019850ebe97df32c304c (patch)
tree7971bb2799b4654a1010452eed422e9740b7ad0a /drivers/soc/ti/knav_qmss_queue.c
parentd9fa15a56ac4b2e0176cb46fedffce081b14d91b (diff)
downloadlinux-cc0336ec8a0cc7f83588019850ebe97df32c304c.tar.xz
soc: TI knav_qmss: fix dma_addr_t printing
The knav_qmss driver is currently broken when CONFIG_LPAE is set, which is a bit surprising because I'd expect that any serious users of this platforms would have more than 2GB of RAM and require LPAE. The compiler clearly warns about an incorrect use of dma_addr_t in the debug kernel messages: ti/knav_qmss_queue.c: In function 'knav_queue_setup_region': ti/knav_qmss_queue.c:1025:117: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] ti/knav_qmss_queue.c:1025:117: warning: format '%x' expects argument of type 'unsigned int', but argument 10 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] ti/knav_qmss_queue.c: In function 'knav_queue_setup_link_ram': ti/knav_qmss_queue.c:1175:118: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] This patch changes all the debugging output to use the correct %pad format string that works with both 32-bit and 64-bit dma_addr_t. As the variable naming is somewhat confusing here, I also change all *_phys names to *_dma when they refer to bus addresses that are used for DMA rather than a physical memory address as seen from the CPU. This is particularly important on keystone, because the two things are not the same there. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/soc/ti/knav_qmss_queue.c')
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 8c03a80..b73e353 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1023,9 +1023,9 @@ static void knav_queue_setup_region(struct knav_device *kdev,
list_add(&pool->region_inst, &region->pools);
dev_dbg(kdev->dev,
- "region %s (%d): size:%d, link:%d@%d, phys:%08x-%08x, virt:%p-%p\n",
+ "region %s (%d): size:%d, link:%d@%d, dma:%pad-%pad, virt:%p-%p\n",
region->name, id, region->desc_size, region->num_desc,
- region->link_index, region->dma_start, region->dma_end,
+ region->link_index, &region->dma_start, &region->dma_end,
region->virt_start, region->virt_end);
hw_desc_size = (region->desc_size / 16) - 1;
@@ -1033,7 +1033,7 @@ static void knav_queue_setup_region(struct knav_device *kdev,
for_each_qmgr(kdev, qmgr) {
regs = qmgr->reg_region + id;
- writel_relaxed(region->dma_start, &regs->base);
+ writel_relaxed((u32)region->dma_start, &regs->base);
writel_relaxed(region->link_index, &regs->start_index);
writel_relaxed(hw_desc_size << 16 | hw_num_desc,
&regs->size_count);
@@ -1145,14 +1145,14 @@ static int knav_get_link_ram(struct knav_device *kdev,
* queue_base specified => using internal or onchip
* link ram WARNING - we do not "reserve" this block
*/
- block->phys = (dma_addr_t)temp[0];
+ block->dma = (dma_addr_t)temp[0];
block->virt = NULL;
block->size = temp[1];
} else {
block->size = temp[1];
/* queue_base not specific => allocate requested size */
block->virt = dmam_alloc_coherent(kdev->dev,
- 8 * block->size, &block->phys,
+ 8 * block->size, &block->dma,
GFP_KERNEL);
if (!block->virt) {
dev_err(kdev->dev, "failed to alloc linkram\n");
@@ -1172,18 +1172,18 @@ static int knav_queue_setup_link_ram(struct knav_device *kdev)
for_each_qmgr(kdev, qmgr) {
block = &kdev->link_rams[0];
- dev_dbg(kdev->dev, "linkram0: phys:%x, virt:%p, size:%x\n",
- block->phys, block->virt, block->size);
- writel_relaxed(block->phys, &qmgr->reg_config->link_ram_base0);
+ dev_dbg(kdev->dev, "linkram0: dma:%pad, virt:%p, size:%x\n",
+ &block->dma, block->virt, block->size);
+ writel_relaxed((u32)block->dma, &qmgr->reg_config->link_ram_base0);
writel_relaxed(block->size, &qmgr->reg_config->link_ram_size0);
block++;
if (!block->size)
continue;
- dev_dbg(kdev->dev, "linkram1: phys:%x, virt:%p, size:%x\n",
- block->phys, block->virt, block->size);
- writel_relaxed(block->phys, &qmgr->reg_config->link_ram_base1);
+ dev_dbg(kdev->dev, "linkram1: dma:%pad, virt:%p, size:%x\n",
+ &block->dma, block->virt, block->size);
+ writel_relaxed(block->dma, &qmgr->reg_config->link_ram_base1);
}
return 0;