Skip to contentSkip to conversation

DMA: PL330: Removes useless function

PATCH Superseded Kukjin Kim 3 participants 3 messages Dec 8, 2011 – Dec 12, 2011

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH 2/2 DMA: PL330: Removes useless function

From: Boojin Kim <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/pl330.c |   47 -----------------------------------------------
 1 files changed, 0 insertions(+), 47 deletions(-)
drivers/dma/pl330.c +0 -47
index 35f0904..b917477 100644
@@ -1512,53 +1512,6 @@ static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
 	return ret;
 }
 
-static int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus)
-{
-	struct pl330_thread *thrd = ch_id;
-	struct pl330_dmac *pl330;
-	struct pl330_info *pi;
-	void __iomem *regs;
-	int active;
-	u32 val;
-
-	if (!pstatus || !thrd || thrd->free)
-		return -EINVAL;
-
-	pl330 = thrd->dmac;
-	pi = pl330->pinfo;
-	regs = pi->base;
-
-	/* The client should remove the DMAC and add again */
-	if (pl330->state == DYING)
-		pstatus->dmac_halted = true;
-	else
-		pstatus->dmac_halted = false;
-
-	val = readl(regs + FSC);
-	if (val & (1 << thrd->id))
-		pstatus->faulting = true;
-	else
-		pstatus->faulting = false;
-
-	active = _thrd_active(thrd);
-
-	if (!active) {
-		/* Indicate that the thread is not running */
-		pstatus->top_req = NULL;
-		pstatus->wait_req = NULL;
-	} else {
-		active--;
-		pstatus->top_req = thrd->req[active].r;
-		pstatus->wait_req = !IS_FREE(&thrd->req[1 - active])
-					? thrd->req[1 - active].r : NULL;
-	}
-
-	pstatus->src_addr = readl(regs + SA(thrd->id));
-	pstatus->dst_addr = readl(regs + DA(thrd->id));
-
-	return 0;
-}
-
 /* Reserve an event */
 static inline int _alloc_event(struct pl330_thread *thrd)
 {
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 DMA: PL330: Removes useless function

Quoted 56 lines · Kukjin Kim

From: Boojin Kim <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Vinod Koul <[email protected]>

---
?drivers/dma/pl330.c | ? 47 ----------------------------------------------- ?1 files changed, 0 insertions(+), 47 deletions(-)

drivers/dma/pl330.c +0 -37
index 35f0904..b917477 100644
@@ -1512,53 +1512,6 @@ static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
 ? ? ? ?return ret;
 ?}
 
-static int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus)
-{
- ? ? ? struct pl330_thread *thrd = ch_id;
- ? ? ? struct pl330_dmac *pl330;
- ? ? ? struct pl330_info *pi;
- ? ? ? void __iomem *regs;
- ? ? ? int active;
- ? ? ? u32 val;
-
- ? ? ? if (!pstatus || !thrd || thrd->free)
- ? ? ? ? ? ? ? return -EINVAL;
-
- ? ? ? pl330 = thrd->dmac;
- ? ? ? pi = pl330->pinfo;
- ? ? ? regs = pi->base;
-
- ? ? ? /* The client should remove the DMAC and add again */
- ? ? ? if (pl330->state == DYING)
- ? ? ? ? ? ? ? pstatus->dmac_halted = true;
- ? ? ? else
- ? ? ? ? ? ? ? pstatus->dmac_halted = false;
-
- ? ? ? val = readl(regs + FSC);
- ? ? ? if (val & (1 << thrd->id))
- ? ? ? ? ? ? ? pstatus->faulting = true;
- ? ? ? else
- ? ? ? ? ? ? ? pstatus->faulting = false;
-
- ? ? ? active = _thrd_active(thrd);
-
- ? ? ? if (!active) {
- ? ? ? ? ? ? ? /* Indicate that the thread is not running */
- ? ? ? ? ? ? ? pstatus->top_req = NULL;
- ? ? ? ? ? ? ? pstatus->wait_req = NULL;
- ? ? ? } else {
- ? ? ? ? ? ? ? active--;
- ? ? ? ? ? ? ? pstatus->top_req = thrd->req[active].r;

drivers/dma/pl330.c static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) · line 1515

Quoted 10 lines
drivers/dma/pl330.c +0 -9
- ? ? ? ? ? ? ? pstatus->wait_req = !IS_FREE(&thrd->req[1 - active])
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? thrd->req[1 - active].r : NULL;
- ? ? ? }
-
- ? ? ? pstatus->src_addr = readl(regs + SA(thrd->id));
- ? ? ? pstatus->dst_addr = readl(regs + DA(thrd->id));
-
- ? ? ? return 0;
-}
 

