Skip to contentSkip to conversation

kirkwood_egiga: bugfix: add DMA sequence points

PATCH New Albert Aribaud 1 participant 2 messages Jul 10, 2010 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kirkwood_egiga: bugfix: add DMA sequence points

Insert isb() sequence points to ensure DMA descriptors are filled in and set up before actual DMA occurs.

---
 drivers/net/kirkwood_egiga.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/kirkwood_egiga.c +5 -0
index 932792e..9eca2f3 100644
@@ -447,6 +447,8 @@ static int kwgbe_init(struct eth_device *dev)
 
 	/* Assignment of Rx CRDB of given RXUQ */
 	KWGBEREG_WR(regs->rxcdp[RXUQ], (u32) dkwgbe->p_rxdesc_curr);
+	/* ensure previous write is done before enabling Rx DMA */
+	isb();
 	/* Enable port Rx. */
 	KWGBEREG_WR(regs->rqc, (1 << RXUQ));
 
@@ -536,6 +538,9 @@ static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
 	p_txdesc->buf_ptr = (u8 *) p;
 	p_txdesc->byte_cnt = datasize;
 
+	/* ensure tx desc writes above are performed before we start Tx DMA */
+	isb();
+
 	/* Apply send command using zeroth TXUQ */
 	KWGBEREG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc);
 	KWGBEREG_WR(regs->tqc, (1 << TXUQ));
Signature · 1 line
1.6.4.4
#1 lore raw

PATCH 1/1 kirkwood_egiga: bugfix: add DMA sequence points

Please disregard. I have misplaced the second isb().

drivers/net/kirkwood_egiga.c static int kwgbe_send(struct eth_device *dev, volatile void *dataptr, · line 546

Quoted 10 lines
drivers/net/kirkwood_egiga.c +3 -0
@@ -536,6 +538,9 @@ static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
  	p_txdesc->buf_ptr = (u8 *) p;
  	p_txdesc->byte_cnt = datasize;
 
+	/* ensure tx desc writes above are performed before we start Tx DMA */
+	isb();
+
  	/* Apply send command using zeroth TXUQ */
  	KWGBEREG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc);
  	KWGBEREG_WR(regs->tqc, (1<<  TXUQ));

It should actually apprear right before the write to tqc.

Resending correct patch.

Amicalement,

Signature · 1 line
Albert.