Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60d3f982 authored by Phil Sutter's avatar Phil Sutter Committed by David S. Miller
Browse files

korina: do tx at the right position



Triggering TX before the write to the DMA status mask register leads to
transferring packets with maximum payload no matter what the actual
packet size is.
While here, also trigger RX scheduling after writing the DMA status mask
register, like it was in the original driver before it was sent
upstream.

Signed-off-by: default avatarPhil Sutter <n0-1@freewrt.org>
Acked-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4676f63d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -330,13 +330,13 @@ static irqreturn_t korina_rx_dma_interrupt(int irq, void *dev_id)

	dmas = readl(&lp->rx_dma_regs->dmas);
	if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) {
		netif_rx_schedule(&lp->napi);

		dmasm = readl(&lp->rx_dma_regs->dmasm);
		writel(dmasm | (DMA_STAT_DONE |
				DMA_STAT_HALT | DMA_STAT_ERR),
				&lp->rx_dma_regs->dmasm);

		netif_rx_schedule(&lp->napi);

		if (dmas & DMA_STAT_ERR)
			printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name);

@@ -623,12 +623,12 @@ korina_tx_dma_interrupt(int irq, void *dev_id)
	dmas = readl(&lp->tx_dma_regs->dmas);

	if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) {
		korina_tx(dev);

		dmasm = readl(&lp->tx_dma_regs->dmasm);
		writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR),
				&lp->tx_dma_regs->dmasm);

		korina_tx(dev);

		if (lp->tx_chain_status == desc_filled &&
			(readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
			writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]),