NAK.
Recently Samsung ASoC regressed to update DMA pointer only at period boundaries. I am sure other platforms would like to have low audio latencies and hence need this function.

#2 lore raw

PATCH 2/2 DMA: PL330: Removes useless function

Quoted 70 lines · Jassi Brar

Subject: Re: [PATCH 2/2] DMA: PL330: Removes useless function

Quoted 9 lines · Kukjin Kim

From: Boojin Kim <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/pl330.c |   47 -----------------------------------------

------

drivers/dma/pl330.c static int pl330_chan_ctrl(void *ch_id, enum

Quoted 7 lines
 1 files changed, 0 insertions(+), 47 deletions(-)
drivers/dma/pl330.c +0 -0
index 35f0904..b917477 100644
@@ -1512,53 +1512,6 @@ static int pl330_chan_ctrl(void *ch_id, enum

pl330_chan_op op)

drivers/dma/pl330.c static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)

Quoted 4 lines
drivers/dma/pl330.c +0 -1
       return ret;
 }
 
-static int pl330_chan_status(void *ch_id, struct pl330_chanstatus

*pstatus)

Quoted 43 lines
drivers/dma/pl330.c +0 -43
-{
-       struct pl330_thread *thrd = ch_id;
-       struct pl330_dmac *pl330;
-       struct pl330_info *pi;
-       void __iomem *regs;
-       int active;
-       u32 val;
-
-       if (!pstatus || !thrd || thrd->free)
-               return -EINVAL;
-
-       pl330 = thrd->dmac;
-       pi = pl330->pinfo;
-       regs = pi->base;
-
-       /* The client should remove the DMAC and add again */
-       if (pl330->state == DYING)
-               pstatus->dmac_halted = true;
-       else
-               pstatus->dmac_halted = false;
-
-       val = readl(regs + FSC);
-       if (val & (1 << thrd->id))
-               pstatus->faulting = true;
-       else
-               pstatus->faulting = false;
-
-       active = _thrd_active(thrd);
-
-       if (!active) {
-               /* Indicate that the thread is not running */
-               pstatus->top_req = NULL;
-               pstatus->wait_req = NULL;
-       } else {
-               active--;
-               pstatus->top_req = thrd->req[active].r;
-               pstatus->wait_req = !IS_FREE(&thrd->req[1 - active])
-                                       ? thrd->req[1 - active].r : NULL;
-       }
-
-       pstatus->src_addr = readl(regs + SA(thrd->id));
-       pstatus->dst_addr = readl(regs + DA(thrd->id));
-
Quoted 8 lines

drivers/dma/pl330.c static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)

Quoted 3 lines
drivers/dma/pl330.c +0 -2
-       return 0;
-}
 

NAK.
Recently Samsung ASoC regressed to update DMA pointer only at period boundaries.
I am sure other platforms would like to have low audio latencies and hence need this function.

ASoC doesn't use DMA HW pointer to get its position with the new pl330 driver on dmaengine. So, pl330_chan_status() isn't used anymore. It just brings a build warning.

Thanks you.

Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel