Commit ca194c38 authored by Anup Patel's avatar Anup Patel Committed by Jassi Brar

mailbox: bcm-flexrm-mailbox: Print ring number in errors and warnings

This patch updates all dev_err() and dev_warn() to print
ring number so that we have more info for debugging.
Signed-off-by: default avatarAnup Patel <anup.patel@broadcom.com>
Reviewed-by: default avatarScott Branden <scott.branden@broadcom.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent a371c10e
...@@ -1116,8 +1116,8 @@ static int flexrm_process_completions(struct flexrm_ring *ring) ...@@ -1116,8 +1116,8 @@ static int flexrm_process_completions(struct flexrm_ring *ring)
err = flexrm_cmpl_desc_to_error(desc); err = flexrm_cmpl_desc_to_error(desc);
if (err < 0) { if (err < 0) {
dev_warn(ring->mbox->dev, dev_warn(ring->mbox->dev,
"got completion desc=0x%lx with error %d", "ring%d got completion desc=0x%lx with error %d\n",
(unsigned long)desc, err); ring->num, (unsigned long)desc, err);
} }
/* Determine request id from completion descriptor */ /* Determine request id from completion descriptor */
...@@ -1127,8 +1127,8 @@ static int flexrm_process_completions(struct flexrm_ring *ring) ...@@ -1127,8 +1127,8 @@ static int flexrm_process_completions(struct flexrm_ring *ring)
msg = ring->requests[reqid]; msg = ring->requests[reqid];
if (!msg) { if (!msg) {
dev_warn(ring->mbox->dev, dev_warn(ring->mbox->dev,
"null msg pointer for completion desc=0x%lx", "ring%d null msg pointer for completion desc=0x%lx\n",
(unsigned long)desc); ring->num, (unsigned long)desc);
continue; continue;
} }
...@@ -1238,7 +1238,9 @@ static int flexrm_startup(struct mbox_chan *chan) ...@@ -1238,7 +1238,9 @@ static int flexrm_startup(struct mbox_chan *chan)
ring->bd_base = dma_pool_alloc(ring->mbox->bd_pool, ring->bd_base = dma_pool_alloc(ring->mbox->bd_pool,
GFP_KERNEL, &ring->bd_dma_base); GFP_KERNEL, &ring->bd_dma_base);
if (!ring->bd_base) { if (!ring->bd_base) {
dev_err(ring->mbox->dev, "can't allocate BD memory\n"); dev_err(ring->mbox->dev,
"can't allocate BD memory for ring%d\n",
ring->num);
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }
...@@ -1261,7 +1263,9 @@ static int flexrm_startup(struct mbox_chan *chan) ...@@ -1261,7 +1263,9 @@ static int flexrm_startup(struct mbox_chan *chan)
ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool, ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool,
GFP_KERNEL, &ring->cmpl_dma_base); GFP_KERNEL, &ring->cmpl_dma_base);
if (!ring->cmpl_base) { if (!ring->cmpl_base) {
dev_err(ring->mbox->dev, "can't allocate completion memory\n"); dev_err(ring->mbox->dev,
"can't allocate completion memory for ring%d\n",
ring->num);
ret = -ENOMEM; ret = -ENOMEM;
goto fail_free_bd_memory; goto fail_free_bd_memory;
} }
...@@ -1269,7 +1273,8 @@ static int flexrm_startup(struct mbox_chan *chan) ...@@ -1269,7 +1273,8 @@ static int flexrm_startup(struct mbox_chan *chan)
/* Request IRQ */ /* Request IRQ */
if (ring->irq == UINT_MAX) { if (ring->irq == UINT_MAX) {
dev_err(ring->mbox->dev, "ring IRQ not available\n"); dev_err(ring->mbox->dev,
"ring%d IRQ not available\n", ring->num);
ret = -ENODEV; ret = -ENODEV;
goto fail_free_cmpl_memory; goto fail_free_cmpl_memory;
} }
...@@ -1278,7 +1283,8 @@ static int flexrm_startup(struct mbox_chan *chan) ...@@ -1278,7 +1283,8 @@ static int flexrm_startup(struct mbox_chan *chan)
flexrm_irq_thread, flexrm_irq_thread,
0, dev_name(ring->mbox->dev), ring); 0, dev_name(ring->mbox->dev), ring);
if (ret) { if (ret) {
dev_err(ring->mbox->dev, "failed to request ring IRQ\n"); dev_err(ring->mbox->dev,
"failed to request ring%d IRQ\n", ring->num);
goto fail_free_cmpl_memory; goto fail_free_cmpl_memory;
} }
ring->irq_requested = true; ring->irq_requested = true;
...@@ -1291,7 +1297,9 @@ static int flexrm_startup(struct mbox_chan *chan) ...@@ -1291,7 +1297,9 @@ static int flexrm_startup(struct mbox_chan *chan)
&ring->irq_aff_hint); &ring->irq_aff_hint);
ret = irq_set_affinity_hint(ring->irq, &ring->irq_aff_hint); ret = irq_set_affinity_hint(ring->irq, &ring->irq_aff_hint);
if (ret) { if (ret) {
dev_err(ring->mbox->dev, "failed to set IRQ affinity hint\n"); dev_err(ring->mbox->dev,
"failed to set IRQ affinity hint for ring%d\n",
ring->num);
goto fail_free_irq; goto fail_free_irq;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment