[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5f47303-b6d2-190b-d38c-d3557a93b111@ti.com>
Date: Tue, 29 Oct 2019 14:22:14 +0530
From: Lokesh Vutla <lokeshvutla@...com>
To: Peter Ujfalusi <peter.ujfalusi@...com>, <vkoul@...nel.org>,
<robh+dt@...nel.org>, <nm@...com>, <ssantosh@...nel.org>
CC: <dan.j.williams@...el.com>, <dmaengine@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<grygorii.strashko@...com>, <t-kristo@...com>, <tony@...mide.com>,
<j-keerthy@...com>
Subject: Re: [PATCH v3 02/14] soc: ti: k3: add navss ringacc driver
Hi Grygorii,
[...snip..]
> +
> +static int k3_ringacc_ring_access_io(struct k3_ring *ring, void *elem,
> + enum k3_ringacc_access_mode access_mode)
> +{
> + void __iomem *ptr;
> +
> + switch (access_mode) {
> + case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
> + case K3_RINGACC_ACCESS_MODE_POP_HEAD:
> + ptr = (void __iomem *)&ring->fifos->head_data;
> + break;
> + case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
> + case K3_RINGACC_ACCESS_MODE_POP_TAIL:
> + ptr = (void __iomem *)&ring->fifos->tail_data;
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + ptr += k3_ringacc_ring_get_fifo_pos(ring);
> +
> + switch (access_mode) {
> + case K3_RINGACC_ACCESS_MODE_POP_HEAD:
> + case K3_RINGACC_ACCESS_MODE_POP_TAIL:
> + dev_dbg(ring->parent->dev,
> + "memcpy_fromio(x): --> ptr(%p), mode:%d\n", ptr,
> + access_mode);
> + memcpy_fromio(elem, ptr, (4 << ring->elm_size));
Does this work for any elem_size < 64 or any element size not aligned with 64?
IIUC, in message mode, ring element should be inserted in a single burst write
and there is no doorbell facility. If the above conditions are not met, we are
supposed to use proxy.
In this driver, I don't see any restrictions on the ring element size for
message mode and directly written to io. Am I missing something?
Thanks and regards,
Lokesh
> + ring->occ--;
> + break;
> + case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
> + case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
> + dev_dbg(ring->parent->dev,
> + "memcpy_toio(x): --> ptr(%p), mode:%d\n", ptr,
> + access_mode);
> + memcpy_toio(ptr, elem, (4 << ring->elm_size));
> + ring->free--;
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + dev_dbg(ring->parent->dev, "free%d index%d occ%d index%d\n", ring->free,
> + ring->windex, ring->occ, ring->rindex);
> + return 0;
> +}
> +
> +static int k3_ringacc_ring_push_head_io(struct k3_ring *ring, void *elem)
> +{
> + return k3_ringacc_ring_access_io(ring, elem,
> + K3_RINGACC_ACCESS_MODE_PUSH_HEAD);
> +}
> +
> +static int k3_ringacc_ring_push_io(struct k3_ring *ring, void *elem)
> +{
> + return k3_ringacc_ring_access_io(ring, elem,
> + K3_RINGACC_ACCESS_MODE_PUSH_TAIL);
> +}
> +
> +static int k3_ringacc_ring_pop_io(struct k3_ring *ring, void *elem)
> +{
> + return k3_ringacc_ring_access_io(ring, elem,
> + K3_RINGACC_ACCESS_MODE_POP_HEAD);
> +}
> +
> +static int k3_ringacc_ring_pop_tail_io(struct k3_ring *ring, void *elem)
> +{
> + return k3_ringacc_ring_access_io(ring, elem,
> + K3_RINGACC_ACCESS_MODE_POP_HEAD);
> +}
> +
Powered by blists - more mailing lists