dma: ti: k3-udma: Use ring_idx to pair k3 nav rings
Subsystems (2)
PATCH v4 1/1 dma: ti: k3-udma: Use ring_idx to pair k3 nav rings
Use ring_idx to pair rings. ring_idx will be same as tx flow_id for all non-negative flow_ids. For negative flow_ids, ring_idx will be tchan->id added with bchan_cnt.
---
Changes from v3 to v4:
*) No functional change. Splitted the patch out of the series as suggested
by Nishant.
v3: https://lore.kernel.org/all/[email protected]/
drivers/dma/ti/k3-udma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/dma/ti/k3-udma.c +9 -2
@@ -876,13 +876,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc) {struct k3_nav_ring_cfg ring_cfg;struct udma_dev *ud = uc->ud; -int ret; +struct udma_tchan *tchan; +int ring_idx, ret; ret =udma_get_tchan (uc);if (ret)return ret; - ret =k3_nav_ringacc_request_rings_pair (ud->ringacc, uc->tchan->id,-1 , + tchan = uc->tchan; +if (tchan->tflow_id >=0 ) + ring_idx = tchan->tflow_id; +else + ring_idx = ud->bchan_cnt + tchan->id; + + ret =k3_nav_ringacc_request_rings_pair (ud->ringacc, ring_idx,-1 , &uc->tchan->t_ring, &uc->tchan->tc_ring);if (ret) {
Signature · 1 line
2.34.1
Quoted 32 lines · MD Danish Anwar
Use
ring_idxto pair rings.ring_idxwill be same as txflow_idfor all non-negativeflow_ids. For negativeflow_ids,ring_idxwill betchan->idadded withbchan_cnt.Signed-off-by MD Danish Anwar <[email protected]>---
Changes from v3 to v4:
*) No functional change. Splitted the patch out of the series as suggested
by Nishant.v3: https://lore.kernel.org/all/[email protected]/
drivers/dma/ti/k3-udma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/dma/ti/k3-udma.c +2
-2@@ -876,13 +876,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc) {struct k3_nav_ring_cfg ring_cfg;struct udma_dev *ud = uc->ud; -int ret; +struct udma_tchan *tchan; +int ring_idx, ret; ret =udma_get_tchan (uc);if (ret)return ret; - ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, uc->tchan->id, -1,
drivers/dma/ti/k3-udma.c static int udma_alloc_tx_resources(struct udma_chan *uc) · line 895
Quoted 10 lines
drivers/dma/ti/k3-udma.c +7
-0+ tchan = uc->tchan; +if (tchan->tflow_id >=0 ) + ring_idx = tchan->tflow_id; +else + ring_idx = ud->bchan_cnt + tchan->id; + + ret =k3_nav_ringacc_request_rings_pair (ud->ringacc, ring_idx,-1 , &uc->tchan->t_ring, &uc->tchan->tc_ring);if (ret) {
I see this change present in upstream linux kernel as well.
You could consider providing the link to kernel if such changes are already merged there.
Quoted 34 lines · Ravi Gunasekaran
Quoted 31 lines · MD Danish Anwar
Use
ring_idxto pair rings.ring_idxwill be same as txflow_idfor all non-negativeflow_ids. For negativeflow_ids,ring_idxwill betchan->idadded withbchan_cnt.Signed-off-by MD Danish Anwar <[email protected]>---
Changes from v3 to v4:
*) No functional change. Splitted the patch out of the series as suggested
by Nishant.v3: https://lore.kernel.org/all/[email protected]/
drivers/dma/ti/k3-udma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/dma/ti/k3-udma.c +2
-1@@ -876,13 +876,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc) {struct k3_nav_ring_cfg ring_cfg;struct udma_dev *ud = uc->ud; -int ret; +struct udma_tchan *tchan; +int ring_idx, ret; ret =udma_get_tchan (uc);if (ret)return ret;
Quoted 15 lines
drivers/dma/ti/k3-udma.c static int udma_alloc_tx_resources(struct udma_chan *uc) · line 895
Quoted 11 lines
drivers/dma/ti/k3-udma.c +7
-1- ret =k3_nav_ringacc_request_rings_pair (ud->ringacc, uc->tchan->id,-1 , + tchan = uc->tchan; +if (tchan->tflow_id >=0 ) + ring_idx = tchan->tflow_id; +else + ring_idx = ud->bchan_cnt + tchan->id; + + ret =k3_nav_ringacc_request_rings_pair (ud->ringacc, ring_idx,-1 , &uc->tchan->t_ring, &uc->tchan->tc_ring);if (ret) {I see this change present in upstream linux kernel as well.
You could consider providing the link to kernel if such changes are already merged there.
Sure Ravi,
Link to upstream kernel code for the same [1]. Upstream Commit: d2abc982333c02f9e1ff1c6b3782174f5b7662d7
Quoted 2 lines
Reviewed-by Ravi Gunasekaran <[email protected]>
Signature · 2 lines
Thanks and Regards, Md Danish Anwar
Quoted 7 lines · MD Danish Anwar
Use
ring_idxto pair rings.ring_idxwill be same as txflow_idfor all non-negativeflow_ids. For negativeflow_ids,ring_idxwill betchan->idadded withbchan_cnt.
Applied to u-boot/master, thanks!
Signature · 1 line
Tom