summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2017-04-05 08:24:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 17:05:59 +0200
commit141a10aead9ce72ea8b22c036d37bb31c3a693f6 (patch)
tree48430d68560689f8b5fcf804b948e0af8c38c30c /drivers
parentad3dbb9a106fb5f9899b3137534f09507862fed8 (diff)
staging: fsl-mc/dpio: Fix early writing of valid bit
Commands written to the QMan software portals have a valid bit in the "verb" field of the command that, when set with the right value, notifies the hardware that the command is fully written and ready to be processed. The "verb" field should be the last one to be written in the swp command registers, after all other fields are filled in. The current implementation doesn't follow this rule for all commands, which may result in an incompletely configured command being processed by the hardware. Enforce the correct order of writes to avoid this situation. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/fsl-mc/bus/dpio/qbman-portal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
index c75f546b24fa..2a3ea29d9b43 100644
--- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
+++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
@@ -616,13 +616,16 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d)
return -EBUSY;
}
s->vdq.storage = (void *)d->rsp_addr_virt;
- d->tok = QMAN_DQ_TOKEN_VALID;
p = qbman_get_cmd(s, QBMAN_CENA_SWP_VDQCR);
- *p = *d;
+ p->numf = d->numf;
+ p->tok = QMAN_DQ_TOKEN_VALID;
+ p->dq_src = d->dq_src;
+ p->rsp_addr = d->rsp_addr;
+ p->rsp_addr_virt = d->rsp_addr_virt;
dma_wmb();
/* Set the verb byte, have to substitute in the valid-bit */
- p->verb |= s->vdq.valid_bit;
+ p->verb = d->verb | s->vdq.valid_bit;
s->vdq.valid_bit ^= QB_VALID_BIT;
return 0;
@@ -1004,7 +1007,6 @@ int qbman_swp_CDAN_set(struct qbman_swp *s, u16 channelid,
return -EBUSY;
/* Encode the caller-provided attributes */
- p->verb = 0;
p->ch = cpu_to_le16(channelid);
p->we = we_mask;
if (cdan_en)